1 /* Generated by Cython 0.29.23 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [],
7         "extra_compile_args": [
8             "-fopenmp",
9             "-Wno-cpp"
10         ],
11         "extra_link_args": [
12             "-fopenmp"
13         ],
14         "language": "c++",
15         "name": "urh.cythonext.path_creator",
16         "sources": [
17             "src/urh/cythonext/path_creator.pyx"
18         ]
19     },
20     "module_name": "urh.cythonext.path_creator"
21 }
22 END: Cython Metadata */
23 
24 #ifndef PY_SSIZE_T_CLEAN
25 #define PY_SSIZE_T_CLEAN
26 #endif /* PY_SSIZE_T_CLEAN */
27 #include "Python.h"
28 #ifndef Py_PYTHON_H
29     #error Python headers needed to compile C extensions, please install development version of Python.
30 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
31     #error Cython requires Python 2.6+ or Python 3.3+.
32 #else
33 #define CYTHON_ABI "0_29_23"
34 #define CYTHON_HEX_VERSION 0x001D17F0
35 #define CYTHON_FUTURE_DIVISION 1
36 #include <stddef.h>
37 #ifndef offsetof
38   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
39 #endif
40 #if !defined(WIN32) && !defined(MS_WINDOWS)
41   #ifndef __stdcall
42     #define __stdcall
43   #endif
44   #ifndef __cdecl
45     #define __cdecl
46   #endif
47   #ifndef __fastcall
48     #define __fastcall
49   #endif
50 #endif
51 #ifndef DL_IMPORT
52   #define DL_IMPORT(t) t
53 #endif
54 #ifndef DL_EXPORT
55   #define DL_EXPORT(t) t
56 #endif
57 #define __PYX_COMMA ,
58 #ifndef HAVE_LONG_LONG
59   #if PY_VERSION_HEX >= 0x02070000
60     #define HAVE_LONG_LONG
61   #endif
62 #endif
63 #ifndef PY_LONG_LONG
64   #define PY_LONG_LONG LONG_LONG
65 #endif
66 #ifndef Py_HUGE_VAL
67   #define Py_HUGE_VAL HUGE_VAL
68 #endif
69 #ifdef PYPY_VERSION
70   #define CYTHON_COMPILING_IN_PYPY 1
71   #define CYTHON_COMPILING_IN_PYSTON 0
72   #define CYTHON_COMPILING_IN_CPYTHON 0
73   #undef CYTHON_USE_TYPE_SLOTS
74   #define CYTHON_USE_TYPE_SLOTS 0
75   #undef CYTHON_USE_PYTYPE_LOOKUP
76   #define CYTHON_USE_PYTYPE_LOOKUP 0
77   #if PY_VERSION_HEX < 0x03050000
78     #undef CYTHON_USE_ASYNC_SLOTS
79     #define CYTHON_USE_ASYNC_SLOTS 0
80   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
81     #define CYTHON_USE_ASYNC_SLOTS 1
82   #endif
83   #undef CYTHON_USE_PYLIST_INTERNALS
84   #define CYTHON_USE_PYLIST_INTERNALS 0
85   #undef CYTHON_USE_UNICODE_INTERNALS
86   #define CYTHON_USE_UNICODE_INTERNALS 0
87   #undef CYTHON_USE_UNICODE_WRITER
88   #define CYTHON_USE_UNICODE_WRITER 0
89   #undef CYTHON_USE_PYLONG_INTERNALS
90   #define CYTHON_USE_PYLONG_INTERNALS 0
91   #undef CYTHON_AVOID_BORROWED_REFS
92   #define CYTHON_AVOID_BORROWED_REFS 1
93   #undef CYTHON_ASSUME_SAFE_MACROS
94   #define CYTHON_ASSUME_SAFE_MACROS 0
95   #undef CYTHON_UNPACK_METHODS
96   #define CYTHON_UNPACK_METHODS 0
97   #undef CYTHON_FAST_THREAD_STATE
98   #define CYTHON_FAST_THREAD_STATE 0
99   #undef CYTHON_FAST_PYCALL
100   #define CYTHON_FAST_PYCALL 0
101   #undef CYTHON_PEP489_MULTI_PHASE_INIT
102   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
103   #undef CYTHON_USE_TP_FINALIZE
104   #define CYTHON_USE_TP_FINALIZE 0
105   #undef CYTHON_USE_DICT_VERSIONS
106   #define CYTHON_USE_DICT_VERSIONS 0
107   #undef CYTHON_USE_EXC_INFO_STACK
108   #define CYTHON_USE_EXC_INFO_STACK 0
109 #elif defined(PYSTON_VERSION)
110   #define CYTHON_COMPILING_IN_PYPY 0
111   #define CYTHON_COMPILING_IN_PYSTON 1
112   #define CYTHON_COMPILING_IN_CPYTHON 0
113   #ifndef CYTHON_USE_TYPE_SLOTS
114     #define CYTHON_USE_TYPE_SLOTS 1
115   #endif
116   #undef CYTHON_USE_PYTYPE_LOOKUP
117   #define CYTHON_USE_PYTYPE_LOOKUP 0
118   #undef CYTHON_USE_ASYNC_SLOTS
119   #define CYTHON_USE_ASYNC_SLOTS 0
120   #undef CYTHON_USE_PYLIST_INTERNALS
121   #define CYTHON_USE_PYLIST_INTERNALS 0
122   #ifndef CYTHON_USE_UNICODE_INTERNALS
123     #define CYTHON_USE_UNICODE_INTERNALS 1
124   #endif
125   #undef CYTHON_USE_UNICODE_WRITER
126   #define CYTHON_USE_UNICODE_WRITER 0
127   #undef CYTHON_USE_PYLONG_INTERNALS
128   #define CYTHON_USE_PYLONG_INTERNALS 0
129   #ifndef CYTHON_AVOID_BORROWED_REFS
130     #define CYTHON_AVOID_BORROWED_REFS 0
131   #endif
132   #ifndef CYTHON_ASSUME_SAFE_MACROS
133     #define CYTHON_ASSUME_SAFE_MACROS 1
134   #endif
135   #ifndef CYTHON_UNPACK_METHODS
136     #define CYTHON_UNPACK_METHODS 1
137   #endif
138   #undef CYTHON_FAST_THREAD_STATE
139   #define CYTHON_FAST_THREAD_STATE 0
140   #undef CYTHON_FAST_PYCALL
141   #define CYTHON_FAST_PYCALL 0
142   #undef CYTHON_PEP489_MULTI_PHASE_INIT
143   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
144   #undef CYTHON_USE_TP_FINALIZE
145   #define CYTHON_USE_TP_FINALIZE 0
146   #undef CYTHON_USE_DICT_VERSIONS
147   #define CYTHON_USE_DICT_VERSIONS 0
148   #undef CYTHON_USE_EXC_INFO_STACK
149   #define CYTHON_USE_EXC_INFO_STACK 0
150 #else
151   #define CYTHON_COMPILING_IN_PYPY 0
152   #define CYTHON_COMPILING_IN_PYSTON 0
153   #define CYTHON_COMPILING_IN_CPYTHON 1
154   #ifndef CYTHON_USE_TYPE_SLOTS
155     #define CYTHON_USE_TYPE_SLOTS 1
156   #endif
157   #if PY_VERSION_HEX < 0x02070000
158     #undef CYTHON_USE_PYTYPE_LOOKUP
159     #define CYTHON_USE_PYTYPE_LOOKUP 0
160   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
161     #define CYTHON_USE_PYTYPE_LOOKUP 1
162   #endif
163   #if PY_MAJOR_VERSION < 3
164     #undef CYTHON_USE_ASYNC_SLOTS
165     #define CYTHON_USE_ASYNC_SLOTS 0
166   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
167     #define CYTHON_USE_ASYNC_SLOTS 1
168   #endif
169   #if PY_VERSION_HEX < 0x02070000
170     #undef CYTHON_USE_PYLONG_INTERNALS
171     #define CYTHON_USE_PYLONG_INTERNALS 0
172   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
173     #define CYTHON_USE_PYLONG_INTERNALS 1
174   #endif
175   #ifndef CYTHON_USE_PYLIST_INTERNALS
176     #define CYTHON_USE_PYLIST_INTERNALS 1
177   #endif
178   #ifndef CYTHON_USE_UNICODE_INTERNALS
179     #define CYTHON_USE_UNICODE_INTERNALS 1
180   #endif
181   #if PY_VERSION_HEX < 0x030300F0
182     #undef CYTHON_USE_UNICODE_WRITER
183     #define CYTHON_USE_UNICODE_WRITER 0
184   #elif !defined(CYTHON_USE_UNICODE_WRITER)
185     #define CYTHON_USE_UNICODE_WRITER 1
186   #endif
187   #ifndef CYTHON_AVOID_BORROWED_REFS
188     #define CYTHON_AVOID_BORROWED_REFS 0
189   #endif
190   #ifndef CYTHON_ASSUME_SAFE_MACROS
191     #define CYTHON_ASSUME_SAFE_MACROS 1
192   #endif
193   #ifndef CYTHON_UNPACK_METHODS
194     #define CYTHON_UNPACK_METHODS 1
195   #endif
196   #ifndef CYTHON_FAST_THREAD_STATE
197     #define CYTHON_FAST_THREAD_STATE 1
198   #endif
199   #ifndef CYTHON_FAST_PYCALL
200     #define CYTHON_FAST_PYCALL 1
201   #endif
202   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
203     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
204   #endif
205   #ifndef CYTHON_USE_TP_FINALIZE
206     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
207   #endif
208   #ifndef CYTHON_USE_DICT_VERSIONS
209     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
210   #endif
211   #ifndef CYTHON_USE_EXC_INFO_STACK
212     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
213   #endif
214 #endif
215 #if !defined(CYTHON_FAST_PYCCALL)
216 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
217 #endif
218 #if CYTHON_USE_PYLONG_INTERNALS
219   #include "longintrepr.h"
220   #undef SHIFT
221   #undef BASE
222   #undef MASK
223   #ifdef SIZEOF_VOID_P
224     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
225   #endif
226 #endif
227 #ifndef __has_attribute
228   #define __has_attribute(x) 0
229 #endif
230 #ifndef __has_cpp_attribute
231   #define __has_cpp_attribute(x) 0
232 #endif
233 #ifndef CYTHON_RESTRICT
234   #if defined(__GNUC__)
235     #define CYTHON_RESTRICT __restrict__
236   #elif defined(_MSC_VER) && _MSC_VER >= 1400
237     #define CYTHON_RESTRICT __restrict
238   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
239     #define CYTHON_RESTRICT restrict
240   #else
241     #define CYTHON_RESTRICT
242   #endif
243 #endif
244 #ifndef CYTHON_UNUSED
245 # if defined(__GNUC__)
246 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
247 #     define CYTHON_UNUSED __attribute__ ((__unused__))
248 #   else
249 #     define CYTHON_UNUSED
250 #   endif
251 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
252 #   define CYTHON_UNUSED __attribute__ ((__unused__))
253 # else
254 #   define CYTHON_UNUSED
255 # endif
256 #endif
257 #ifndef CYTHON_MAYBE_UNUSED_VAR
258 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)259      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
260 #  else
261 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
262 #  endif
263 #endif
264 #ifndef CYTHON_NCP_UNUSED
265 # if CYTHON_COMPILING_IN_CPYTHON
266 #  define CYTHON_NCP_UNUSED
267 # else
268 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
269 # endif
270 #endif
271 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
272 #ifdef _MSC_VER
273     #ifndef _MSC_STDINT_H_
274         #if _MSC_VER < 1300
275            typedef unsigned char     uint8_t;
276            typedef unsigned int      uint32_t;
277         #else
278            typedef unsigned __int8   uint8_t;
279            typedef unsigned __int32  uint32_t;
280         #endif
281     #endif
282 #else
283    #include <stdint.h>
284 #endif
285 #ifndef CYTHON_FALLTHROUGH
286   #if defined(__cplusplus) && __cplusplus >= 201103L
287     #if __has_cpp_attribute(fallthrough)
288       #define CYTHON_FALLTHROUGH [[fallthrough]]
289     #elif __has_cpp_attribute(clang::fallthrough)
290       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
291     #elif __has_cpp_attribute(gnu::fallthrough)
292       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
293     #endif
294   #endif
295   #ifndef CYTHON_FALLTHROUGH
296     #if __has_attribute(fallthrough)
297       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
298     #else
299       #define CYTHON_FALLTHROUGH
300     #endif
301   #endif
302   #if defined(__clang__ ) && defined(__apple_build_version__)
303     #if __apple_build_version__ < 7000000
304       #undef  CYTHON_FALLTHROUGH
305       #define CYTHON_FALLTHROUGH
306     #endif
307   #endif
308 #endif
309 
310 #ifndef __cplusplus
311   #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
312 #endif
313 #ifndef CYTHON_INLINE
314   #if defined(__clang__)
315     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
316   #else
317     #define CYTHON_INLINE inline
318   #endif
319 #endif
320 template<typename T>
__Pyx_call_destructor(T & x)321 void __Pyx_call_destructor(T& x) {
322     x.~T();
323 }
324 template<typename T>
325 class __Pyx_FakeReference {
326   public:
__Pyx_FakeReference()327     __Pyx_FakeReference() : ptr(NULL) { }
__Pyx_FakeReference(const T & ref)328     __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
operator ->()329     T *operator->() { return ptr; }
operator &()330     T *operator&() { return ptr; }
operator T&()331     operator T&() { return *ptr; }
operator ==(U other)332     template<typename U> bool operator ==(U other) { return *ptr == other; }
operator !=(U other)333     template<typename U> bool operator !=(U other) { return *ptr != other; }
334   private:
335     T *ptr;
336 };
337 
338 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
339   #define Py_OptimizeFlag 0
340 #endif
341 #define __PYX_BUILD_PY_SSIZE_T "n"
342 #define CYTHON_FORMAT_SSIZE_T "z"
343 #if PY_MAJOR_VERSION < 3
344   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
345   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
346           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
347   #define __Pyx_DefaultClassType PyClass_Type
348 #else
349   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
350 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
351   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
352           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
353 #else
354   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
355           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
356 #endif
357   #define __Pyx_DefaultClassType PyType_Type
358 #endif
359 #ifndef Py_TPFLAGS_CHECKTYPES
360   #define Py_TPFLAGS_CHECKTYPES 0
361 #endif
362 #ifndef Py_TPFLAGS_HAVE_INDEX
363   #define Py_TPFLAGS_HAVE_INDEX 0
364 #endif
365 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
366   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
367 #endif
368 #ifndef Py_TPFLAGS_HAVE_FINALIZE
369   #define Py_TPFLAGS_HAVE_FINALIZE 0
370 #endif
371 #ifndef METH_STACKLESS
372   #define METH_STACKLESS 0
373 #endif
374 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
375   #ifndef METH_FASTCALL
376      #define METH_FASTCALL 0x80
377   #endif
378   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
379   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
380                                                           Py_ssize_t nargs, PyObject *kwnames);
381 #else
382   #define __Pyx_PyCFunctionFast _PyCFunctionFast
383   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
384 #endif
385 #if CYTHON_FAST_PYCCALL
386 #define __Pyx_PyFastCFunction_Check(func)\
387     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
388 #else
389 #define __Pyx_PyFastCFunction_Check(func) 0
390 #endif
391 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
392   #define PyObject_Malloc(s)   PyMem_Malloc(s)
393   #define PyObject_Free(p)     PyMem_Free(p)
394   #define PyObject_Realloc(p)  PyMem_Realloc(p)
395 #endif
396 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
397   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
398   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
399   #define PyMem_RawFree(p)             PyMem_Free(p)
400 #endif
401 #if CYTHON_COMPILING_IN_PYSTON
402   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
403   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
404 #else
405   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
406   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
407 #endif
408 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
409   #define __Pyx_PyThreadState_Current PyThreadState_GET()
410 #elif PY_VERSION_HEX >= 0x03060000
411   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
412 #elif PY_VERSION_HEX >= 0x03000000
413   #define __Pyx_PyThreadState_Current PyThreadState_GET()
414 #else
415   #define __Pyx_PyThreadState_Current _PyThreadState_Current
416 #endif
417 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
418 #include "pythread.h"
419 #define Py_tss_NEEDS_INIT 0
420 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)421 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
422   *key = PyThread_create_key();
423   return 0;
424 }
PyThread_tss_alloc(void)425 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
426   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
427   *key = Py_tss_NEEDS_INIT;
428   return key;
429 }
PyThread_tss_free(Py_tss_t * key)430 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
431   PyObject_Free(key);
432 }
PyThread_tss_is_created(Py_tss_t * key)433 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
434   return *key != Py_tss_NEEDS_INIT;
435 }
PyThread_tss_delete(Py_tss_t * key)436 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
437   PyThread_delete_key(*key);
438   *key = Py_tss_NEEDS_INIT;
439 }
PyThread_tss_set(Py_tss_t * key,void * value)440 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
441   return PyThread_set_key_value(*key, value);
442 }
PyThread_tss_get(Py_tss_t * key)443 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
444   return PyThread_get_key_value(*key);
445 }
446 #endif
447 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
448 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
449 #else
450 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
451 #endif
452 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
453   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
454   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
455 #else
456   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
457   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
458 #endif
459 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
460 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
461 #else
462 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
463 #endif
464 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
465   #define CYTHON_PEP393_ENABLED 1
466   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
467                                               0 : _PyUnicode_Ready((PyObject *)(op)))
468   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
469   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
470   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
471   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
472   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
473   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
474   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
475   #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
476   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
477   #else
478   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
479   #endif
480 #else
481   #define CYTHON_PEP393_ENABLED 0
482   #define PyUnicode_1BYTE_KIND  1
483   #define PyUnicode_2BYTE_KIND  2
484   #define PyUnicode_4BYTE_KIND  4
485   #define __Pyx_PyUnicode_READY(op)       (0)
486   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
487   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
488   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
489   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
490   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
491   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
492   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
493   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
494 #endif
495 #if CYTHON_COMPILING_IN_PYPY
496   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
497   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
498 #else
499   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
500   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
501       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
502 #endif
503 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
504   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
505 #endif
506 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
507   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
508 #endif
509 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
510   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
511 #endif
512 #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))
513 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
514 #if PY_MAJOR_VERSION >= 3
515   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
516 #else
517   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
518 #endif
519 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
520   #define PyObject_ASCII(o)            PyObject_Repr(o)
521 #endif
522 #if PY_MAJOR_VERSION >= 3
523   #define PyBaseString_Type            PyUnicode_Type
524   #define PyStringObject               PyUnicodeObject
525   #define PyString_Type                PyUnicode_Type
526   #define PyString_Check               PyUnicode_Check
527   #define PyString_CheckExact          PyUnicode_CheckExact
528 #ifndef PyObject_Unicode
529   #define PyObject_Unicode             PyObject_Str
530 #endif
531 #endif
532 #if PY_MAJOR_VERSION >= 3
533   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
534   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
535 #else
536   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
537   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
538 #endif
539 #ifndef PySet_CheckExact
540   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
541 #endif
542 #if PY_VERSION_HEX >= 0x030900A4
543   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
544   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
545 #else
546   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
547   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
548 #endif
549 #if CYTHON_ASSUME_SAFE_MACROS
550   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
551 #else
552   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
553 #endif
554 #if PY_MAJOR_VERSION >= 3
555   #define PyIntObject                  PyLongObject
556   #define PyInt_Type                   PyLong_Type
557   #define PyInt_Check(op)              PyLong_Check(op)
558   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
559   #define PyInt_FromString             PyLong_FromString
560   #define PyInt_FromUnicode            PyLong_FromUnicode
561   #define PyInt_FromLong               PyLong_FromLong
562   #define PyInt_FromSize_t             PyLong_FromSize_t
563   #define PyInt_FromSsize_t            PyLong_FromSsize_t
564   #define PyInt_AsLong                 PyLong_AsLong
565   #define PyInt_AS_LONG                PyLong_AS_LONG
566   #define PyInt_AsSsize_t              PyLong_AsSsize_t
567   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
568   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
569   #define PyNumber_Int                 PyNumber_Long
570 #endif
571 #if PY_MAJOR_VERSION >= 3
572   #define PyBoolObject                 PyLongObject
573 #endif
574 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
575   #ifndef PyUnicode_InternFromString
576     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
577   #endif
578 #endif
579 #if PY_VERSION_HEX < 0x030200A4
580   typedef long Py_hash_t;
581   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
582   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
583 #else
584   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
585   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
586 #endif
587 #if PY_MAJOR_VERSION >= 3
588   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
589 #else
590   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
591 #endif
592 #if CYTHON_USE_ASYNC_SLOTS
593   #if PY_VERSION_HEX >= 0x030500B1
594     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
595     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
596   #else
597     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
598   #endif
599 #else
600   #define __Pyx_PyType_AsAsync(obj) NULL
601 #endif
602 #ifndef __Pyx_PyAsyncMethodsStruct
603     typedef struct {
604         unaryfunc am_await;
605         unaryfunc am_aiter;
606         unaryfunc am_anext;
607     } __Pyx_PyAsyncMethodsStruct;
608 #endif
609 
610 #if defined(WIN32) || defined(MS_WINDOWS)
611   #define _USE_MATH_DEFINES
612 #endif
613 #include <math.h>
614 #ifdef NAN
615 #define __PYX_NAN() ((float) NAN)
616 #else
__PYX_NAN()617 static CYTHON_INLINE float __PYX_NAN() {
618   float value;
619   memset(&value, 0xFF, sizeof(value));
620   return value;
621 }
622 #endif
623 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
624 #define __Pyx_truncl trunc
625 #else
626 #define __Pyx_truncl truncl
627 #endif
628 
629 #define __PYX_MARK_ERR_POS(f_index, lineno) \
630     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
631 #define __PYX_ERR(f_index, lineno, Ln_error) \
632     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
633 
634 #ifndef __PYX_EXTERN_C
635   #ifdef __cplusplus
636     #define __PYX_EXTERN_C extern "C"
637   #else
638     #define __PYX_EXTERN_C extern
639   #endif
640 #endif
641 
642 #define __PYX_HAVE__urh__cythonext__path_creator
643 #define __PYX_HAVE_API__urh__cythonext__path_creator
644 /* Early includes */
645 #include <string.h>
646 #include <stdio.h>
647 #include "numpy/arrayobject.h"
648 #include "numpy/ndarrayobject.h"
649 #include "numpy/ndarraytypes.h"
650 #include "numpy/arrayscalars.h"
651 #include "numpy/ufuncobject.h"
652 
653     /* NumPy API declarations from "numpy/__init__.pxd" */
654 
655 #include <stdint.h>
656 #include "pythread.h"
657 #include <stdlib.h>
658 #include "pystate.h"
659 #ifdef _OPENMP
660 #include <omp.h>
661 #endif /* _OPENMP */
662 
663 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
664 #define CYTHON_WITHOUT_ASSERTIONS
665 #endif
666 
667 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
668                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
669 
670 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
671 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
672 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
673 #define __PYX_DEFAULT_STRING_ENCODING ""
674 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
675 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
676 #define __Pyx_uchar_cast(c) ((unsigned char)c)
677 #define __Pyx_long_cast(x) ((long)x)
678 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
679     (sizeof(type) < sizeof(Py_ssize_t))  ||\
680     (sizeof(type) > sizeof(Py_ssize_t) &&\
681           likely(v < (type)PY_SSIZE_T_MAX ||\
682                  v == (type)PY_SSIZE_T_MAX)  &&\
683           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
684                                 v == (type)PY_SSIZE_T_MIN)))  ||\
685     (sizeof(type) == sizeof(Py_ssize_t) &&\
686           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
687                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)688 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
689     return (size_t) i < (size_t) limit;
690 }
691 #if defined (__cplusplus) && __cplusplus >= 201103L
692     #include <cstdlib>
693     #define __Pyx_sst_abs(value) std::abs(value)
694 #elif SIZEOF_INT >= SIZEOF_SIZE_T
695     #define __Pyx_sst_abs(value) abs(value)
696 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
697     #define __Pyx_sst_abs(value) labs(value)
698 #elif defined (_MSC_VER)
699     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
700 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
701     #define __Pyx_sst_abs(value) llabs(value)
702 #elif defined (__GNUC__)
703     #define __Pyx_sst_abs(value) __builtin_llabs(value)
704 #else
705     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
706 #endif
707 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
708 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
709 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
710 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
711 #define __Pyx_PyBytes_FromString        PyBytes_FromString
712 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
713 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
714 #if PY_MAJOR_VERSION < 3
715     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
716     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
717 #else
718     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
719     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
720 #endif
721 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
722 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
723 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
724 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
725 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
726 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
727 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
728 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
729 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
730 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
731 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
732 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
733 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
734 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
735 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
736 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)737 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
738     const Py_UNICODE *u_end = u;
739     while (*u_end++) ;
740     return (size_t)(u_end - u - 1);
741 }
742 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
743 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
744 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
745 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
746 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
747 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
748 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
749 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
750 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
751 #define __Pyx_PySequence_Tuple(obj)\
752     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
753 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
754 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
755 #if CYTHON_ASSUME_SAFE_MACROS
756 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
757 #else
758 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
759 #endif
760 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
761 #if PY_MAJOR_VERSION >= 3
762 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
763 #else
764 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
765 #endif
766 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
767 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
768 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)769 static int __Pyx_init_sys_getdefaultencoding_params(void) {
770     PyObject* sys;
771     PyObject* default_encoding = NULL;
772     PyObject* ascii_chars_u = NULL;
773     PyObject* ascii_chars_b = NULL;
774     const char* default_encoding_c;
775     sys = PyImport_ImportModule("sys");
776     if (!sys) goto bad;
777     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
778     Py_DECREF(sys);
779     if (!default_encoding) goto bad;
780     default_encoding_c = PyBytes_AsString(default_encoding);
781     if (!default_encoding_c) goto bad;
782     if (strcmp(default_encoding_c, "ascii") == 0) {
783         __Pyx_sys_getdefaultencoding_not_ascii = 0;
784     } else {
785         char ascii_chars[128];
786         int c;
787         for (c = 0; c < 128; c++) {
788             ascii_chars[c] = c;
789         }
790         __Pyx_sys_getdefaultencoding_not_ascii = 1;
791         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
792         if (!ascii_chars_u) goto bad;
793         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
794         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
795             PyErr_Format(
796                 PyExc_ValueError,
797                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
798                 default_encoding_c);
799             goto bad;
800         }
801         Py_DECREF(ascii_chars_u);
802         Py_DECREF(ascii_chars_b);
803     }
804     Py_DECREF(default_encoding);
805     return 0;
806 bad:
807     Py_XDECREF(default_encoding);
808     Py_XDECREF(ascii_chars_u);
809     Py_XDECREF(ascii_chars_b);
810     return -1;
811 }
812 #endif
813 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
814 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
815 #else
816 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
817 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
818 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)819 static int __Pyx_init_sys_getdefaultencoding_params(void) {
820     PyObject* sys;
821     PyObject* default_encoding = NULL;
822     char* default_encoding_c;
823     sys = PyImport_ImportModule("sys");
824     if (!sys) goto bad;
825     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
826     Py_DECREF(sys);
827     if (!default_encoding) goto bad;
828     default_encoding_c = PyBytes_AsString(default_encoding);
829     if (!default_encoding_c) goto bad;
830     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
831     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
832     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
833     Py_DECREF(default_encoding);
834     return 0;
835 bad:
836     Py_XDECREF(default_encoding);
837     return -1;
838 }
839 #endif
840 #endif
841 
842 
843 /* Test for GCC > 2.95 */
844 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
845   #define likely(x)   __builtin_expect(!!(x), 1)
846   #define unlikely(x) __builtin_expect(!!(x), 0)
847 #else /* !__GNUC__ or GCC < 2.95 */
848   #define likely(x)   (x)
849   #define unlikely(x) (x)
850 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)851 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
852 
853 static PyObject *__pyx_m = NULL;
854 static PyObject *__pyx_d;
855 static PyObject *__pyx_b;
856 static PyObject *__pyx_cython_runtime = NULL;
857 static PyObject *__pyx_empty_tuple;
858 static PyObject *__pyx_empty_bytes;
859 static PyObject *__pyx_empty_unicode;
860 static int __pyx_lineno;
861 static int __pyx_clineno = 0;
862 static const char * __pyx_cfilenm= __FILE__;
863 static const char *__pyx_filename;
864 
865 /* Header.proto */
866 #if !defined(CYTHON_CCOMPLEX)
867   #if defined(__cplusplus)
868     #define CYTHON_CCOMPLEX 1
869   #elif defined(_Complex_I)
870     #define CYTHON_CCOMPLEX 1
871   #else
872     #define CYTHON_CCOMPLEX 0
873   #endif
874 #endif
875 #if CYTHON_CCOMPLEX
876   #ifdef __cplusplus
877     #include <complex>
878   #else
879     #include <complex.h>
880   #endif
881 #endif
882 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
883   #undef _Complex_I
884   #define _Complex_I 1.0fj
885 #endif
886 
887 
888 static const char *__pyx_f[] = {
889   "src/urh/cythonext/path_creator.pyx",
890   "__init__.pxd",
891   "stringsource",
892   "type.pxd",
893 };
894 /* NoFastGil.proto */
895 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
896 #define __Pyx_PyGILState_Release PyGILState_Release
897 #define __Pyx_FastGIL_Remember()
898 #define __Pyx_FastGIL_Forget()
899 #define __Pyx_FastGilFuncInit()
900 
901 /* MemviewSliceStruct.proto */
902 struct __pyx_memoryview_obj;
903 typedef struct {
904   struct __pyx_memoryview_obj *memview;
905   char *data;
906   Py_ssize_t shape[8];
907   Py_ssize_t strides[8];
908   Py_ssize_t suboffsets[8];
909 } __Pyx_memviewslice;
910 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
911 
912 /* Atomics.proto */
913 #include <pythread.h>
914 #ifndef CYTHON_ATOMICS
915     #define CYTHON_ATOMICS 1
916 #endif
917 #define __pyx_atomic_int_type int
918 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
919                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
920                     !defined(__i386__)
921     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
922     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
923     #ifdef __PYX_DEBUG_ATOMICS
924         #warning "Using GNU atomics"
925     #endif
926 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
927     #include <Windows.h>
928     #undef __pyx_atomic_int_type
929     #define __pyx_atomic_int_type LONG
930     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
931     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
932     #ifdef __PYX_DEBUG_ATOMICS
933         #pragma message ("Using MSVC atomics")
934     #endif
935 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
936     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
937     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
938     #ifdef __PYX_DEBUG_ATOMICS
939         #warning "Using Intel atomics"
940     #endif
941 #else
942     #undef CYTHON_ATOMICS
943     #define CYTHON_ATOMICS 0
944     #ifdef __PYX_DEBUG_ATOMICS
945         #warning "Not using atomics"
946     #endif
947 #endif
948 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
949 #if CYTHON_ATOMICS
950     #define __pyx_add_acquisition_count(memview)\
951              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
952     #define __pyx_sub_acquisition_count(memview)\
953             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
954 #else
955     #define __pyx_add_acquisition_count(memview)\
956             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
957     #define __pyx_sub_acquisition_count(memview)\
958             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
959 #endif
960 
961 /* ForceInitThreads.proto */
962 #ifndef __PYX_FORCE_INIT_THREADS
963   #define __PYX_FORCE_INIT_THREADS 0
964 #endif
965 
966 /* BufferFormatStructs.proto */
967 #define IS_UNSIGNED(type) (((type) -1) > 0)
968 struct __Pyx_StructField_;
969 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
970 typedef struct {
971   const char* name;
972   struct __Pyx_StructField_* fields;
973   size_t size;
974   size_t arraysize[8];
975   int ndim;
976   char typegroup;
977   char is_unsigned;
978   int flags;
979 } __Pyx_TypeInfo;
980 typedef struct __Pyx_StructField_ {
981   __Pyx_TypeInfo* type;
982   const char* name;
983   size_t offset;
984 } __Pyx_StructField;
985 typedef struct {
986   __Pyx_StructField* field;
987   size_t parent_offset;
988 } __Pyx_BufFmt_StackElem;
989 typedef struct {
990   __Pyx_StructField root;
991   __Pyx_BufFmt_StackElem* head;
992   size_t fmt_offset;
993   size_t new_count, enc_count;
994   size_t struct_alignment;
995   int is_complex;
996   char enc_type;
997   char new_packmode;
998   char enc_packmode;
999   char is_valid_array;
1000 } __Pyx_BufFmt_Context;
1001 
1002 
1003 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":690
1004  * # in Cython to enable them only on the right systems.
1005  *
1006  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
1007  * ctypedef npy_int16      int16_t
1008  * ctypedef npy_int32      int32_t
1009  */
1010 typedef npy_int8 __pyx_t_5numpy_int8_t;
1011 
1012 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":691
1013  *
1014  * ctypedef npy_int8       int8_t
1015  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
1016  * ctypedef npy_int32      int32_t
1017  * ctypedef npy_int64      int64_t
1018  */
1019 typedef npy_int16 __pyx_t_5numpy_int16_t;
1020 
1021 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":692
1022  * ctypedef npy_int8       int8_t
1023  * ctypedef npy_int16      int16_t
1024  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1025  * ctypedef npy_int64      int64_t
1026  * #ctypedef npy_int96      int96_t
1027  */
1028 typedef npy_int32 __pyx_t_5numpy_int32_t;
1029 
1030 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":693
1031  * ctypedef npy_int16      int16_t
1032  * ctypedef npy_int32      int32_t
1033  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1034  * #ctypedef npy_int96      int96_t
1035  * #ctypedef npy_int128     int128_t
1036  */
1037 typedef npy_int64 __pyx_t_5numpy_int64_t;
1038 
1039 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":697
1040  * #ctypedef npy_int128     int128_t
1041  *
1042  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1043  * ctypedef npy_uint16     uint16_t
1044  * ctypedef npy_uint32     uint32_t
1045  */
1046 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1047 
1048 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":698
1049  *
1050  * ctypedef npy_uint8      uint8_t
1051  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1052  * ctypedef npy_uint32     uint32_t
1053  * ctypedef npy_uint64     uint64_t
1054  */
1055 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1056 
1057 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":699
1058  * ctypedef npy_uint8      uint8_t
1059  * ctypedef npy_uint16     uint16_t
1060  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1061  * ctypedef npy_uint64     uint64_t
1062  * #ctypedef npy_uint96     uint96_t
1063  */
1064 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1065 
1066 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":700
1067  * ctypedef npy_uint16     uint16_t
1068  * ctypedef npy_uint32     uint32_t
1069  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1070  * #ctypedef npy_uint96     uint96_t
1071  * #ctypedef npy_uint128    uint128_t
1072  */
1073 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1074 
1075 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":704
1076  * #ctypedef npy_uint128    uint128_t
1077  *
1078  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1079  * ctypedef npy_float64    float64_t
1080  * #ctypedef npy_float80    float80_t
1081  */
1082 typedef npy_float32 __pyx_t_5numpy_float32_t;
1083 
1084 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":705
1085  *
1086  * ctypedef npy_float32    float32_t
1087  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1088  * #ctypedef npy_float80    float80_t
1089  * #ctypedef npy_float128   float128_t
1090  */
1091 typedef npy_float64 __pyx_t_5numpy_float64_t;
1092 
1093 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":714
1094  * # The int types are mapped a bit surprising --
1095  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1096  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1097  * ctypedef npy_longlong   long_t
1098  * ctypedef npy_longlong   longlong_t
1099  */
1100 typedef npy_long __pyx_t_5numpy_int_t;
1101 
1102 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":715
1103  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1104  * ctypedef npy_long       int_t
1105  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1106  * ctypedef npy_longlong   longlong_t
1107  *
1108  */
1109 typedef npy_longlong __pyx_t_5numpy_long_t;
1110 
1111 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":716
1112  * ctypedef npy_long       int_t
1113  * ctypedef npy_longlong   long_t
1114  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1115  *
1116  * ctypedef npy_ulong      uint_t
1117  */
1118 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1119 
1120 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":718
1121  * ctypedef npy_longlong   longlong_t
1122  *
1123  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1124  * ctypedef npy_ulonglong  ulong_t
1125  * ctypedef npy_ulonglong  ulonglong_t
1126  */
1127 typedef npy_ulong __pyx_t_5numpy_uint_t;
1128 
1129 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":719
1130  *
1131  * ctypedef npy_ulong      uint_t
1132  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1133  * ctypedef npy_ulonglong  ulonglong_t
1134  *
1135  */
1136 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1137 
1138 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":720
1139  * ctypedef npy_ulong      uint_t
1140  * ctypedef npy_ulonglong  ulong_t
1141  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1142  *
1143  * ctypedef npy_intp       intp_t
1144  */
1145 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1146 
1147 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":722
1148  * ctypedef npy_ulonglong  ulonglong_t
1149  *
1150  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1151  * ctypedef npy_uintp      uintp_t
1152  *
1153  */
1154 typedef npy_intp __pyx_t_5numpy_intp_t;
1155 
1156 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":723
1157  *
1158  * ctypedef npy_intp       intp_t
1159  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1160  *
1161  * ctypedef npy_double     float_t
1162  */
1163 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1164 
1165 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":725
1166  * ctypedef npy_uintp      uintp_t
1167  *
1168  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1169  * ctypedef npy_double     double_t
1170  * ctypedef npy_longdouble longdouble_t
1171  */
1172 typedef npy_double __pyx_t_5numpy_float_t;
1173 
1174 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":726
1175  *
1176  * ctypedef npy_double     float_t
1177  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1178  * ctypedef npy_longdouble longdouble_t
1179  *
1180  */
1181 typedef npy_double __pyx_t_5numpy_double_t;
1182 
1183 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":727
1184  * ctypedef npy_double     float_t
1185  * ctypedef npy_double     double_t
1186  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1187  *
1188  * ctypedef npy_cfloat      cfloat_t
1189  */
1190 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1191 /* Declarations.proto */
1192 #if CYTHON_CCOMPLEX
1193   #ifdef __cplusplus
1194     typedef ::std::complex< float > __pyx_t_float_complex;
1195   #else
1196     typedef float _Complex __pyx_t_float_complex;
1197   #endif
1198 #else
1199     typedef struct { float real, imag; } __pyx_t_float_complex;
1200 #endif
1201 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1202 
1203 /* Declarations.proto */
1204 #if CYTHON_CCOMPLEX
1205   #ifdef __cplusplus
1206     typedef ::std::complex< double > __pyx_t_double_complex;
1207   #else
1208     typedef double _Complex __pyx_t_double_complex;
1209   #endif
1210 #else
1211     typedef struct { double real, imag; } __pyx_t_double_complex;
1212 #endif
1213 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1214 
1215 
1216 /*--- Type declarations ---*/
1217 struct __pyx_array_obj;
1218 struct __pyx_MemviewEnum_obj;
1219 struct __pyx_memoryview_obj;
1220 struct __pyx_memoryviewslice_obj;
1221 
1222 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":729
1223  * ctypedef npy_longdouble longdouble_t
1224  *
1225  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1226  * ctypedef npy_cdouble     cdouble_t
1227  * ctypedef npy_clongdouble clongdouble_t
1228  */
1229 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1230 
1231 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":730
1232  *
1233  * ctypedef npy_cfloat      cfloat_t
1234  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1235  * ctypedef npy_clongdouble clongdouble_t
1236  *
1237  */
1238 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1239 
1240 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":731
1241  * ctypedef npy_cfloat      cfloat_t
1242  * ctypedef npy_cdouble     cdouble_t
1243  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1244  *
1245  * ctypedef npy_cdouble     complex_t
1246  */
1247 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1248 
1249 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":733
1250  * ctypedef npy_clongdouble clongdouble_t
1251  *
1252  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1253  *
1254  * cdef inline object PyArray_MultiIterNew1(a):
1255  */
1256 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1257 struct __pyx_opt_args_3urh_9cythonext_4util_bit_array_to_number;
1258 
1259 /* "urh/cythonext/util.pxd":12
1260  * from libc.stdint cimport uint64_t, uint8_t, int64_t
1261  *
1262  * cpdef uint64_t bit_array_to_number(uint8_t[:] bits, int64_t end, int64_t start=*) nogil             # <<<<<<<<<<<<<<
1263  */
1264 struct __pyx_opt_args_3urh_9cythonext_4util_bit_array_to_number {
1265   int __pyx_n;
1266   int64_t start;
1267 };
1268 struct __pyx_fuse_0__pyx_opt_args_3urh_9cythonext_12path_creator_create_path;
1269 struct __pyx_fuse_1__pyx_opt_args_3urh_9cythonext_12path_creator_create_path;
1270 struct __pyx_fuse_2__pyx_opt_args_3urh_9cythonext_12path_creator_create_path;
1271 struct __pyx_fuse_3__pyx_opt_args_3urh_9cythonext_12path_creator_create_path;
1272 struct __pyx_fuse_4__pyx_opt_args_3urh_9cythonext_12path_creator_create_path;
1273 
1274 /* "urh/cythonext/path_creator.pyx":19
1275  * import struct
1276  *
1277  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
1278  *     cdef iq[:] values
1279  *     cdef long long[::1] sample_rng
1280  */
1281 struct __pyx_fuse_0__pyx_opt_args_3urh_9cythonext_12path_creator_create_path {
1282   int __pyx_n;
1283   PyObject *subpath_ranges;
1284 };
1285 struct __pyx_fuse_1__pyx_opt_args_3urh_9cythonext_12path_creator_create_path {
1286   int __pyx_n;
1287   PyObject *subpath_ranges;
1288 };
1289 struct __pyx_fuse_2__pyx_opt_args_3urh_9cythonext_12path_creator_create_path {
1290   int __pyx_n;
1291   PyObject *subpath_ranges;
1292 };
1293 struct __pyx_fuse_3__pyx_opt_args_3urh_9cythonext_12path_creator_create_path {
1294   int __pyx_n;
1295   PyObject *subpath_ranges;
1296 };
1297 struct __pyx_fuse_4__pyx_opt_args_3urh_9cythonext_12path_creator_create_path {
1298   int __pyx_n;
1299   PyObject *subpath_ranges;
1300 };
1301 
1302 /* "View.MemoryView":105
1303  *
1304  * @cname("__pyx_array")
1305  * cdef class array:             # <<<<<<<<<<<<<<
1306  *
1307  *     cdef:
1308  */
1309 struct __pyx_array_obj {
1310   PyObject_HEAD
1311   struct __pyx_vtabstruct_array *__pyx_vtab;
1312   char *data;
1313   Py_ssize_t len;
1314   char *format;
1315   int ndim;
1316   Py_ssize_t *_shape;
1317   Py_ssize_t *_strides;
1318   Py_ssize_t itemsize;
1319   PyObject *mode;
1320   PyObject *_format;
1321   void (*callback_free_data)(void *);
1322   int free_data;
1323   int dtype_is_object;
1324 };
1325 
1326 
1327 /* "View.MemoryView":279
1328  *
1329  * @cname('__pyx_MemviewEnum')
1330  * cdef class Enum(object):             # <<<<<<<<<<<<<<
1331  *     cdef object name
1332  *     def __init__(self, name):
1333  */
1334 struct __pyx_MemviewEnum_obj {
1335   PyObject_HEAD
1336   PyObject *name;
1337 };
1338 
1339 
1340 /* "View.MemoryView":330
1341  *
1342  * @cname('__pyx_memoryview')
1343  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1344  *
1345  *     cdef object obj
1346  */
1347 struct __pyx_memoryview_obj {
1348   PyObject_HEAD
1349   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1350   PyObject *obj;
1351   PyObject *_size;
1352   PyObject *_array_interface;
1353   PyThread_type_lock lock;
1354   __pyx_atomic_int acquisition_count[2];
1355   __pyx_atomic_int *acquisition_count_aligned_p;
1356   Py_buffer view;
1357   int flags;
1358   int dtype_is_object;
1359   __Pyx_TypeInfo *typeinfo;
1360 };
1361 
1362 
1363 /* "View.MemoryView":965
1364  *
1365  * @cname('__pyx_memoryviewslice')
1366  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1367  *     "Internal class for passing memoryview slices to Python"
1368  *
1369  */
1370 struct __pyx_memoryviewslice_obj {
1371   struct __pyx_memoryview_obj __pyx_base;
1372   __Pyx_memviewslice from_slice;
1373   PyObject *from_object;
1374   PyObject *(*to_object_func)(char *);
1375   int (*to_dtype_func)(char *, PyObject *);
1376 };
1377 
1378 
1379 
1380 /* "View.MemoryView":105
1381  *
1382  * @cname("__pyx_array")
1383  * cdef class array:             # <<<<<<<<<<<<<<
1384  *
1385  *     cdef:
1386  */
1387 
1388 struct __pyx_vtabstruct_array {
1389   PyObject *(*get_memview)(struct __pyx_array_obj *);
1390 };
1391 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1392 
1393 
1394 /* "View.MemoryView":330
1395  *
1396  * @cname('__pyx_memoryview')
1397  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1398  *
1399  *     cdef object obj
1400  */
1401 
1402 struct __pyx_vtabstruct_memoryview {
1403   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1404   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1405   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1406   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1407   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1408   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1409   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1410 };
1411 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1412 
1413 
1414 /* "View.MemoryView":965
1415  *
1416  * @cname('__pyx_memoryviewslice')
1417  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1418  *     "Internal class for passing memoryview slices to Python"
1419  *
1420  */
1421 
1422 struct __pyx_vtabstruct__memoryviewslice {
1423   struct __pyx_vtabstruct_memoryview __pyx_base;
1424 };
1425 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1426 
1427 /* --- Runtime support code (head) --- */
1428 /* Refnanny.proto */
1429 #ifndef CYTHON_REFNANNY
1430   #define CYTHON_REFNANNY 0
1431 #endif
1432 #if CYTHON_REFNANNY
1433   typedef struct {
1434     void (*INCREF)(void*, PyObject*, int);
1435     void (*DECREF)(void*, PyObject*, int);
1436     void (*GOTREF)(void*, PyObject*, int);
1437     void (*GIVEREF)(void*, PyObject*, int);
1438     void* (*SetupContext)(const char*, int, const char*);
1439     void (*FinishContext)(void**);
1440   } __Pyx_RefNannyAPIStruct;
1441   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1442   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1443   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1444 #ifdef WITH_THREAD
1445   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1446           if (acquire_gil) {\
1447               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1448               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1449               PyGILState_Release(__pyx_gilstate_save);\
1450           } else {\
1451               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1452           }
1453 #else
1454   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1455           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1456 #endif
1457   #define __Pyx_RefNannyFinishContext()\
1458           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1459   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1460   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1461   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1462   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1463   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1464   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1465   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1466   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1467 #else
1468   #define __Pyx_RefNannyDeclarations
1469   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1470   #define __Pyx_RefNannyFinishContext()
1471   #define __Pyx_INCREF(r) Py_INCREF(r)
1472   #define __Pyx_DECREF(r) Py_DECREF(r)
1473   #define __Pyx_GOTREF(r)
1474   #define __Pyx_GIVEREF(r)
1475   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1476   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1477   #define __Pyx_XGOTREF(r)
1478   #define __Pyx_XGIVEREF(r)
1479 #endif
1480 #define __Pyx_XDECREF_SET(r, v) do {\
1481         PyObject *tmp = (PyObject *) r;\
1482         r = v; __Pyx_XDECREF(tmp);\
1483     } while (0)
1484 #define __Pyx_DECREF_SET(r, v) do {\
1485         PyObject *tmp = (PyObject *) r;\
1486         r = v; __Pyx_DECREF(tmp);\
1487     } while (0)
1488 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1489 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1490 
1491 /* PyObjectGetAttrStr.proto */
1492 #if CYTHON_USE_TYPE_SLOTS
1493 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1494 #else
1495 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1496 #endif
1497 
1498 /* GetBuiltinName.proto */
1499 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1500 
1501 /* RaiseArgTupleInvalid.proto */
1502 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1503     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1504 
1505 /* RaiseDoubleKeywords.proto */
1506 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1507 
1508 /* ParseKeywords.proto */
1509 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1510     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1511     const char* function_name);
1512 
1513 /* PyDictContains.proto */
__Pyx_PyDict_ContainsTF(PyObject * item,PyObject * dict,int eq)1514 static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
1515     int result = PyDict_Contains(dict, item);
1516     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1517 }
1518 
1519 /* DictGetItem.proto */
1520 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1521 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1522 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1523     (likely(PyDict_CheckExact(obj)) ?\
1524      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1525 #else
1526 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1527 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1528 #endif
1529 
1530 /* PyCFunctionFastCall.proto */
1531 #if CYTHON_FAST_PYCCALL
1532 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1533 #else
1534 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1535 #endif
1536 
1537 /* PyFunctionFastCall.proto */
1538 #if CYTHON_FAST_PYCALL
1539 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1540     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1541 #if 1 || PY_VERSION_HEX < 0x030600B1
1542 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1543 #else
1544 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1545 #endif
1546 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1547     (sizeof(char [1 - 2*!(cond)]) - 1)
1548 #ifndef Py_MEMBER_SIZE
1549 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1550 #endif
1551   static size_t __pyx_pyframe_localsplus_offset = 0;
1552   #include "frameobject.h"
1553   #define __Pxy_PyFrame_Initialize_Offsets()\
1554     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1555      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1556   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1557     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1558 #endif
1559 
1560 /* PyObjectCall.proto */
1561 #if CYTHON_COMPILING_IN_CPYTHON
1562 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1563 #else
1564 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1565 #endif
1566 
1567 /* PyObjectCallMethO.proto */
1568 #if CYTHON_COMPILING_IN_CPYTHON
1569 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1570 #endif
1571 
1572 /* PyObjectCallOneArg.proto */
1573 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1574 
1575 /* PyThreadStateGet.proto */
1576 #if CYTHON_FAST_THREAD_STATE
1577 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1578 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1579 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1580 #else
1581 #define __Pyx_PyThreadState_declare
1582 #define __Pyx_PyThreadState_assign
1583 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1584 #endif
1585 
1586 /* PyErrFetchRestore.proto */
1587 #if CYTHON_FAST_THREAD_STATE
1588 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1589 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1590 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1591 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1592 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1593 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1594 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1595 #if CYTHON_COMPILING_IN_CPYTHON
1596 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1597 #else
1598 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1599 #endif
1600 #else
1601 #define __Pyx_PyErr_Clear() PyErr_Clear()
1602 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1603 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1604 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1605 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1606 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1607 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1608 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1609 #endif
1610 
1611 /* RaiseException.proto */
1612 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1613 
1614 /* UnicodeAsUCS4.proto */
1615 static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
1616 
1617 /* object_ord.proto */
1618 #if PY_MAJOR_VERSION >= 3
1619 #define __Pyx_PyObject_Ord(c)\
1620     (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
1621 #else
1622 #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
1623 #endif
1624 static long __Pyx__PyObject_Ord(PyObject* c);
1625 
1626 /* SetItemInt.proto */
1627 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1628     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1629     __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1630     (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1631                __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1632 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1633 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
1634                                                int is_list, int wraparound, int boundscheck);
1635 
1636 /* IterFinish.proto */
1637 static CYTHON_INLINE int __Pyx_IterFinish(void);
1638 
1639 /* PyObjectCallNoArg.proto */
1640 #if CYTHON_COMPILING_IN_CPYTHON
1641 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1642 #else
1643 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1644 #endif
1645 
1646 /* PyObjectGetMethod.proto */
1647 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1648 
1649 /* PyObjectCallMethod0.proto */
1650 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
1651 
1652 /* RaiseNeedMoreValuesToUnpack.proto */
1653 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1654 
1655 /* RaiseTooManyValuesToUnpack.proto */
1656 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1657 
1658 /* UnpackItemEndCheck.proto */
1659 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1660 
1661 /* RaiseNoneIterError.proto */
1662 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1663 
1664 /* UnpackTupleError.proto */
1665 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
1666 
1667 /* UnpackTuple2.proto */
1668 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1669     (likely(is_tuple || PyTuple_Check(tuple)) ?\
1670         (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1671             __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1672             (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1673         __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1674 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1675     PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1676 static int __Pyx_unpack_tuple2_generic(
1677     PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
1678 
1679 /* dict_iter.proto */
1680 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
1681                                                    Py_ssize_t* p_orig_length, int* p_is_dict);
1682 static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
1683                                               PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
1684 
1685 /* PyObjectCall2Args.proto */
1686 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1687 
1688 /* GetItemInt.proto */
1689 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1690     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1691     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1692     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1693                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1694 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1695     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1696     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1697     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1698 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1699                                                               int wraparound, int boundscheck);
1700 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1701     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1702     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1703     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1704 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1705                                                               int wraparound, int boundscheck);
1706 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1707 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1708                                                      int is_list, int wraparound, int boundscheck);
1709 
1710 /* ListAppend.proto */
1711 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1712 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1713     PyListObject* L = (PyListObject*) list;
1714     Py_ssize_t len = Py_SIZE(list);
1715     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1716         Py_INCREF(x);
1717         PyList_SET_ITEM(list, len, x);
1718         __Pyx_SET_SIZE(list, len + 1);
1719         return 0;
1720     }
1721     return PyList_Append(list, x);
1722 }
1723 #else
1724 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1725 #endif
1726 
1727 /* PyDictVersioning.proto */
1728 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1729 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1730 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1731 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1732     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1733     (cache_var) = (value);
1734 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1735     static PY_UINT64_T __pyx_dict_version = 0;\
1736     static PyObject *__pyx_dict_cached_value = NULL;\
1737     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1738         (VAR) = __pyx_dict_cached_value;\
1739     } else {\
1740         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1741         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1742     }\
1743 }
1744 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1745 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1746 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1747 #else
1748 #define __PYX_GET_DICT_VERSION(dict)  (0)
1749 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1750 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1751 #endif
1752 
1753 /* GetModuleGlobalName.proto */
1754 #if CYTHON_USE_DICT_VERSIONS
1755 #define __Pyx_GetModuleGlobalName(var, name)  {\
1756     static PY_UINT64_T __pyx_dict_version = 0;\
1757     static PyObject *__pyx_dict_cached_value = NULL;\
1758     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1759         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1760         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1761 }
1762 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1763     PY_UINT64_T __pyx_dict_version;\
1764     PyObject *__pyx_dict_cached_value;\
1765     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1766 }
1767 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1768 #else
1769 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1770 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1771 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1772 #endif
1773 
1774 /* MemviewSliceInit.proto */
1775 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1776 #define __Pyx_MEMVIEW_DIRECT   1
1777 #define __Pyx_MEMVIEW_PTR      2
1778 #define __Pyx_MEMVIEW_FULL     4
1779 #define __Pyx_MEMVIEW_CONTIG   8
1780 #define __Pyx_MEMVIEW_STRIDED  16
1781 #define __Pyx_MEMVIEW_FOLLOW   32
1782 #define __Pyx_IS_C_CONTIG 1
1783 #define __Pyx_IS_F_CONTIG 2
1784 static int __Pyx_init_memviewslice(
1785                 struct __pyx_memoryview_obj *memview,
1786                 int ndim,
1787                 __Pyx_memviewslice *memviewslice,
1788                 int memview_is_new_reference);
1789 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1790     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1791 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1792     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1793 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1794 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1795 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1796 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1797 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1798 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1799 
1800 /* ArgTypeTest.proto */
1801 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1802     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1803         __Pyx__ArgTypeTest(obj, type, name, exact))
1804 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1805 
1806 /* SliceObject.proto */
1807 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1808     __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1809 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
1810         PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1811         PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1812         int has_cstart, int has_cstop, int wraparound);
1813 
1814 /* SliceObject.proto */
1815 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1816         PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1817         PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1818         int has_cstart, int has_cstop, int wraparound);
1819 
1820 /* GetTopmostException.proto */
1821 #if CYTHON_USE_EXC_INFO_STACK
1822 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1823 #endif
1824 
1825 /* SaveResetException.proto */
1826 #if CYTHON_FAST_THREAD_STATE
1827 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1828 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1829 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1830 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1831 #else
1832 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1833 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1834 #endif
1835 
1836 /* PyErrExceptionMatches.proto */
1837 #if CYTHON_FAST_THREAD_STATE
1838 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1839 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1840 #else
1841 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1842 #endif
1843 
1844 /* GetException.proto */
1845 #if CYTHON_FAST_THREAD_STATE
1846 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1847 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1848 #else
1849 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1850 #endif
1851 
1852 /* IncludeStringH.proto */
1853 #include <string.h>
1854 
1855 /* BytesEquals.proto */
1856 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1857 
1858 /* UnicodeEquals.proto */
1859 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1860 
1861 /* StrEquals.proto */
1862 #if PY_MAJOR_VERSION >= 3
1863 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1864 #else
1865 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1866 #endif
1867 
1868 /* UnaryNegOverflows.proto */
1869 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1870         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1871 
1872 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1873 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1874 /* GetAttr.proto */
1875 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1876 
1877 /* ObjectGetItem.proto */
1878 #if CYTHON_USE_TYPE_SLOTS
1879 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1880 #else
1881 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1882 #endif
1883 
1884 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)1885 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1886     int byteorder = 0;
1887     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1888 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)1889 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1890     int byteorder = -1;
1891     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1892 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)1893 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1894     int byteorder = 1;
1895     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1896 }
1897 
1898 /* decode_c_string.proto */
1899 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1900          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1901          const char* encoding, const char* errors,
1902          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1903 
1904 /* GetAttr3.proto */
1905 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1906 
1907 /* ExtTypeTest.proto */
1908 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1909 
1910 /* SwapException.proto */
1911 #if CYTHON_FAST_THREAD_STATE
1912 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1913 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1914 #else
1915 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1916 #endif
1917 
1918 /* Import.proto */
1919 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1920 
1921 /* FastTypeChecks.proto */
1922 #if CYTHON_COMPILING_IN_CPYTHON
1923 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1924 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1925 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1926 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1927 #else
1928 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1929 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1930 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1931 #endif
1932 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1933 
1934 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1935 /* ListCompAppend.proto */
1936 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)1937 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1938     PyListObject* L = (PyListObject*) list;
1939     Py_ssize_t len = Py_SIZE(list);
1940     if (likely(L->allocated > len)) {
1941         Py_INCREF(x);
1942         PyList_SET_ITEM(list, len, x);
1943         __Pyx_SET_SIZE(list, len + 1);
1944         return 0;
1945     }
1946     return PyList_Append(list, x);
1947 }
1948 #else
1949 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1950 #endif
1951 
1952 /* PyIntBinop.proto */
1953 #if !CYTHON_COMPILING_IN_PYPY
1954 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1955 #else
1956 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1957     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1958 #endif
1959 
1960 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)1961 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1962 #if CYTHON_COMPILING_IN_CPYTHON
1963     PyObject* none = _PyList_Extend((PyListObject*)L, v);
1964     if (unlikely(!none))
1965         return -1;
1966     Py_DECREF(none);
1967     return 0;
1968 #else
1969     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1970 #endif
1971 }
1972 
1973 /* None.proto */
1974 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1975 
1976 /* ImportFrom.proto */
1977 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1978 
1979 /* HasAttr.proto */
1980 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1981 
1982 /* PyObject_GenericGetAttrNoDict.proto */
1983 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1984 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1985 #else
1986 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1987 #endif
1988 
1989 /* PyObject_GenericGetAttr.proto */
1990 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1991 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1992 #else
1993 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1994 #endif
1995 
1996 /* SetVTable.proto */
1997 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1998 
1999 /* PyObjectGetAttrStrNoError.proto */
2000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2001 
2002 /* SetupReduce.proto */
2003 static int __Pyx_setup_reduce(PyObject* type_obj);
2004 
2005 /* TypeImport.proto */
2006 #ifndef __PYX_HAVE_RT_ImportType_proto
2007 #define __PYX_HAVE_RT_ImportType_proto
2008 enum __Pyx_ImportType_CheckSize {
2009    __Pyx_ImportType_CheckSize_Error = 0,
2010    __Pyx_ImportType_CheckSize_Warn = 1,
2011    __Pyx_ImportType_CheckSize_Ignore = 2
2012 };
2013 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2014 #endif
2015 
2016 /* FetchCommonType.proto */
2017 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2018 
2019 /* CythonFunctionShared.proto */
2020 #define __Pyx_CyFunction_USED 1
2021 #define __Pyx_CYFUNCTION_STATICMETHOD  0x01
2022 #define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
2023 #define __Pyx_CYFUNCTION_CCLASS        0x04
2024 #define __Pyx_CyFunction_GetClosure(f)\
2025     (((__pyx_CyFunctionObject *) (f))->func_closure)
2026 #define __Pyx_CyFunction_GetClassObj(f)\
2027     (((__pyx_CyFunctionObject *) (f))->func_classobj)
2028 #define __Pyx_CyFunction_Defaults(type, f)\
2029     ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2030 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2031     ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2032 typedef struct {
2033     PyCFunctionObject func;
2034 #if PY_VERSION_HEX < 0x030500A0
2035     PyObject *func_weakreflist;
2036 #endif
2037     PyObject *func_dict;
2038     PyObject *func_name;
2039     PyObject *func_qualname;
2040     PyObject *func_doc;
2041     PyObject *func_globals;
2042     PyObject *func_code;
2043     PyObject *func_closure;
2044     PyObject *func_classobj;
2045     void *defaults;
2046     int defaults_pyobjects;
2047     size_t defaults_size;  // used by FusedFunction for copying defaults
2048     int flags;
2049     PyObject *defaults_tuple;
2050     PyObject *defaults_kwdict;
2051     PyObject *(*defaults_getter)(PyObject *);
2052     PyObject *func_annotations;
2053 } __pyx_CyFunctionObject;
2054 static PyTypeObject *__pyx_CyFunctionType = 0;
2055 #define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2056 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2057                                       int flags, PyObject* qualname,
2058                                       PyObject *self,
2059                                       PyObject *module, PyObject *globals,
2060                                       PyObject* code);
2061 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2062                                                          size_t size,
2063                                                          int pyobjects);
2064 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2065                                                             PyObject *tuple);
2066 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2067                                                              PyObject *dict);
2068 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2069                                                               PyObject *dict);
2070 static int __pyx_CyFunction_init(void);
2071 
2072 /* FusedFunction.proto */
2073 typedef struct {
2074     __pyx_CyFunctionObject func;
2075     PyObject *__signatures__;
2076     PyObject *type;
2077     PyObject *self;
2078 } __pyx_FusedFunctionObject;
2079 static PyObject *__pyx_FusedFunction_New(PyMethodDef *ml, int flags,
2080                                          PyObject *qualname, PyObject *closure,
2081                                          PyObject *module, PyObject *globals,
2082                                          PyObject *code);
2083 static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self);
2084 static PyTypeObject *__pyx_FusedFunctionType = NULL;
2085 static int __pyx_FusedFunction_init(void);
2086 #define __Pyx_FusedFunction_USED
2087 
2088 /* CLineInTraceback.proto */
2089 #ifdef CYTHON_CLINE_IN_TRACEBACK
2090 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2091 #else
2092 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2093 #endif
2094 
2095 /* CodeObjectCache.proto */
2096 typedef struct {
2097     PyCodeObject* code_object;
2098     int code_line;
2099 } __Pyx_CodeObjectCacheEntry;
2100 struct __Pyx_CodeObjectCache {
2101     int count;
2102     int max_count;
2103     __Pyx_CodeObjectCacheEntry* entries;
2104 };
2105 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2106 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2107 static PyCodeObject *__pyx_find_code_object(int code_line);
2108 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2109 
2110 /* AddTraceback.proto */
2111 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2112                                int py_line, const char *filename);
2113 
2114 #if PY_MAJOR_VERSION < 3
2115     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2116     static void __Pyx_ReleaseBuffer(Py_buffer *view);
2117 #else
2118     #define __Pyx_GetBuffer PyObject_GetBuffer
2119     #define __Pyx_ReleaseBuffer PyBuffer_Release
2120 #endif
2121 
2122 
2123 /* BufferStructDeclare.proto */
2124 typedef struct {
2125   Py_ssize_t shape, strides, suboffsets;
2126 } __Pyx_Buf_DimInfo;
2127 typedef struct {
2128   size_t refcount;
2129   Py_buffer pybuffer;
2130 } __Pyx_Buffer;
2131 typedef struct {
2132   __Pyx_Buffer *rcbuffer;
2133   char *data;
2134   __Pyx_Buf_DimInfo diminfo[8];
2135 } __Pyx_LocalBuf_ND;
2136 
2137 /* MemviewSliceIsContig.proto */
2138 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2139 
2140 /* OverlappingSlices.proto */
2141 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2142                                 __Pyx_memviewslice *slice2,
2143                                 int ndim, size_t itemsize);
2144 
2145 /* Capsule.proto */
2146 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2147 
2148 /* IsLittleEndian.proto */
2149 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2150 
2151 /* BufferFormatCheck.proto */
2152 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2153 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2154                               __Pyx_BufFmt_StackElem* stack,
2155                               __Pyx_TypeInfo* type);
2156 
2157 /* TypeInfoCompare.proto */
2158 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2159 
2160 /* MemviewSliceValidateAndInit.proto */
2161 static int __Pyx_ValidateAndInit_memviewslice(
2162                 int *axes_specs,
2163                 int c_or_f_flag,
2164                 int buf_flags,
2165                 int ndim,
2166                 __Pyx_TypeInfo *dtype,
2167                 __Pyx_BufFmt_StackElem stack[],
2168                 __Pyx_memviewslice *memviewslice,
2169                 PyObject *original_obj);
2170 
2171 /* ObjectToMemviewSlice.proto */
2172 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_char(PyObject *, int writable_flag);
2173 
2174 /* ObjectToMemviewSlice.proto */
2175 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *, int writable_flag);
2176 
2177 /* ObjectToMemviewSlice.proto */
2178 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_short(PyObject *, int writable_flag);
2179 
2180 /* ObjectToMemviewSlice.proto */
2181 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(PyObject *, int writable_flag);
2182 
2183 /* ObjectToMemviewSlice.proto */
2184 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2185 
2186 /* GCCDiagnostics.proto */
2187 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2188 #define __Pyx_HAS_GCC_DIAGNOSTIC
2189 #endif
2190 
2191 /* ObjectToMemviewSlice.proto */
2192 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
2193 
2194 /* MemviewDtypeToObject.proto */
2195 static CYTHON_INLINE PyObject *__pyx_memview_get_PY_LONG_LONG(const char *itemp);
2196 static CYTHON_INLINE int __pyx_memview_set_PY_LONG_LONG(const char *itemp, PyObject *obj);
2197 
2198 /* MemviewDtypeToObject.proto */
2199 static CYTHON_INLINE PyObject *__pyx_memview_get_char(const char *itemp);
2200 static CYTHON_INLINE int __pyx_memview_set_char(const char *itemp, PyObject *obj);
2201 
2202 /* MemviewDtypeToObject.proto */
2203 static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp);
2204 static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj);
2205 
2206 /* MemviewDtypeToObject.proto */
2207 static CYTHON_INLINE PyObject *__pyx_memview_get_short(const char *itemp);
2208 static CYTHON_INLINE int __pyx_memview_set_short(const char *itemp, PyObject *obj);
2209 
2210 /* MemviewDtypeToObject.proto */
2211 static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_short(const char *itemp);
2212 static CYTHON_INLINE int __pyx_memview_set_unsigned_short(const char *itemp, PyObject *obj);
2213 
2214 /* MemviewDtypeToObject.proto */
2215 static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp);
2216 static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj);
2217 
2218 /* MemviewDtypeToObject.proto */
2219 static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp);
2220 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj);
2221 
2222 /* RealImag.proto */
2223 #if CYTHON_CCOMPLEX
2224   #ifdef __cplusplus
2225     #define __Pyx_CREAL(z) ((z).real())
2226     #define __Pyx_CIMAG(z) ((z).imag())
2227   #else
2228     #define __Pyx_CREAL(z) (__real__(z))
2229     #define __Pyx_CIMAG(z) (__imag__(z))
2230   #endif
2231 #else
2232     #define __Pyx_CREAL(z) ((z).real)
2233     #define __Pyx_CIMAG(z) ((z).imag)
2234 #endif
2235 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2236         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2237     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2238     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2239 #else
2240     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2241     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2242 #endif
2243 
2244 /* Arithmetic.proto */
2245 #if CYTHON_CCOMPLEX
2246     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2247     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2248     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2249     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2250     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2251     #define __Pyx_c_neg_float(a)     (-(a))
2252   #ifdef __cplusplus
2253     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2254     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2255     #if 1
2256         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2257         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2258     #endif
2259   #else
2260     #define __Pyx_c_is_zero_float(z) ((z)==0)
2261     #define __Pyx_c_conj_float(z)    (conjf(z))
2262     #if 1
2263         #define __Pyx_c_abs_float(z)     (cabsf(z))
2264         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2265     #endif
2266  #endif
2267 #else
2268     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2269     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2270     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2271     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2272     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2273     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2274     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2275     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2276     #if 1
2277         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2278         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2279     #endif
2280 #endif
2281 
2282 /* Arithmetic.proto */
2283 #if CYTHON_CCOMPLEX
2284     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2285     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2286     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2287     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2288     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2289     #define __Pyx_c_neg_double(a)     (-(a))
2290   #ifdef __cplusplus
2291     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2292     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2293     #if 1
2294         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2295         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2296     #endif
2297   #else
2298     #define __Pyx_c_is_zero_double(z) ((z)==0)
2299     #define __Pyx_c_conj_double(z)    (conj(z))
2300     #if 1
2301         #define __Pyx_c_abs_double(z)     (cabs(z))
2302         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2303     #endif
2304  #endif
2305 #else
2306     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2307     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2308     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2309     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2310     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2311     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2312     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2313     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2314     #if 1
2315         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2316         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2317     #endif
2318 #endif
2319 
2320 /* MemviewSliceCopyTemplate.proto */
2321 static __Pyx_memviewslice
2322 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2323                                  const char *mode, int ndim,
2324                                  size_t sizeof_dtype, int contig_flag,
2325                                  int dtype_is_object);
2326 
2327 /* CIntFromPy.proto */
2328 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);
2329 
2330 /* CIntFromPy.proto */
2331 static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
2332 
2333 /* CIntToPy.proto */
2334 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2335 
2336 /* CIntToPy.proto */
2337 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);
2338 
2339 /* CIntToPy.proto */
2340 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
2341 
2342 /* CIntFromPy.proto */
2343 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2344 
2345 /* CIntToPy.proto */
2346 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value);
2347 
2348 /* CIntFromPy.proto */
2349 static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);
2350 
2351 /* CIntToPy.proto */
2352 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value);
2353 
2354 /* CIntFromPy.proto */
2355 static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *);
2356 
2357 /* CIntToPy.proto */
2358 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value);
2359 
2360 /* CIntFromPy.proto */
2361 static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
2362 
2363 /* BytesContains.proto */
2364 static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character);
2365 
2366 /* CIntToPy.proto */
2367 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
2368 
2369 /* CIntToPy.proto */
2370 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
2371 
2372 /* CIntFromPy.proto */
2373 static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
2374 
2375 /* ImportNumPyArray.proto */
2376 static PyObject *__pyx_numpy_ndarray = NULL;
2377 static PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void);
2378 
2379 /* CIntFromPy.proto */
2380 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2381 
2382 /* CIntFromPy.proto */
2383 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2384 
2385 /* CIntToPy.proto */
2386 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2387 
2388 /* ObjectToMemviewSlice.proto */
2389 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(PyObject *, int writable_flag);
2390 
2391 /* ObjectToMemviewSlice.proto */
2392 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
2393 
2394 /* CheckBinaryVersion.proto */
2395 static int __Pyx_check_binary_version(void);
2396 
2397 /* InitStrings.proto */
2398 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2399 
2400 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2401 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2402 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2403 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2404 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2405 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2406 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2407 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2408 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2409 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2410 
2411 /* Module declarations from 'cpython.buffer' */
2412 
2413 /* Module declarations from 'libc.string' */
2414 
2415 /* Module declarations from 'libc.stdio' */
2416 
2417 /* Module declarations from '__builtin__' */
2418 
2419 /* Module declarations from 'cpython.type' */
2420 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2421 
2422 /* Module declarations from 'cpython' */
2423 
2424 /* Module declarations from 'cpython.object' */
2425 
2426 /* Module declarations from 'cpython.ref' */
2427 
2428 /* Module declarations from 'cpython.mem' */
2429 
2430 /* Module declarations from 'numpy' */
2431 
2432 /* Module declarations from 'numpy' */
2433 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2434 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2435 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2436 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2437 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2438 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2439 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2440 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2441 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2442 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2443 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2444 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2445 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2446 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2447 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2448 
2449 /* Module declarations from 'libc.stdint' */
2450 
2451 /* Module declarations from 'urh.cythonext.util' */
2452 
2453 /* Module declarations from 'cython.view' */
2454 
2455 /* Module declarations from 'cython' */
2456 
2457 /* Module declarations from 'urh.cythonext.path_creator' */
2458 static PyTypeObject *__pyx_array_type = 0;
2459 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2460 static PyTypeObject *__pyx_memoryview_type = 0;
2461 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2462 static PyObject *generic = 0;
2463 static PyObject *strided = 0;
2464 static PyObject *indirect = 0;
2465 static PyObject *contiguous = 0;
2466 static PyObject *indirect_contiguous = 0;
2467 static int __pyx_memoryview_thread_locks_used;
2468 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2469 static PyObject *__pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__Pyx_memviewslice, PyObject *, int __pyx_skip_dispatch); /*proto*/
2470 static PyObject *__pyx_fuse_0__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice, PY_LONG_LONG, PY_LONG_LONG, int __pyx_skip_dispatch, struct __pyx_fuse_0__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args); /*proto*/
2471 static PyObject *__pyx_fuse_1__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice, PY_LONG_LONG, PY_LONG_LONG, int __pyx_skip_dispatch, struct __pyx_fuse_1__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args); /*proto*/
2472 static PyObject *__pyx_fuse_2__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice, PY_LONG_LONG, PY_LONG_LONG, int __pyx_skip_dispatch, struct __pyx_fuse_2__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args); /*proto*/
2473 static PyObject *__pyx_fuse_3__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice, PY_LONG_LONG, PY_LONG_LONG, int __pyx_skip_dispatch, struct __pyx_fuse_3__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args); /*proto*/
2474 static PyObject *__pyx_fuse_4__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice, PY_LONG_LONG, PY_LONG_LONG, int __pyx_skip_dispatch, struct __pyx_fuse_4__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args); /*proto*/
2475 static PyObject *__pyx_fuse_0__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
2476 static PyObject *__pyx_fuse_1__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
2477 static PyObject *__pyx_fuse_2__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
2478 static PyObject *__pyx_fuse_3__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
2479 static PyObject *__pyx_fuse_4__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
2480 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2481 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2482 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2483 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2484 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2485 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2486 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2487 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2488 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2489 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2490 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2491 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2492 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2493 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2494 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2495 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2496 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2497 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2498 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2499 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2500 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2501 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2502 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2503 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2504 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2505 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2506 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2507 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2508 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2509 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2510 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2511 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2512 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2513 static __Pyx_TypeInfo __Pyx_TypeInfo_char = { "char", NULL, sizeof(char), { 0 }, 0, 'H', IS_UNSIGNED(char), 0 };
2514 static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 };
2515 static __Pyx_TypeInfo __Pyx_TypeInfo_short = { "short", NULL, sizeof(short), { 0 }, 0, IS_UNSIGNED(short) ? 'U' : 'I', IS_UNSIGNED(short), 0 };
2516 static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_short = { "unsigned short", NULL, sizeof(unsigned short), { 0 }, 0, IS_UNSIGNED(unsigned short) ? 'U' : 'I', IS_UNSIGNED(unsigned short), 0 };
2517 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2518 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 };
2519 static __Pyx_TypeInfo __Pyx_TypeInfo_PY_LONG_LONG = { "long long", NULL, sizeof(PY_LONG_LONG), { 0 }, 0, IS_UNSIGNED(PY_LONG_LONG) ? 'U' : 'I', IS_UNSIGNED(PY_LONG_LONG), 0 };
2520 #define __Pyx_MODULE_NAME "urh.cythonext.path_creator"
2521 extern int __pyx_module_is_main_urh__cythonext__path_creator;
2522 int __pyx_module_is_main_urh__cythonext__path_creator = 0;
2523 
2524 /* Implementation of 'urh.cythonext.path_creator' */
2525 static PyObject *__pyx_builtin_TypeError;
2526 static PyObject *__pyx_builtin_range;
2527 static PyObject *__pyx_builtin_ImportError;
2528 static PyObject *__pyx_builtin_ValueError;
2529 static PyObject *__pyx_builtin_MemoryError;
2530 static PyObject *__pyx_builtin_enumerate;
2531 static PyObject *__pyx_builtin_Ellipsis;
2532 static PyObject *__pyx_builtin_id;
2533 static PyObject *__pyx_builtin_IndexError;
2534 static const char __pyx_k_C[] = "C";
2535 static const char __pyx_k_O[] = "O";
2536 static const char __pyx_k_c[] = "c";
2537 static const char __pyx_k_i[] = ">i";
2538 static const char __pyx_k_s[] = "s";
2539 static const char __pyx_k_x[] = "x";
2540 static const char __pyx_k_y[] = "y";
2541 static const char __pyx_k__2[] = "()";
2542 static const char __pyx_k__3[] = "|";
2543 static const char __pyx_k_f8[] = ">f8";
2544 static const char __pyx_k_i4[] = ">i4";
2545 static const char __pyx_k_id[] = "id";
2546 static const char __pyx_k_ii[] = ">ii";
2547 static const char __pyx_k_np[] = "np";
2548 static const char __pyx_k_end[] = "end";
2549 static const char __pyx_k_new[] = "__new__";
2550 static const char __pyx_k_obj[] = "obj";
2551 static const char __pyx_k_urh[] = "urh";
2552 static const char __pyx_k_args[] = "args";
2553 static const char __pyx_k_base[] = "base";
2554 static const char __pyx_k_ceil[] = "ceil";
2555 static const char __pyx_k_char[] = "char";
2556 static const char __pyx_k_data[] = "data";
2557 static const char __pyx_k_dict[] = "__dict__";
2558 static const char __pyx_k_int8[] = "int8";
2559 static const char __pyx_k_kind[] = "kind";
2560 static const char __pyx_k_main[] = "__main__";
2561 static const char __pyx_k_math[] = "math";
2562 static const char __pyx_k_mode[] = "mode";
2563 static const char __pyx_k_name[] = "name";
2564 static const char __pyx_k_ndim[] = "ndim";
2565 static const char __pyx_k_pack[] = "pack";
2566 static const char __pyx_k_size[] = "size";
2567 static const char __pyx_k_step[] = "step";
2568 static const char __pyx_k_stop[] = "stop";
2569 static const char __pyx_k_test[] = "__test__";
2570 static const char __pyx_k_view[] = "view";
2571 static const char __pyx_k_ASCII[] = "ASCII";
2572 static const char __pyx_k_class[] = "__class__";
2573 static const char __pyx_k_dtype[] = "dtype";
2574 static const char __pyx_k_error[] = "error";
2575 static const char __pyx_k_flags[] = "flags";
2576 static const char __pyx_k_float[] = "float";
2577 static const char __pyx_k_floor[] = "floor";
2578 static const char __pyx_k_int16[] = "int16";
2579 static const char __pyx_k_int64[] = "int64";
2580 static const char __pyx_k_numpy[] = "numpy";
2581 static const char __pyx_k_order[] = "order";
2582 static const char __pyx_k_range[] = "range";
2583 static const char __pyx_k_shape[] = "shape";
2584 static const char __pyx_k_short[] = "short";
2585 static const char __pyx_k_split[] = "split";
2586 static const char __pyx_k_start[] = "start";
2587 static const char __pyx_k_strip[] = "strip";
2588 static const char __pyx_k_uint8[] = "uint8";
2589 static const char __pyx_k_zeros[] = "zeros";
2590 static const char __pyx_k_arange[] = "arange";
2591 static const char __pyx_k_astype[] = "astype";
2592 static const char __pyx_k_char_2[] = "char[:]";
2593 static const char __pyx_k_double[] = "double[:]";
2594 static const char __pyx_k_encode[] = "encode";
2595 static const char __pyx_k_format[] = "format";
2596 static const char __pyx_k_import[] = "__import__";
2597 static const char __pyx_k_kwargs[] = "kwargs";
2598 static const char __pyx_k_name_2[] = "__name__";
2599 static const char __pyx_k_pickle[] = "pickle";
2600 static const char __pyx_k_reduce[] = "__reduce__";
2601 static const char __pyx_k_repeat[] = "repeat";
2602 static const char __pyx_k_struct[] = "struct";
2603 static const char __pyx_k_uint16[] = "uint16";
2604 static const char __pyx_k_unpack[] = "unpack";
2605 static const char __pyx_k_update[] = "update";
2606 static const char __pyx_k_float32[] = "float32";
2607 static const char __pyx_k_float64[] = "float64";
2608 static const char __pyx_k_float_2[] = "float[:]";
2609 static const char __pyx_k_fortran[] = "fortran";
2610 static const char __pyx_k_memview[] = "memview";
2611 static const char __pyx_k_samples[] = "samples";
2612 static const char __pyx_k_short_2[] = "short[:]";
2613 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2614 static const char __pyx_k_defaults[] = "defaults";
2615 static const char __pyx_k_getstate[] = "__getstate__";
2616 static const char __pyx_k_itemsize[] = "itemsize";
2617 static const char __pyx_k_negative[] = "negative";
2618 static const char __pyx_k_pyx_type[] = "__pyx_type";
2619 static const char __pyx_k_setstate[] = "__setstate__";
2620 static const char __pyx_k_settings[] = "settings";
2621 static const char __pyx_k_TypeError[] = "TypeError";
2622 static const char __pyx_k_enumerate[] = "enumerate";
2623 static const char __pyx_k_pyx_state[] = "__pyx_state";
2624 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2625 static const char __pyx_k_IndexError[] = "IndexError";
2626 static const char __pyx_k_QByteArray[] = "QByteArray";
2627 static const char __pyx_k_ValueError[] = "ValueError";
2628 static const char __pyx_k_pyx_result[] = "__pyx_result";
2629 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2630 static const char __pyx_k_signatures[] = "signatures";
2631 static const char __pyx_k_ImportError[] = "ImportError";
2632 static const char __pyx_k_MemoryError[] = "MemoryError";
2633 static const char __pyx_k_PickleError[] = "PickleError";
2634 static const char __pyx_k_PyQt5_QtGui[] = "PyQt5.QtGui";
2635 static const char __pyx_k_QDataStream[] = "QDataStream";
2636 static const char __pyx_k_create_path[] = "create_path";
2637 static const char __pyx_k_fromRawData[] = "fromRawData";
2638 static const char __pyx_k_PyQt5_QtCore[] = "PyQt5.QtCore";
2639 static const char __pyx_k_QPainterPath[] = "QPainterPath";
2640 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2641 static const char __pyx_k_stringsource[] = "stringsource";
2642 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2643 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2644 static const char __pyx_k_unsigned_char[] = "unsigned char";
2645 static const char __pyx_k_subpath_ranges[] = "subpath_ranges";
2646 static const char __pyx_k_unsigned_short[] = "unsigned short";
2647 static const char __pyx_k_PIXELS_PER_PATH[] = "PIXELS_PER_PATH";
2648 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2649 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2650 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2651 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2652 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2653 static const char __pyx_k_unsigned_char_2[] = "unsigned char[:]";
2654 static const char __pyx_k_create_live_path[] = "create_live_path";
2655 static const char __pyx_k_unsigned_short_2[] = "unsigned short[:]";
2656 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2657 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2658 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2659 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2660 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2661 static const char __pyx_k_pyx_fuse_0create_path[] = "__pyx_fuse_0create_path";
2662 static const char __pyx_k_pyx_fuse_1create_path[] = "__pyx_fuse_1create_path";
2663 static const char __pyx_k_pyx_fuse_2create_path[] = "__pyx_fuse_2create_path";
2664 static const char __pyx_k_pyx_fuse_3create_path[] = "__pyx_fuse_3create_path";
2665 static const char __pyx_k_pyx_fuse_4create_path[] = "__pyx_fuse_4create_path";
2666 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2667 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2668 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2669 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2670 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2671 static const char __pyx_k_pyx_fuse_0create_live_path[] = "__pyx_fuse_0create_live_path";
2672 static const char __pyx_k_pyx_fuse_1create_live_path[] = "__pyx_fuse_1create_live_path";
2673 static const char __pyx_k_pyx_fuse_2create_live_path[] = "__pyx_fuse_2create_live_path";
2674 static const char __pyx_k_pyx_fuse_3create_live_path[] = "__pyx_fuse_3create_live_path";
2675 static const char __pyx_k_pyx_fuse_4create_live_path[] = "__pyx_fuse_4create_live_path";
2676 static const char __pyx_k_urh_cythonext_path_creator[] = "urh.cythonext.path_creator";
2677 static const char __pyx_k_No_matching_signature_found[] = "No matching signature found";
2678 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2679 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2680 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2681 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2682 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2683 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2684 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2685 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2686 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2687 static const char __pyx_k_Expected_at_least_d_argument_s_g[] = "Expected at least %d argument%s, got %d";
2688 static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types";
2689 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2690 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2691 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2692 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2693 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2694 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2695 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2696 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2697 static const char __pyx_k_src_urh_cythonext_path_creator_p[] = "src/urh/cythonext/path_creator.pyx";
2698 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2699 static PyObject *__pyx_n_s_ASCII;
2700 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2701 static PyObject *__pyx_n_u_C;
2702 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2703 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2704 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2705 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2706 static PyObject *__pyx_n_s_Ellipsis;
2707 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2708 static PyObject *__pyx_kp_s_Expected_at_least_d_argument_s_g;
2709 static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg;
2710 static PyObject *__pyx_n_s_ImportError;
2711 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2712 static PyObject *__pyx_n_s_IndexError;
2713 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2714 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2715 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2716 static PyObject *__pyx_n_s_MemoryError;
2717 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2718 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2719 static PyObject *__pyx_kp_s_No_matching_signature_found;
2720 static PyObject *__pyx_n_b_O;
2721 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2722 static PyObject *__pyx_n_s_PIXELS_PER_PATH;
2723 static PyObject *__pyx_n_s_PickleError;
2724 static PyObject *__pyx_n_s_PyQt5_QtCore;
2725 static PyObject *__pyx_n_s_PyQt5_QtGui;
2726 static PyObject *__pyx_n_s_QByteArray;
2727 static PyObject *__pyx_n_s_QDataStream;
2728 static PyObject *__pyx_n_s_QPainterPath;
2729 static PyObject *__pyx_n_s_TypeError;
2730 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2731 static PyObject *__pyx_n_s_ValueError;
2732 static PyObject *__pyx_n_s_View_MemoryView;
2733 static PyObject *__pyx_kp_s__2;
2734 static PyObject *__pyx_kp_s__3;
2735 static PyObject *__pyx_n_s_allocate_buffer;
2736 static PyObject *__pyx_n_s_arange;
2737 static PyObject *__pyx_n_s_args;
2738 static PyObject *__pyx_n_s_astype;
2739 static PyObject *__pyx_n_s_base;
2740 static PyObject *__pyx_n_s_c;
2741 static PyObject *__pyx_n_u_c;
2742 static PyObject *__pyx_n_s_ceil;
2743 static PyObject *__pyx_n_s_char;
2744 static PyObject *__pyx_kp_s_char_2;
2745 static PyObject *__pyx_kp_u_char_2;
2746 static PyObject *__pyx_n_s_class;
2747 static PyObject *__pyx_n_s_cline_in_traceback;
2748 static PyObject *__pyx_kp_s_contiguous_and_direct;
2749 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2750 static PyObject *__pyx_n_s_create_live_path;
2751 static PyObject *__pyx_n_s_create_path;
2752 static PyObject *__pyx_n_s_data;
2753 static PyObject *__pyx_n_s_defaults;
2754 static PyObject *__pyx_n_s_dict;
2755 static PyObject *__pyx_kp_u_double;
2756 static PyObject *__pyx_n_s_dtype;
2757 static PyObject *__pyx_n_s_dtype_is_object;
2758 static PyObject *__pyx_n_s_encode;
2759 static PyObject *__pyx_n_s_end;
2760 static PyObject *__pyx_n_s_enumerate;
2761 static PyObject *__pyx_n_s_error;
2762 static PyObject *__pyx_kp_u_f8;
2763 static PyObject *__pyx_n_s_flags;
2764 static PyObject *__pyx_n_s_float;
2765 static PyObject *__pyx_n_s_float32;
2766 static PyObject *__pyx_n_s_float64;
2767 static PyObject *__pyx_kp_s_float_2;
2768 static PyObject *__pyx_kp_u_float_2;
2769 static PyObject *__pyx_n_s_floor;
2770 static PyObject *__pyx_n_s_format;
2771 static PyObject *__pyx_n_s_fortran;
2772 static PyObject *__pyx_n_u_fortran;
2773 static PyObject *__pyx_n_s_fromRawData;
2774 static PyObject *__pyx_n_s_getstate;
2775 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2776 static PyObject *__pyx_kp_u_i;
2777 static PyObject *__pyx_kp_u_i4;
2778 static PyObject *__pyx_n_s_id;
2779 static PyObject *__pyx_kp_u_ii;
2780 static PyObject *__pyx_n_s_import;
2781 static PyObject *__pyx_n_s_int16;
2782 static PyObject *__pyx_n_s_int64;
2783 static PyObject *__pyx_n_s_int8;
2784 static PyObject *__pyx_n_s_itemsize;
2785 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2786 static PyObject *__pyx_n_s_kind;
2787 static PyObject *__pyx_n_s_kwargs;
2788 static PyObject *__pyx_n_s_main;
2789 static PyObject *__pyx_n_s_math;
2790 static PyObject *__pyx_n_s_memview;
2791 static PyObject *__pyx_n_s_mode;
2792 static PyObject *__pyx_n_s_name;
2793 static PyObject *__pyx_n_s_name_2;
2794 static PyObject *__pyx_n_s_ndim;
2795 static PyObject *__pyx_n_s_negative;
2796 static PyObject *__pyx_n_s_new;
2797 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2798 static PyObject *__pyx_n_s_np;
2799 static PyObject *__pyx_n_s_numpy;
2800 static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
2801 static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
2802 static PyObject *__pyx_n_s_obj;
2803 static PyObject *__pyx_n_s_order;
2804 static PyObject *__pyx_n_s_pack;
2805 static PyObject *__pyx_n_s_pickle;
2806 static PyObject *__pyx_n_s_pyx_PickleError;
2807 static PyObject *__pyx_n_s_pyx_checksum;
2808 static PyObject *__pyx_n_s_pyx_fuse_0create_live_path;
2809 static PyObject *__pyx_n_s_pyx_fuse_0create_path;
2810 static PyObject *__pyx_n_s_pyx_fuse_1create_live_path;
2811 static PyObject *__pyx_n_s_pyx_fuse_1create_path;
2812 static PyObject *__pyx_n_s_pyx_fuse_2create_live_path;
2813 static PyObject *__pyx_n_s_pyx_fuse_2create_path;
2814 static PyObject *__pyx_n_s_pyx_fuse_3create_live_path;
2815 static PyObject *__pyx_n_s_pyx_fuse_3create_path;
2816 static PyObject *__pyx_n_s_pyx_fuse_4create_live_path;
2817 static PyObject *__pyx_n_s_pyx_fuse_4create_path;
2818 static PyObject *__pyx_n_s_pyx_getbuffer;
2819 static PyObject *__pyx_n_s_pyx_result;
2820 static PyObject *__pyx_n_s_pyx_state;
2821 static PyObject *__pyx_n_s_pyx_type;
2822 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2823 static PyObject *__pyx_n_s_pyx_vtable;
2824 static PyObject *__pyx_n_s_range;
2825 static PyObject *__pyx_n_s_reduce;
2826 static PyObject *__pyx_n_s_reduce_cython;
2827 static PyObject *__pyx_n_s_reduce_ex;
2828 static PyObject *__pyx_n_s_repeat;
2829 static PyObject *__pyx_n_s_s;
2830 static PyObject *__pyx_n_s_samples;
2831 static PyObject *__pyx_n_s_setstate;
2832 static PyObject *__pyx_n_s_setstate_cython;
2833 static PyObject *__pyx_n_s_settings;
2834 static PyObject *__pyx_n_s_shape;
2835 static PyObject *__pyx_n_s_short;
2836 static PyObject *__pyx_kp_s_short_2;
2837 static PyObject *__pyx_kp_u_short_2;
2838 static PyObject *__pyx_n_s_signatures;
2839 static PyObject *__pyx_n_s_size;
2840 static PyObject *__pyx_n_s_split;
2841 static PyObject *__pyx_kp_s_src_urh_cythonext_path_creator_p;
2842 static PyObject *__pyx_n_s_start;
2843 static PyObject *__pyx_n_s_step;
2844 static PyObject *__pyx_n_s_stop;
2845 static PyObject *__pyx_kp_s_strided_and_direct;
2846 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2847 static PyObject *__pyx_kp_s_strided_and_indirect;
2848 static PyObject *__pyx_kp_s_stringsource;
2849 static PyObject *__pyx_n_s_strip;
2850 static PyObject *__pyx_n_s_struct;
2851 static PyObject *__pyx_n_s_subpath_ranges;
2852 static PyObject *__pyx_n_s_test;
2853 static PyObject *__pyx_n_s_uint16;
2854 static PyObject *__pyx_n_s_uint8;
2855 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2856 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2857 static PyObject *__pyx_n_s_unpack;
2858 static PyObject *__pyx_kp_s_unsigned_char;
2859 static PyObject *__pyx_kp_s_unsigned_char_2;
2860 static PyObject *__pyx_kp_u_unsigned_char_2;
2861 static PyObject *__pyx_kp_s_unsigned_short;
2862 static PyObject *__pyx_kp_s_unsigned_short_2;
2863 static PyObject *__pyx_kp_u_unsigned_short_2;
2864 static PyObject *__pyx_n_s_update;
2865 static PyObject *__pyx_n_s_urh;
2866 static PyObject *__pyx_n_s_urh_cythonext_path_creator;
2867 static PyObject *__pyx_n_s_view;
2868 static PyObject *__pyx_n_s_x;
2869 static PyObject *__pyx_n_u_x;
2870 static PyObject *__pyx_n_s_y;
2871 static PyObject *__pyx_n_u_y;
2872 static PyObject *__pyx_n_s_zeros;
2873 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_create_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */
2874 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_6__pyx_fuse_0create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges); /* proto */
2875 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_8__pyx_fuse_1create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges); /* proto */
2876 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_10__pyx_fuse_2create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges); /* proto */
2877 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_12__pyx_fuse_3create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges); /* proto */
2878 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_14__pyx_fuse_4create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges); /* proto */
2879 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_2create_live_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */
2880 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_18__pyx_fuse_0create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end); /* proto */
2881 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_20__pyx_fuse_1create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end); /* proto */
2882 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_22__pyx_fuse_2create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end); /* proto */
2883 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_24__pyx_fuse_3create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end); /* proto */
2884 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_26__pyx_fuse_4create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end); /* proto */
2885 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_4array_to_QPath(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_y); /* proto */
2886 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2887 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2888 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2889 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2890 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2891 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2892 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2893 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2894 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2895 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2896 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2897 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2898 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2899 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2900 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2901 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2902 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2903 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2904 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2905 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2906 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2907 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2908 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2909 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2910 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2911 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2912 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2913 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2914 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2915 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2916 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2917 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2918 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2919 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2920 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2921 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2922 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2923 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2924 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2925 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2926 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2927 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2928 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2929 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2930 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2931 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2932 static PyObject *__pyx_int_0;
2933 static PyObject *__pyx_int_1;
2934 static PyObject *__pyx_int_2;
2935 static PyObject *__pyx_int_3;
2936 static PyObject *__pyx_int_12;
2937 static PyObject *__pyx_int_20;
2938 static PyObject *__pyx_int_184977713;
2939 static PyObject *__pyx_int_neg_1;
2940 static PyObject *__pyx_k_;
2941 static PyObject *__pyx_k__6;
2942 static PyObject *__pyx_k__7;
2943 static PyObject *__pyx_k__8;
2944 static PyObject *__pyx_k__9;
2945 static PyObject *__pyx_k__10;
2946 static PyObject *__pyx_tuple__4;
2947 static PyObject *__pyx_tuple__5;
2948 static PyObject *__pyx_slice__14;
2949 static PyObject *__pyx_slice__15;
2950 static PyObject *__pyx_slice__33;
2951 static PyObject *__pyx_tuple__11;
2952 static PyObject *__pyx_tuple__12;
2953 static PyObject *__pyx_tuple__13;
2954 static PyObject *__pyx_tuple__16;
2955 static PyObject *__pyx_tuple__17;
2956 static PyObject *__pyx_tuple__18;
2957 static PyObject *__pyx_tuple__19;
2958 static PyObject *__pyx_tuple__20;
2959 static PyObject *__pyx_tuple__21;
2960 static PyObject *__pyx_tuple__22;
2961 static PyObject *__pyx_tuple__23;
2962 static PyObject *__pyx_tuple__24;
2963 static PyObject *__pyx_tuple__25;
2964 static PyObject *__pyx_tuple__26;
2965 static PyObject *__pyx_tuple__27;
2966 static PyObject *__pyx_tuple__28;
2967 static PyObject *__pyx_tuple__29;
2968 static PyObject *__pyx_tuple__30;
2969 static PyObject *__pyx_tuple__31;
2970 static PyObject *__pyx_tuple__32;
2971 static PyObject *__pyx_tuple__34;
2972 static PyObject *__pyx_tuple__35;
2973 static PyObject *__pyx_tuple__36;
2974 static PyObject *__pyx_tuple__37;
2975 static PyObject *__pyx_tuple__39;
2976 static PyObject *__pyx_tuple__41;
2977 static PyObject *__pyx_tuple__42;
2978 static PyObject *__pyx_tuple__43;
2979 static PyObject *__pyx_tuple__44;
2980 static PyObject *__pyx_tuple__45;
2981 static PyObject *__pyx_tuple__46;
2982 static PyObject *__pyx_codeobj__38;
2983 static PyObject *__pyx_codeobj__40;
2984 static PyObject *__pyx_codeobj__47;
2985 /* Late includes */
2986 
2987 /* "urh/cythonext/path_creator.pyx":19
2988  * import struct
2989  *
2990  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
2991  *     cdef iq[:] values
2992  *     cdef long long[::1] sample_rng
2993  */
2994 
2995 /* Python wrapper */
2996 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2997 static PyMethodDef __pyx_mdef_3urh_9cythonext_12path_creator_1create_path = {"create_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_1create_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_1create_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2998 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2999   PyObject *__pyx_v_signatures = 0;
3000   PyObject *__pyx_v_args = 0;
3001   PyObject *__pyx_v_kwargs = 0;
3002   CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
3003   int __pyx_lineno = 0;
3004   const char *__pyx_filename = NULL;
3005   int __pyx_clineno = 0;
3006   PyObject *__pyx_r = 0;
3007   __Pyx_RefNannyDeclarations
3008   __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
3009   {
3010     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
3011     PyObject* values[4] = {0,0,0,0};
3012     values[3] = __pyx_k_;
3013     if (unlikely(__pyx_kwds)) {
3014       Py_ssize_t kw_args;
3015       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3016       switch (pos_args) {
3017         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3018         CYTHON_FALLTHROUGH;
3019         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3020         CYTHON_FALLTHROUGH;
3021         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3022         CYTHON_FALLTHROUGH;
3023         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3024         CYTHON_FALLTHROUGH;
3025         case  0: break;
3026         default: goto __pyx_L5_argtuple_error;
3027       }
3028       kw_args = PyDict_Size(__pyx_kwds);
3029       switch (pos_args) {
3030         case  0:
3031         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
3032         else goto __pyx_L5_argtuple_error;
3033         CYTHON_FALLTHROUGH;
3034         case  1:
3035         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
3036         else {
3037           __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
3038         }
3039         CYTHON_FALLTHROUGH;
3040         case  2:
3041         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
3042         else {
3043           __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
3044         }
3045         CYTHON_FALLTHROUGH;
3046         case  3:
3047         if (kw_args > 0) {
3048           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults);
3049           if (value) { values[3] = value; kw_args--; }
3050         }
3051       }
3052       if (unlikely(kw_args > 0)) {
3053         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
3054       }
3055     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3056       goto __pyx_L5_argtuple_error;
3057     } else {
3058       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3059       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3060       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3061       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3062     }
3063     __pyx_v_signatures = values[0];
3064     __pyx_v_args = values[1];
3065     __pyx_v_kwargs = values[2];
3066     __pyx_v_defaults = values[3];
3067   }
3068   goto __pyx_L4_argument_unpacking_done;
3069   __pyx_L5_argtuple_error:;
3070   __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
3071   __pyx_L3_error:;
3072   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
3073   __Pyx_RefNannyFinishContext();
3074   return NULL;
3075   __pyx_L4_argument_unpacking_done:;
3076   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_create_path(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);
3077 
3078   /* function exit code */
3079   __Pyx_RefNannyFinishContext();
3080   return __pyx_r;
3081 }
3082 
__pyx_pf_3urh_9cythonext_12path_creator_create_path(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_signatures,PyObject * __pyx_v_args,PyObject * __pyx_v_kwargs,CYTHON_UNUSED PyObject * __pyx_v_defaults)3083 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_create_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
3084   PyObject *__pyx_v_dest_sig = NULL;
3085   Py_ssize_t __pyx_v_i;
3086   PyTypeObject *__pyx_v_ndarray = 0;
3087   __Pyx_memviewslice __pyx_v_memslice;
3088   Py_ssize_t __pyx_v_itemsize;
3089   int __pyx_v_dtype_signed;
3090   char __pyx_v_kind;
3091   int __pyx_v_char_is_signed;
3092   int __pyx_v_unsigned_char_is_signed;
3093   int __pyx_v_short_is_signed;
3094   int __pyx_v_unsigned_short_is_signed;
3095   PyObject *__pyx_v_arg = NULL;
3096   PyObject *__pyx_v_dtype = NULL;
3097   PyObject *__pyx_v_arg_base = NULL;
3098   PyObject *__pyx_v_candidates = NULL;
3099   PyObject *__pyx_v_sig = NULL;
3100   int __pyx_v_match_found;
3101   PyObject *__pyx_v_src_sig = NULL;
3102   PyObject *__pyx_v_dst_type = NULL;
3103   PyObject *__pyx_r = NULL;
3104   __Pyx_RefNannyDeclarations
3105   PyObject *__pyx_t_1 = NULL;
3106   int __pyx_t_2;
3107   int __pyx_t_3;
3108   int __pyx_t_4;
3109   Py_ssize_t __pyx_t_5;
3110   PyObject *__pyx_t_6 = NULL;
3111   long __pyx_t_7;
3112   __Pyx_memviewslice __pyx_t_8;
3113   Py_ssize_t __pyx_t_9;
3114   int __pyx_t_10;
3115   int __pyx_t_11;
3116   PyObject *__pyx_t_12 = NULL;
3117   PyObject *__pyx_t_13 = NULL;
3118   PyObject *__pyx_t_14 = NULL;
3119   Py_ssize_t __pyx_t_15;
3120   Py_ssize_t __pyx_t_16;
3121   Py_ssize_t __pyx_t_17;
3122   int __pyx_t_18;
3123   int __pyx_lineno = 0;
3124   const char *__pyx_filename = NULL;
3125   int __pyx_clineno = 0;
3126   __Pyx_RefNannySetupContext("create_path", 0);
3127   __Pyx_INCREF(__pyx_v_kwargs);
3128   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
3129   __Pyx_GOTREF(__pyx_t_1);
3130   __Pyx_INCREF(Py_None);
3131   __Pyx_GIVEREF(Py_None);
3132   PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
3133   __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
3134   __pyx_t_1 = 0;
3135   __pyx_t_3 = (__pyx_v_kwargs != Py_None);
3136   __pyx_t_4 = (__pyx_t_3 != 0);
3137   if (__pyx_t_4) {
3138   } else {
3139     __pyx_t_2 = __pyx_t_4;
3140     goto __pyx_L4_bool_binop_done;
3141   }
3142   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3143   __pyx_t_3 = ((!__pyx_t_4) != 0);
3144   __pyx_t_2 = __pyx_t_3;
3145   __pyx_L4_bool_binop_done:;
3146   if (__pyx_t_2) {
3147     __Pyx_INCREF(Py_None);
3148     __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None);
3149   }
3150   __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
3151   __Pyx_GOTREF(__pyx_t_1);
3152   __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
3153   __pyx_t_1 = 0;
3154   __pyx_v_itemsize = -1L;
3155   __pyx_v_char_is_signed = (!((((char)-1L) > 0) != 0));
3156   __pyx_v_unsigned_char_is_signed = (!((((unsigned char)-1L) > 0) != 0));
3157   __pyx_v_short_is_signed = (!((((short)-1L) > 0) != 0));
3158   __pyx_v_unsigned_short_is_signed = (!((((unsigned short)-1L) > 0) != 0));
3159   if (unlikely(__pyx_v_args == Py_None)) {
3160     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3161     __PYX_ERR(0, 19, __pyx_L1_error)
3162   }
3163   __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 19, __pyx_L1_error)
3164   __pyx_t_2 = ((0 < __pyx_t_5) != 0);
3165   if (__pyx_t_2) {
3166     if (unlikely(__pyx_v_args == Py_None)) {
3167       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3168       __PYX_ERR(0, 19, __pyx_L1_error)
3169     }
3170     __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
3171     __Pyx_INCREF(__pyx_t_1);
3172     __pyx_v_arg = __pyx_t_1;
3173     __pyx_t_1 = 0;
3174     goto __pyx_L6;
3175   }
3176   __pyx_t_3 = (__pyx_v_kwargs != Py_None);
3177   __pyx_t_4 = (__pyx_t_3 != 0);
3178   if (__pyx_t_4) {
3179   } else {
3180     __pyx_t_2 = __pyx_t_4;
3181     goto __pyx_L7_bool_binop_done;
3182   }
3183   if (unlikely(__pyx_v_kwargs == Py_None)) {
3184     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
3185     __PYX_ERR(0, 19, __pyx_L1_error)
3186   }
3187   __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_samples, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3188   __pyx_t_3 = (__pyx_t_4 != 0);
3189   __pyx_t_2 = __pyx_t_3;
3190   __pyx_L7_bool_binop_done:;
3191   if (__pyx_t_2) {
3192     if (unlikely(__pyx_v_kwargs == Py_None)) {
3193       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3194       __PYX_ERR(0, 19, __pyx_L1_error)
3195     }
3196     __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
3197     __Pyx_GOTREF(__pyx_t_1);
3198     __pyx_v_arg = __pyx_t_1;
3199     __pyx_t_1 = 0;
3200     goto __pyx_L6;
3201   }
3202   /*else*/ {
3203     if (unlikely(__pyx_v_args == Py_None)) {
3204       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3205       __PYX_ERR(0, 19, __pyx_L1_error)
3206     }
3207     __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 19, __pyx_L1_error)
3208     __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
3209     __Pyx_GOTREF(__pyx_t_1);
3210     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3211     __Pyx_GOTREF(__pyx_t_6);
3212     __Pyx_INCREF(__pyx_int_3);
3213     __Pyx_GIVEREF(__pyx_int_3);
3214     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_3);
3215     __Pyx_INCREF(__pyx_n_s_s);
3216     __Pyx_GIVEREF(__pyx_n_s_s);
3217     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s);
3218     __Pyx_GIVEREF(__pyx_t_1);
3219     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
3220     __pyx_t_1 = 0;
3221     __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
3222     __Pyx_GOTREF(__pyx_t_1);
3223     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3224     __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3225     __Pyx_GOTREF(__pyx_t_6);
3226     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3227     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
3228     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3229     __PYX_ERR(0, 19, __pyx_L1_error)
3230   }
3231   __pyx_L6:;
3232   while (1) {
3233     __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
3234     __pyx_t_3 = (__pyx_t_2 != 0);
3235     if (__pyx_t_3) {
3236       __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
3237       __pyx_t_2 = (__pyx_t_3 != 0);
3238       if (__pyx_t_2) {
3239         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3240         __Pyx_GOTREF(__pyx_t_6);
3241         __pyx_v_dtype = __pyx_t_6;
3242         __pyx_t_6 = 0;
3243         goto __pyx_L12;
3244       }
3245       __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
3246       __pyx_t_3 = (__pyx_t_2 != 0);
3247       if (__pyx_t_3) {
3248         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3249         __Pyx_GOTREF(__pyx_t_6);
3250         __pyx_v_arg_base = __pyx_t_6;
3251         __pyx_t_6 = 0;
3252         __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
3253         __pyx_t_2 = (__pyx_t_3 != 0);
3254         if (__pyx_t_2) {
3255           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3256           __Pyx_GOTREF(__pyx_t_6);
3257           __pyx_v_dtype = __pyx_t_6;
3258           __pyx_t_6 = 0;
3259           goto __pyx_L13;
3260         }
3261         /*else*/ {
3262           __Pyx_INCREF(Py_None);
3263           __pyx_v_dtype = Py_None;
3264         }
3265         __pyx_L13:;
3266         goto __pyx_L12;
3267       }
3268       /*else*/ {
3269         __Pyx_INCREF(Py_None);
3270         __pyx_v_dtype = Py_None;
3271       }
3272       __pyx_L12:;
3273       __pyx_v_itemsize = -1L;
3274       __pyx_t_2 = (__pyx_v_dtype != Py_None);
3275       __pyx_t_3 = (__pyx_t_2 != 0);
3276       if (__pyx_t_3) {
3277         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3278         __Pyx_GOTREF(__pyx_t_6);
3279         __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
3280         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3281         __pyx_v_itemsize = __pyx_t_5;
3282         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3283         __Pyx_GOTREF(__pyx_t_6);
3284         __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 19, __pyx_L1_error)
3285         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3286         __pyx_v_kind = __pyx_t_7;
3287         __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
3288         switch (__pyx_v_kind) {
3289           case 'i':
3290           case 'u':
3291           __pyx_t_2 = (((sizeof(char)) == __pyx_v_itemsize) != 0);
3292           if (__pyx_t_2) {
3293           } else {
3294             __pyx_t_3 = __pyx_t_2;
3295             goto __pyx_L16_bool_binop_done;
3296           }
3297           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3298           __Pyx_GOTREF(__pyx_t_6);
3299           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
3300           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3301           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
3302           if (__pyx_t_2) {
3303           } else {
3304             __pyx_t_3 = __pyx_t_2;
3305             goto __pyx_L16_bool_binop_done;
3306           }
3307           __pyx_t_2 = ((!((__pyx_v_char_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
3308           __pyx_t_3 = __pyx_t_2;
3309           __pyx_L16_bool_binop_done:;
3310           if (__pyx_t_3) {
3311             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3312             goto __pyx_L10_break;
3313           }
3314           __pyx_t_2 = (((sizeof(unsigned char)) == __pyx_v_itemsize) != 0);
3315           if (__pyx_t_2) {
3316           } else {
3317             __pyx_t_3 = __pyx_t_2;
3318             goto __pyx_L20_bool_binop_done;
3319           }
3320           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3321           __Pyx_GOTREF(__pyx_t_6);
3322           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
3323           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3324           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
3325           if (__pyx_t_2) {
3326           } else {
3327             __pyx_t_3 = __pyx_t_2;
3328             goto __pyx_L20_bool_binop_done;
3329           }
3330           __pyx_t_2 = ((!((__pyx_v_unsigned_char_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
3331           __pyx_t_3 = __pyx_t_2;
3332           __pyx_L20_bool_binop_done:;
3333           if (__pyx_t_3) {
3334             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3335             goto __pyx_L10_break;
3336           }
3337           __pyx_t_2 = (((sizeof(short)) == __pyx_v_itemsize) != 0);
3338           if (__pyx_t_2) {
3339           } else {
3340             __pyx_t_3 = __pyx_t_2;
3341             goto __pyx_L24_bool_binop_done;
3342           }
3343           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3344           __Pyx_GOTREF(__pyx_t_6);
3345           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
3346           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3347           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
3348           if (__pyx_t_2) {
3349           } else {
3350             __pyx_t_3 = __pyx_t_2;
3351             goto __pyx_L24_bool_binop_done;
3352           }
3353           __pyx_t_2 = ((!((__pyx_v_short_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
3354           __pyx_t_3 = __pyx_t_2;
3355           __pyx_L24_bool_binop_done:;
3356           if (__pyx_t_3) {
3357             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3358             goto __pyx_L10_break;
3359           }
3360           __pyx_t_2 = (((sizeof(unsigned short)) == __pyx_v_itemsize) != 0);
3361           if (__pyx_t_2) {
3362           } else {
3363             __pyx_t_3 = __pyx_t_2;
3364             goto __pyx_L28_bool_binop_done;
3365           }
3366           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3367           __Pyx_GOTREF(__pyx_t_6);
3368           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
3369           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3370           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
3371           if (__pyx_t_2) {
3372           } else {
3373             __pyx_t_3 = __pyx_t_2;
3374             goto __pyx_L28_bool_binop_done;
3375           }
3376           __pyx_t_2 = ((!((__pyx_v_unsigned_short_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
3377           __pyx_t_3 = __pyx_t_2;
3378           __pyx_L28_bool_binop_done:;
3379           if (__pyx_t_3) {
3380             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3381             goto __pyx_L10_break;
3382           }
3383           break;
3384           case 'f':
3385           __pyx_t_2 = (((sizeof(float)) == __pyx_v_itemsize) != 0);
3386           if (__pyx_t_2) {
3387           } else {
3388             __pyx_t_3 = __pyx_t_2;
3389             goto __pyx_L32_bool_binop_done;
3390           }
3391           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3392           __Pyx_GOTREF(__pyx_t_6);
3393           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
3394           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3395           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
3396           __pyx_t_3 = __pyx_t_2;
3397           __pyx_L32_bool_binop_done:;
3398           if (__pyx_t_3) {
3399             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3400             goto __pyx_L10_break;
3401           }
3402           break;
3403           case 'c':
3404           break;
3405           case 'O':
3406           break;
3407           default: break;
3408         }
3409       }
3410     }
3411     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
3412     if (!__pyx_t_2) {
3413     } else {
3414       __pyx_t_3 = __pyx_t_2;
3415       goto __pyx_L35_bool_binop_done;
3416     }
3417     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(char))) != 0);
3418     __pyx_t_3 = __pyx_t_2;
3419     __pyx_L35_bool_binop_done:;
3420     if (__pyx_t_3) {
3421       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_char(__pyx_v_arg, 0);
3422       __pyx_v_memslice = __pyx_t_8;
3423       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
3424       if (__pyx_t_3) {
3425         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
3426         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3427         goto __pyx_L10_break;
3428       }
3429       /*else*/ {
3430         PyErr_Clear();
3431       }
3432     }
3433     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
3434     if (!__pyx_t_2) {
3435     } else {
3436       __pyx_t_3 = __pyx_t_2;
3437       goto __pyx_L39_bool_binop_done;
3438     }
3439     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned char))) != 0);
3440     __pyx_t_3 = __pyx_t_2;
3441     __pyx_L39_bool_binop_done:;
3442     if (__pyx_t_3) {
3443       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_v_arg, 0);
3444       __pyx_v_memslice = __pyx_t_8;
3445       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
3446       if (__pyx_t_3) {
3447         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
3448         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3449         goto __pyx_L10_break;
3450       }
3451       /*else*/ {
3452         PyErr_Clear();
3453       }
3454     }
3455     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
3456     if (!__pyx_t_2) {
3457     } else {
3458       __pyx_t_3 = __pyx_t_2;
3459       goto __pyx_L43_bool_binop_done;
3460     }
3461     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(short))) != 0);
3462     __pyx_t_3 = __pyx_t_2;
3463     __pyx_L43_bool_binop_done:;
3464     if (__pyx_t_3) {
3465       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_short(__pyx_v_arg, 0);
3466       __pyx_v_memslice = __pyx_t_8;
3467       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
3468       if (__pyx_t_3) {
3469         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
3470         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3471         goto __pyx_L10_break;
3472       }
3473       /*else*/ {
3474         PyErr_Clear();
3475       }
3476     }
3477     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
3478     if (!__pyx_t_2) {
3479     } else {
3480       __pyx_t_3 = __pyx_t_2;
3481       goto __pyx_L47_bool_binop_done;
3482     }
3483     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned short))) != 0);
3484     __pyx_t_3 = __pyx_t_2;
3485     __pyx_L47_bool_binop_done:;
3486     if (__pyx_t_3) {
3487       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(__pyx_v_arg, 0);
3488       __pyx_v_memslice = __pyx_t_8;
3489       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
3490       if (__pyx_t_3) {
3491         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
3492         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3493         goto __pyx_L10_break;
3494       }
3495       /*else*/ {
3496         PyErr_Clear();
3497       }
3498     }
3499     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
3500     if (!__pyx_t_2) {
3501     } else {
3502       __pyx_t_3 = __pyx_t_2;
3503       goto __pyx_L51_bool_binop_done;
3504     }
3505     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(float))) != 0);
3506     __pyx_t_3 = __pyx_t_2;
3507     __pyx_L51_bool_binop_done:;
3508     if (__pyx_t_3) {
3509       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0);
3510       __pyx_v_memslice = __pyx_t_8;
3511       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
3512       if (__pyx_t_3) {
3513         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
3514         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3515         goto __pyx_L10_break;
3516       }
3517       /*else*/ {
3518         PyErr_Clear();
3519       }
3520     }
3521     if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3522     goto __pyx_L10_break;
3523   }
3524   __pyx_L10_break:;
3525   __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3526   __Pyx_GOTREF(__pyx_t_6);
3527   __pyx_v_candidates = ((PyObject*)__pyx_t_6);
3528   __pyx_t_6 = 0;
3529   __pyx_t_5 = 0;
3530   if (unlikely(__pyx_v_signatures == Py_None)) {
3531     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
3532     __PYX_ERR(0, 19, __pyx_L1_error)
3533   }
3534   __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
3535   __Pyx_GOTREF(__pyx_t_1);
3536   __Pyx_XDECREF(__pyx_t_6);
3537   __pyx_t_6 = __pyx_t_1;
3538   __pyx_t_1 = 0;
3539   while (1) {
3540     __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10);
3541     if (unlikely(__pyx_t_11 == 0)) break;
3542     if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 19, __pyx_L1_error)
3543     __Pyx_GOTREF(__pyx_t_1);
3544     __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1);
3545     __pyx_t_1 = 0;
3546     __pyx_v_match_found = 0;
3547     __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 19, __pyx_L1_error)
3548     __Pyx_GOTREF(__pyx_t_13);
3549     __pyx_t_14 = NULL;
3550     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
3551       __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
3552       if (likely(__pyx_t_14)) {
3553         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
3554         __Pyx_INCREF(__pyx_t_14);
3555         __Pyx_INCREF(function);
3556         __Pyx_DECREF_SET(__pyx_t_13, function);
3557       }
3558     }
3559     __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2);
3560     __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3561     if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 19, __pyx_L1_error)
3562     __Pyx_GOTREF(__pyx_t_12);
3563     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3564     __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 19, __pyx_L1_error)
3565     __Pyx_GOTREF(__pyx_t_13);
3566     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3567     __pyx_t_12 = NULL;
3568     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
3569       __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
3570       if (likely(__pyx_t_12)) {
3571         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
3572         __Pyx_INCREF(__pyx_t_12);
3573         __Pyx_INCREF(function);
3574         __Pyx_DECREF_SET(__pyx_t_13, function);
3575       }
3576     }
3577     __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3);
3578     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3579     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
3580     __Pyx_GOTREF(__pyx_t_1);
3581     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3582     __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1);
3583     __pyx_t_1 = 0;
3584     __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 19, __pyx_L1_error)
3585     __pyx_t_16 = __pyx_t_15;
3586     for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
3587       __pyx_v_i = __pyx_t_17;
3588       __pyx_t_1 = PyList_GET_ITEM(__pyx_v_dest_sig, __pyx_v_i);
3589       __Pyx_INCREF(__pyx_t_1);
3590       __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1);
3591       __pyx_t_1 = 0;
3592       __pyx_t_3 = (__pyx_v_dst_type != Py_None);
3593       __pyx_t_2 = (__pyx_t_3 != 0);
3594       if (__pyx_t_2) {
3595         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
3596         __Pyx_GOTREF(__pyx_t_1);
3597         __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 19, __pyx_L1_error)
3598         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3599         __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
3600         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3601         if (__pyx_t_2) {
3602           __pyx_v_match_found = 1;
3603           goto __pyx_L59;
3604         }
3605         /*else*/ {
3606           __pyx_v_match_found = 0;
3607           goto __pyx_L57_break;
3608         }
3609         __pyx_L59:;
3610       }
3611     }
3612     __pyx_L57_break:;
3613     __pyx_t_2 = (__pyx_v_match_found != 0);
3614     if (__pyx_t_2) {
3615       __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 19, __pyx_L1_error)
3616     }
3617   }
3618   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3619   __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0);
3620   __pyx_t_3 = ((!__pyx_t_2) != 0);
3621   if (__pyx_t_3) {
3622     __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3623     __Pyx_GOTREF(__pyx_t_6);
3624     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
3625     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3626     __PYX_ERR(0, 19, __pyx_L1_error)
3627   }
3628   __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 19, __pyx_L1_error)
3629   __pyx_t_3 = ((__pyx_t_9 > 1) != 0);
3630   if (__pyx_t_3) {
3631     __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3632     __Pyx_GOTREF(__pyx_t_6);
3633     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
3634     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3635     __PYX_ERR(0, 19, __pyx_L1_error)
3636   }
3637   /*else*/ {
3638     __Pyx_XDECREF(__pyx_r);
3639     if (unlikely(__pyx_v_signatures == Py_None)) {
3640       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3641       __PYX_ERR(0, 19, __pyx_L1_error)
3642     }
3643     __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 19, __pyx_L1_error)
3644     __Pyx_GOTREF(__pyx_t_6);
3645     __pyx_r = __pyx_t_6;
3646     __pyx_t_6 = 0;
3647     goto __pyx_L0;
3648   }
3649 
3650   /* function exit code */
3651   __pyx_L1_error:;
3652   __Pyx_XDECREF(__pyx_t_1);
3653   __Pyx_XDECREF(__pyx_t_6);
3654   __Pyx_XDECREF(__pyx_t_12);
3655   __Pyx_XDECREF(__pyx_t_13);
3656   __Pyx_XDECREF(__pyx_t_14);
3657   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
3658   __pyx_r = NULL;
3659   __pyx_L0:;
3660   __Pyx_XDECREF(__pyx_v_dest_sig);
3661   __Pyx_XDECREF(__pyx_v_ndarray);
3662   __Pyx_XDECREF(__pyx_v_arg);
3663   __Pyx_XDECREF(__pyx_v_dtype);
3664   __Pyx_XDECREF(__pyx_v_arg_base);
3665   __Pyx_XDECREF(__pyx_v_candidates);
3666   __Pyx_XDECREF(__pyx_v_sig);
3667   __Pyx_XDECREF(__pyx_v_src_sig);
3668   __Pyx_XDECREF(__pyx_v_dst_type);
3669   __Pyx_XDECREF(__pyx_v_kwargs);
3670   __Pyx_XGIVEREF(__pyx_r);
3671   __Pyx_RefNannyFinishContext();
3672   return __pyx_r;
3673 }
3674 
3675 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_7__pyx_fuse_0create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3676 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_0__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_fuse_0__pyx_opt_args_3urh_9cythonext_12path_creator_create_path * __pyx_optional_args)3677 static PyObject *__pyx_fuse_0__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_fuse_0__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args) {
3678   PyObject *__pyx_v_subpath_ranges = __pyx_k__6;
3679   __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
3680   __Pyx_memviewslice __pyx_v_sample_rng = { 0, 0, { 0 }, { 0 }, { 0 } };
3681   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
3682   char __pyx_v_sample;
3683   char __pyx_v_minimum;
3684   char __pyx_v_maximum;
3685   char __pyx_v_tmp;
3686   float __pyx_v_scale_factor;
3687   PY_LONG_LONG __pyx_v_i;
3688   PY_LONG_LONG __pyx_v_j;
3689   PY_LONG_LONG __pyx_v_index;
3690   PY_LONG_LONG __pyx_v_chunk_end;
3691   PY_LONG_LONG __pyx_v_num_samples;
3692   PY_LONG_LONG __pyx_v_pixels_on_path;
3693   PY_LONG_LONG __pyx_v_samples_per_pixel;
3694   PyObject *__pyx_v_type_lookup = 0;
3695   CYTHON_UNUSED int __pyx_v_num_threads;
3696   PyObject *__pyx_v_result = 0;
3697   PyObject *__pyx_v_subpath_range = NULL;
3698   PyObject *__pyx_v_sub_start = NULL;
3699   PyObject *__pyx_v_sub_end = NULL;
3700   PyObject *__pyx_r = NULL;
3701   __Pyx_RefNannyDeclarations
3702   PyObject *__pyx_t_1 = NULL;
3703   PyObject *__pyx_t_2 = NULL;
3704   PyObject *__pyx_t_3 = NULL;
3705   int __pyx_t_4;
3706   PyObject *__pyx_t_5 = NULL;
3707   PY_LONG_LONG __pyx_t_6;
3708   PyObject *__pyx_t_7 = NULL;
3709   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
3710   size_t __pyx_t_9;
3711   __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
3712   PY_LONG_LONG __pyx_t_11;
3713   PY_LONG_LONG __pyx_t_12;
3714   PY_LONG_LONG __pyx_t_13;
3715   PY_LONG_LONG __pyx_t_14;
3716   PY_LONG_LONG __pyx_t_15;
3717   PY_LONG_LONG __pyx_t_16;
3718   PY_LONG_LONG __pyx_t_17;
3719   PY_LONG_LONG __pyx_t_18;
3720   int __pyx_t_19;
3721   __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
3722   Py_ssize_t __pyx_t_21;
3723   long __pyx_t_22;
3724   Py_ssize_t __pyx_t_23;
3725   Py_ssize_t __pyx_t_24;
3726   int __pyx_t_25;
3727   int __pyx_lineno = 0;
3728   const char *__pyx_filename = NULL;
3729   int __pyx_clineno = 0;
3730   __Pyx_RefNannySetupContext("__pyx_fuse_0create_path", 0);
3731   if (__pyx_optional_args) {
3732     if (__pyx_optional_args->__pyx_n > 0) {
3733       __pyx_v_subpath_ranges = __pyx_optional_args->subpath_ranges;
3734     }
3735   }
3736   __Pyx_INCREF(__pyx_v_subpath_ranges);
3737 
3738   /* "urh/cythonext/path_creator.pyx":26
3739  *     cdef float scale_factor
3740  *     cdef long long i,j,index, chunk_end, num_samples, pixels_on_path, samples_per_pixel
3741  *     num_samples = end - start             # <<<<<<<<<<<<<<
3742  *
3743  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
3744  */
3745   __pyx_v_num_samples = (__pyx_v_end - __pyx_v_start);
3746 
3747   /* "urh/cythonext/path_creator.pyx":28
3748  *     num_samples = end - start
3749  *
3750  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,             # <<<<<<<<<<<<<<
3751  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
3752  *                              "float[:]": np.float32, "double[:]": np.float64}
3753  */
3754   __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3755   __Pyx_GOTREF(__pyx_t_1);
3756   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3757   __Pyx_GOTREF(__pyx_t_2);
3758   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
3759   __Pyx_GOTREF(__pyx_t_3);
3760   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3761   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_char_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3762   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3763   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
3764   __Pyx_GOTREF(__pyx_t_3);
3765   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3766   __Pyx_GOTREF(__pyx_t_2);
3767   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3768   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_char_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3769   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3770 
3771   /* "urh/cythonext/path_creator.pyx":29
3772  *
3773  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
3774  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,             # <<<<<<<<<<<<<<
3775  *                              "float[:]": np.float32, "double[:]": np.float64}
3776  *
3777  */
3778   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
3779   __Pyx_GOTREF(__pyx_t_2);
3780   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
3781   __Pyx_GOTREF(__pyx_t_3);
3782   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3783   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_short_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3784   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3785   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
3786   __Pyx_GOTREF(__pyx_t_3);
3787   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
3788   __Pyx_GOTREF(__pyx_t_2);
3789   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3790   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_short_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3791   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3792 
3793   /* "urh/cythonext/path_creator.pyx":30
3794  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
3795  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
3796  *                              "float[:]": np.float32, "double[:]": np.float64}             # <<<<<<<<<<<<<<
3797  *
3798  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
3799  */
3800   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
3801   __Pyx_GOTREF(__pyx_t_2);
3802   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3803   __Pyx_GOTREF(__pyx_t_3);
3804   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3805   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_float_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3806   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3807   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3808   __Pyx_GOTREF(__pyx_t_3);
3809   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
3810   __Pyx_GOTREF(__pyx_t_2);
3811   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3812   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_double, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3813   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3814   __pyx_v_type_lookup = ((PyObject*)__pyx_t_1);
3815   __pyx_t_1 = 0;
3816 
3817   /* "urh/cythonext/path_creator.pyx":32
3818  *                              "float[:]": np.float32, "double[:]": np.float64}
3819  *
3820  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges             # <<<<<<<<<<<<<<
3821  *     pixels_on_path = settings.PIXELS_PER_PATH
3822  *
3823  */
3824   __pyx_t_4 = (__pyx_v_subpath_ranges == ((PyObject*)Py_None));
3825   if ((__pyx_t_4 != 0)) {
3826     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
3827     __Pyx_GOTREF(__pyx_t_2);
3828     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
3829     __Pyx_GOTREF(__pyx_t_3);
3830     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error)
3831     __Pyx_GOTREF(__pyx_t_5);
3832     __Pyx_GIVEREF(__pyx_t_2);
3833     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
3834     __Pyx_GIVEREF(__pyx_t_3);
3835     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
3836     __pyx_t_2 = 0;
3837     __pyx_t_3 = 0;
3838     __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
3839     __Pyx_GOTREF(__pyx_t_3);
3840     __Pyx_GIVEREF(__pyx_t_5);
3841     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
3842     __pyx_t_5 = 0;
3843     __pyx_t_1 = __pyx_t_3;
3844     __pyx_t_3 = 0;
3845   } else {
3846     __Pyx_INCREF(__pyx_v_subpath_ranges);
3847     __pyx_t_1 = __pyx_v_subpath_ranges;
3848   }
3849   __Pyx_DECREF_SET(__pyx_v_subpath_ranges, ((PyObject*)__pyx_t_1));
3850   __pyx_t_1 = 0;
3851 
3852   /* "urh/cythonext/path_creator.pyx":33
3853  *
3854  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
3855  *     pixels_on_path = settings.PIXELS_PER_PATH             # <<<<<<<<<<<<<<
3856  *
3857  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
3858  */
3859   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3860   __Pyx_GOTREF(__pyx_t_1);
3861   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PIXELS_PER_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
3862   __Pyx_GOTREF(__pyx_t_3);
3863   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3864   __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error)
3865   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3866   __pyx_v_pixels_on_path = __pyx_t_6;
3867 
3868   /* "urh/cythonext/path_creator.pyx":35
3869  *     pixels_on_path = settings.PIXELS_PER_PATH
3870  *
3871  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)             # <<<<<<<<<<<<<<
3872  *
3873  *     cdef int num_threads = 0
3874  */
3875   __pyx_v_samples_per_pixel = ((PY_LONG_LONG)(__pyx_v_num_samples / __pyx_v_pixels_on_path));
3876 
3877   /* "urh/cythonext/path_creator.pyx":37
3878  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
3879  *
3880  *     cdef int num_threads = 0             # <<<<<<<<<<<<<<
3881  *     if samples_per_pixel < 20000:
3882  *         num_threads = 1
3883  */
3884   __pyx_v_num_threads = 0;
3885 
3886   /* "urh/cythonext/path_creator.pyx":38
3887  *
3888  *     cdef int num_threads = 0
3889  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
3890  *         num_threads = 1
3891  *
3892  */
3893   __pyx_t_4 = ((__pyx_v_samples_per_pixel < 0x4E20) != 0);
3894   if (__pyx_t_4) {
3895 
3896     /* "urh/cythonext/path_creator.pyx":39
3897  *     cdef int num_threads = 0
3898  *     if samples_per_pixel < 20000:
3899  *         num_threads = 1             # <<<<<<<<<<<<<<
3900  *
3901  *     if samples_per_pixel > 1:
3902  */
3903     __pyx_v_num_threads = 1;
3904 
3905     /* "urh/cythonext/path_creator.pyx":38
3906  *
3907  *     cdef int num_threads = 0
3908  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
3909  *         num_threads = 1
3910  *
3911  */
3912   }
3913 
3914   /* "urh/cythonext/path_creator.pyx":41
3915  *         num_threads = 1
3916  *
3917  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
3918  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
3919  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
3920  */
3921   __pyx_t_4 = ((__pyx_v_samples_per_pixel > 1) != 0);
3922   if (__pyx_t_4) {
3923 
3924     /* "urh/cythonext/path_creator.pyx":42
3925  *
3926  *     if samples_per_pixel > 1:
3927  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)             # <<<<<<<<<<<<<<
3928  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
3929  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
3930  */
3931     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3932     __Pyx_GOTREF(__pyx_t_3);
3933     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
3934     __Pyx_GOTREF(__pyx_t_1);
3935     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3936     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3937     __Pyx_GOTREF(__pyx_t_3);
3938     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3939     __Pyx_GOTREF(__pyx_t_5);
3940     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_samples_per_pixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3941     __Pyx_GOTREF(__pyx_t_2);
3942     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
3943     __Pyx_GOTREF(__pyx_t_7);
3944     __Pyx_GIVEREF(__pyx_t_3);
3945     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
3946     __Pyx_GIVEREF(__pyx_t_5);
3947     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
3948     __Pyx_GIVEREF(__pyx_t_2);
3949     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
3950     __pyx_t_3 = 0;
3951     __pyx_t_5 = 0;
3952     __pyx_t_2 = 0;
3953     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3954     __Pyx_GOTREF(__pyx_t_2);
3955     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3956     __Pyx_GOTREF(__pyx_t_5);
3957     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3958     __Pyx_GOTREF(__pyx_t_3);
3959     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3960     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
3961     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3962     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3963     __Pyx_GOTREF(__pyx_t_3);
3964     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3965     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3966     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3967     __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 42, __pyx_L1_error)
3968     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3969     __pyx_v_sample_rng = __pyx_t_8;
3970     __pyx_t_8.memview = NULL;
3971     __pyx_t_8.data = NULL;
3972 
3973     /* "urh/cythonext/path_creator.pyx":43
3974  *     if samples_per_pixel > 1:
3975  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
3976  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")             # <<<<<<<<<<<<<<
3977  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
3978  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
3979  */
3980     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
3981     __Pyx_GOTREF(__pyx_t_3);
3982     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3983     __Pyx_GOTREF(__pyx_t_2);
3984     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3985     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
3986     __pyx_t_3 = PyInt_FromSsize_t((2 * __pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
3987     __Pyx_GOTREF(__pyx_t_3);
3988     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3989     __Pyx_GOTREF(__pyx_t_7);
3990     __Pyx_GIVEREF(__pyx_t_3);
3991     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
3992     __pyx_t_3 = 0;
3993     __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
3994     __Pyx_GOTREF(__pyx_t_3);
3995     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_type_lookup, __pyx_kp_s_char_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
3996     __Pyx_GOTREF(__pyx_t_1);
3997     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
3998     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3999     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
4000     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
4001     __Pyx_GOTREF(__pyx_t_1);
4002     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4003     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4004     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4005     __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_char(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 43, __pyx_L1_error)
4006     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4007     __pyx_v_values = __pyx_t_10;
4008     __pyx_t_10.memview = NULL;
4009     __pyx_t_10.data = NULL;
4010 
4011     /* "urh/cythonext/path_creator.pyx":44
4012  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
4013  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
4014  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!             # <<<<<<<<<<<<<<
4015  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
4016  *             chunk_end = i + samples_per_pixel
4017  */
4018     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
4019     __pyx_v_scale_factor = (((double)__pyx_v_num_samples) / (2.0 * __pyx_t_9));
4020 
4021     /* "urh/cythonext/path_creator.pyx":45
4022  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
4023  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
4024  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
4025  *             chunk_end = i + samples_per_pixel
4026  *             if chunk_end >= end:
4027  */
4028     {
4029         #ifdef WITH_THREAD
4030         PyThreadState *_save;
4031         Py_UNBLOCK_THREADS
4032         __Pyx_FastGIL_Remember();
4033         #endif
4034         /*try:*/ {
4035           __pyx_t_6 = __pyx_v_start;
4036           __pyx_t_11 = __pyx_v_end;
4037           __pyx_t_12 = __pyx_v_samples_per_pixel;
4038           if ((__pyx_t_12 == 0)) abort();
4039           {
4040               #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
4041                   #undef likely
4042                   #undef unlikely
4043                   #define likely(x)   (x)
4044                   #define unlikely(x) (x)
4045               #endif
4046               __pyx_t_14 = (__pyx_t_11 - __pyx_t_6 + __pyx_t_12 - __pyx_t_12/abs(__pyx_t_12)) / __pyx_t_12;
4047               if (__pyx_t_14 > 0)
4048               {
4049                   #ifdef _OPENMP
4050                   #pragma omp parallel num_threads(__pyx_v_num_threads) private(__pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_4)
4051                   #endif /* _OPENMP */
4052                   {
4053                       #ifdef _OPENMP
4054                       #pragma omp for lastprivate(__pyx_v_chunk_end) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_index) lastprivate(__pyx_v_j) lastprivate(__pyx_v_maximum) lastprivate(__pyx_v_minimum) lastprivate(__pyx_v_sample) lastprivate(__pyx_v_tmp) schedule(static)
4055                       #endif /* _OPENMP */
4056                       for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13++){
4057                           {
4058                               __pyx_v_i = (PY_LONG_LONG)(__pyx_t_6 + __pyx_t_12 * __pyx_t_13);
4059                               /* Initialize private variables to invalid values */
4060                               __pyx_v_chunk_end = ((PY_LONG_LONG)0xbad0bad0);
4061                               __pyx_v_index = ((PY_LONG_LONG)0xbad0bad0);
4062                               __pyx_v_j = ((PY_LONG_LONG)0xbad0bad0);
4063                               __pyx_v_maximum = ((char)'?');
4064                               __pyx_v_minimum = ((char)'?');
4065                               __pyx_v_sample = ((char)'?');
4066                               __pyx_v_tmp = ((char)'?');
4067 
4068                               /* "urh/cythonext/path_creator.pyx":46
4069  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
4070  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
4071  *             chunk_end = i + samples_per_pixel             # <<<<<<<<<<<<<<
4072  *             if chunk_end >= end:
4073  *                 chunk_end = end
4074  */
4075                               __pyx_v_chunk_end = (__pyx_v_i + __pyx_v_samples_per_pixel);
4076 
4077                               /* "urh/cythonext/path_creator.pyx":47
4078  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
4079  *             chunk_end = i + samples_per_pixel
4080  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
4081  *                 chunk_end = end
4082  *
4083  */
4084                               __pyx_t_4 = ((__pyx_v_chunk_end >= __pyx_v_end) != 0);
4085                               if (__pyx_t_4) {
4086 
4087                                 /* "urh/cythonext/path_creator.pyx":48
4088  *             chunk_end = i + samples_per_pixel
4089  *             if chunk_end >= end:
4090  *                 chunk_end = end             # <<<<<<<<<<<<<<
4091  *
4092  *             tmp = samples[i]
4093  */
4094                                 __pyx_v_chunk_end = __pyx_v_end;
4095 
4096                                 /* "urh/cythonext/path_creator.pyx":47
4097  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
4098  *             chunk_end = i + samples_per_pixel
4099  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
4100  *                 chunk_end = end
4101  *
4102  */
4103                               }
4104 
4105                               /* "urh/cythonext/path_creator.pyx":50
4106  *                 chunk_end = end
4107  *
4108  *             tmp = samples[i]             # <<<<<<<<<<<<<<
4109  *             minimum = tmp
4110  *             maximum = tmp
4111  */
4112                               __pyx_t_15 = __pyx_v_i;
4113                               __pyx_v_tmp = (*((char *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_15 * __pyx_v_samples.strides[0]) )));
4114 
4115                               /* "urh/cythonext/path_creator.pyx":51
4116  *
4117  *             tmp = samples[i]
4118  *             minimum = tmp             # <<<<<<<<<<<<<<
4119  *             maximum = tmp
4120  *
4121  */
4122                               __pyx_v_minimum = __pyx_v_tmp;
4123 
4124                               /* "urh/cythonext/path_creator.pyx":52
4125  *             tmp = samples[i]
4126  *             minimum = tmp
4127  *             maximum = tmp             # <<<<<<<<<<<<<<
4128  *
4129  *             for j in range(i + 1, chunk_end):
4130  */
4131                               __pyx_v_maximum = __pyx_v_tmp;
4132 
4133                               /* "urh/cythonext/path_creator.pyx":54
4134  *             maximum = tmp
4135  *
4136  *             for j in range(i + 1, chunk_end):             # <<<<<<<<<<<<<<
4137  *                 sample = samples[j]
4138  *                 if sample < minimum:
4139  */
4140                               __pyx_t_15 = __pyx_v_chunk_end;
4141                               __pyx_t_16 = __pyx_t_15;
4142                               for (__pyx_t_17 = (__pyx_v_i + 1); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
4143                                 __pyx_v_j = __pyx_t_17;
4144 
4145                                 /* "urh/cythonext/path_creator.pyx":55
4146  *
4147  *             for j in range(i + 1, chunk_end):
4148  *                 sample = samples[j]             # <<<<<<<<<<<<<<
4149  *                 if sample < minimum:
4150  *                     minimum = sample
4151  */
4152                                 __pyx_t_18 = __pyx_v_j;
4153                                 __pyx_v_sample = (*((char *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )));
4154 
4155                                 /* "urh/cythonext/path_creator.pyx":56
4156  *             for j in range(i + 1, chunk_end):
4157  *                 sample = samples[j]
4158  *                 if sample < minimum:             # <<<<<<<<<<<<<<
4159  *                     minimum = sample
4160  *                 elif sample > maximum:
4161  */
4162                                 __pyx_t_4 = ((__pyx_v_sample < __pyx_v_minimum) != 0);
4163                                 if (__pyx_t_4) {
4164 
4165                                   /* "urh/cythonext/path_creator.pyx":57
4166  *                 sample = samples[j]
4167  *                 if sample < minimum:
4168  *                     minimum = sample             # <<<<<<<<<<<<<<
4169  *                 elif sample > maximum:
4170  *                     maximum = sample
4171  */
4172                                   __pyx_v_minimum = __pyx_v_sample;
4173 
4174                                   /* "urh/cythonext/path_creator.pyx":56
4175  *             for j in range(i + 1, chunk_end):
4176  *                 sample = samples[j]
4177  *                 if sample < minimum:             # <<<<<<<<<<<<<<
4178  *                     minimum = sample
4179  *                 elif sample > maximum:
4180  */
4181                                   goto __pyx_L15;
4182                                 }
4183 
4184                                 /* "urh/cythonext/path_creator.pyx":58
4185  *                 if sample < minimum:
4186  *                     minimum = sample
4187  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
4188  *                     maximum = sample
4189  *
4190  */
4191                                 __pyx_t_4 = ((__pyx_v_sample > __pyx_v_maximum) != 0);
4192                                 if (__pyx_t_4) {
4193 
4194                                   /* "urh/cythonext/path_creator.pyx":59
4195  *                     minimum = sample
4196  *                 elif sample > maximum:
4197  *                     maximum = sample             # <<<<<<<<<<<<<<
4198  *
4199  *             index = <long long>(2*(i-start)/samples_per_pixel)
4200  */
4201                                   __pyx_v_maximum = __pyx_v_sample;
4202 
4203                                   /* "urh/cythonext/path_creator.pyx":58
4204  *                 if sample < minimum:
4205  *                     minimum = sample
4206  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
4207  *                     maximum = sample
4208  *
4209  */
4210                                 }
4211                                 __pyx_L15:;
4212                               }
4213 
4214                               /* "urh/cythonext/path_creator.pyx":61
4215  *                     maximum = sample
4216  *
4217  *             index = <long long>(2*(i-start)/samples_per_pixel)             # <<<<<<<<<<<<<<
4218  *             values[index] = minimum
4219  *             values[index + 1] = maximum
4220  */
4221                               __pyx_v_index = ((PY_LONG_LONG)((2 * (__pyx_v_i - __pyx_v_start)) / __pyx_v_samples_per_pixel));
4222 
4223                               /* "urh/cythonext/path_creator.pyx":62
4224  *
4225  *             index = <long long>(2*(i-start)/samples_per_pixel)
4226  *             values[index] = minimum             # <<<<<<<<<<<<<<
4227  *             values[index + 1] = maximum
4228  *
4229  */
4230                               __pyx_t_15 = __pyx_v_index;
4231                               *((char *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_minimum;
4232 
4233                               /* "urh/cythonext/path_creator.pyx":63
4234  *             index = <long long>(2*(i-start)/samples_per_pixel)
4235  *             values[index] = minimum
4236  *             values[index + 1] = maximum             # <<<<<<<<<<<<<<
4237  *
4238  *         x = np.repeat(sample_rng, 2)
4239  */
4240                               __pyx_t_15 = (__pyx_v_index + 1);
4241                               *((char *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_maximum;
4242                           }
4243                       }
4244                   }
4245               }
4246           }
4247           #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
4248               #undef likely
4249               #undef unlikely
4250               #define likely(x)   __builtin_expect(!!(x), 1)
4251               #define unlikely(x) __builtin_expect(!!(x), 0)
4252           #endif
4253         }
4254 
4255         /* "urh/cythonext/path_creator.pyx":45
4256  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
4257  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
4258  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
4259  *             chunk_end = i + samples_per_pixel
4260  *             if chunk_end >= end:
4261  */
4262         /*finally:*/ {
4263           /*normal exit:*/{
4264             #ifdef WITH_THREAD
4265             __Pyx_FastGIL_Forget();
4266             Py_BLOCK_THREADS
4267             #endif
4268             goto __pyx_L7;
4269           }
4270           __pyx_L7:;
4271         }
4272     }
4273 
4274     /* "urh/cythonext/path_creator.pyx":65
4275  *             values[index + 1] = maximum
4276  *
4277  *         x = np.repeat(sample_rng, 2)             # <<<<<<<<<<<<<<
4278  *     else:
4279  *         x = np.arange(start, end, dtype=np.int64)
4280  */
4281     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
4282     __Pyx_GOTREF(__pyx_t_3);
4283     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_repeat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
4284     __Pyx_GOTREF(__pyx_t_7);
4285     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4286     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sample_rng, 1, (PyObject *(*)(char *)) __pyx_memview_get_PY_LONG_LONG, (int (*)(char *, PyObject *)) __pyx_memview_set_PY_LONG_LONG, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
4287     __Pyx_GOTREF(__pyx_t_3);
4288     __pyx_t_2 = NULL;
4289     __pyx_t_19 = 0;
4290     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4291       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
4292       if (likely(__pyx_t_2)) {
4293         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4294         __Pyx_INCREF(__pyx_t_2);
4295         __Pyx_INCREF(function);
4296         __Pyx_DECREF_SET(__pyx_t_7, function);
4297         __pyx_t_19 = 1;
4298       }
4299     }
4300     #if CYTHON_FAST_PYCALL
4301     if (PyFunction_Check(__pyx_t_7)) {
4302       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
4303       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
4304       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4305       __Pyx_GOTREF(__pyx_t_1);
4306       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4307     } else
4308     #endif
4309     #if CYTHON_FAST_PYCCALL
4310     if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
4311       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
4312       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
4313       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4314       __Pyx_GOTREF(__pyx_t_1);
4315       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4316     } else
4317     #endif
4318     {
4319       __pyx_t_5 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
4320       __Pyx_GOTREF(__pyx_t_5);
4321       if (__pyx_t_2) {
4322         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
4323       }
4324       __Pyx_GIVEREF(__pyx_t_3);
4325       PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_19, __pyx_t_3);
4326       __Pyx_INCREF(__pyx_int_2);
4327       __Pyx_GIVEREF(__pyx_int_2);
4328       PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_19, __pyx_int_2);
4329       __pyx_t_3 = 0;
4330       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
4331       __Pyx_GOTREF(__pyx_t_1);
4332       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4333     }
4334     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4335     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 65, __pyx_L1_error)
4336     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4337     __pyx_v_x = __pyx_t_20;
4338     __pyx_t_20.memview = NULL;
4339     __pyx_t_20.data = NULL;
4340 
4341     /* "urh/cythonext/path_creator.pyx":41
4342  *         num_threads = 1
4343  *
4344  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
4345  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
4346  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
4347  */
4348     goto __pyx_L4;
4349   }
4350 
4351   /* "urh/cythonext/path_creator.pyx":67
4352  *         x = np.repeat(sample_rng, 2)
4353  *     else:
4354  *         x = np.arange(start, end, dtype=np.int64)             # <<<<<<<<<<<<<<
4355  *         values = samples[start:end]
4356  *         scale_factor = 1.0
4357  */
4358   /*else*/ {
4359     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
4360     __Pyx_GOTREF(__pyx_t_1);
4361     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error)
4362     __Pyx_GOTREF(__pyx_t_7);
4363     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4364     __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
4365     __Pyx_GOTREF(__pyx_t_1);
4366     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
4367     __Pyx_GOTREF(__pyx_t_5);
4368     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
4369     __Pyx_GOTREF(__pyx_t_3);
4370     __Pyx_GIVEREF(__pyx_t_1);
4371     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4372     __Pyx_GIVEREF(__pyx_t_5);
4373     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
4374     __pyx_t_1 = 0;
4375     __pyx_t_5 = 0;
4376     __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
4377     __Pyx_GOTREF(__pyx_t_5);
4378     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
4379     __Pyx_GOTREF(__pyx_t_1);
4380     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
4381     __Pyx_GOTREF(__pyx_t_2);
4382     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4383     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
4384     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4385     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
4386     __Pyx_GOTREF(__pyx_t_2);
4387     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4388     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4389     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4390     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 67, __pyx_L1_error)
4391     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4392     __pyx_v_x = __pyx_t_20;
4393     __pyx_t_20.memview = NULL;
4394     __pyx_t_20.data = NULL;
4395 
4396     /* "urh/cythonext/path_creator.pyx":68
4397  *     else:
4398  *         x = np.arange(start, end, dtype=np.int64)
4399  *         values = samples[start:end]             # <<<<<<<<<<<<<<
4400  *         scale_factor = 1.0
4401  *
4402  */
4403     __pyx_t_10.data = __pyx_v_samples.data;
4404     __pyx_t_10.memview = __pyx_v_samples.memview;
4405     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
4406     __pyx_t_19 = -1;
4407     if (unlikely(__pyx_memoryview_slice_memviewslice(
4408     &__pyx_t_10,
4409     __pyx_v_samples.shape[0], __pyx_v_samples.strides[0], __pyx_v_samples.suboffsets[0],
4410     0,
4411     0,
4412     &__pyx_t_19,
4413     __pyx_v_start,
4414     __pyx_v_end,
4415     0,
4416     1,
4417     1,
4418     0,
4419     1) < 0))
4420 {
4421     __PYX_ERR(0, 68, __pyx_L1_error)
4422 }
4423 
4424 __pyx_v_values = __pyx_t_10;
4425     __pyx_t_10.memview = NULL;
4426     __pyx_t_10.data = NULL;
4427 
4428     /* "urh/cythonext/path_creator.pyx":69
4429  *         x = np.arange(start, end, dtype=np.int64)
4430  *         values = samples[start:end]
4431  *         scale_factor = 1.0             # <<<<<<<<<<<<<<
4432  *
4433  *     cdef list result = []
4434  */
4435     __pyx_v_scale_factor = 1.0;
4436   }
4437   __pyx_L4:;
4438 
4439   /* "urh/cythonext/path_creator.pyx":71
4440  *         scale_factor = 1.0
4441  *
4442  *     cdef list result = []             # <<<<<<<<<<<<<<
4443  *     if scale_factor == 0:
4444  *         scale_factor = 1  # prevent division by zero
4445  */
4446   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
4447   __Pyx_GOTREF(__pyx_t_2);
4448   __pyx_v_result = ((PyObject*)__pyx_t_2);
4449   __pyx_t_2 = 0;
4450 
4451   /* "urh/cythonext/path_creator.pyx":72
4452  *
4453  *     cdef list result = []
4454  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
4455  *         scale_factor = 1  # prevent division by zero
4456  *
4457  */
4458   __pyx_t_4 = ((__pyx_v_scale_factor == 0.0) != 0);
4459   if (__pyx_t_4) {
4460 
4461     /* "urh/cythonext/path_creator.pyx":73
4462  *     cdef list result = []
4463  *     if scale_factor == 0:
4464  *         scale_factor = 1  # prevent division by zero             # <<<<<<<<<<<<<<
4465  *
4466  *     for subpath_range in subpath_ranges:
4467  */
4468     __pyx_v_scale_factor = 1.0;
4469 
4470     /* "urh/cythonext/path_creator.pyx":72
4471  *
4472  *     cdef list result = []
4473  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
4474  *         scale_factor = 1  # prevent division by zero
4475  *
4476  */
4477   }
4478 
4479   /* "urh/cythonext/path_creator.pyx":75
4480  *         scale_factor = 1  # prevent division by zero
4481  *
4482  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
4483  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
4484  *         sub_start =int(max(0, math.floor(sub_start)))
4485  */
4486   if (unlikely(__pyx_v_subpath_ranges == Py_None)) {
4487     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
4488     __PYX_ERR(0, 75, __pyx_L1_error)
4489   }
4490   __pyx_t_2 = __pyx_v_subpath_ranges; __Pyx_INCREF(__pyx_t_2); __pyx_t_21 = 0;
4491   for (;;) {
4492     if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_2)) break;
4493     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4494     __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_21); __Pyx_INCREF(__pyx_t_5); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error)
4495     #else
4496     __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
4497     __Pyx_GOTREF(__pyx_t_5);
4498     #endif
4499     __Pyx_XDECREF_SET(__pyx_v_subpath_range, __pyx_t_5);
4500     __pyx_t_5 = 0;
4501 
4502     /* "urh/cythonext/path_creator.pyx":76
4503  *
4504  *     for subpath_range in subpath_ranges:
4505  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
4506  *         sub_start =int(max(0, math.floor(sub_start)))
4507  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
4508  */
4509     __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_subpath_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
4510     __Pyx_GOTREF(__pyx_t_5);
4511     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
4512     __Pyx_GOTREF(__pyx_t_3);
4513     __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
4514     __Pyx_GOTREF(__pyx_t_7);
4515     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4516     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4517     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
4518     __Pyx_GOTREF(__pyx_t_3);
4519     __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
4520     __Pyx_GOTREF(__pyx_t_5);
4521     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4522     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4523     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
4524     __Pyx_GOTREF(__pyx_t_3);
4525     __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
4526     __Pyx_GOTREF(__pyx_t_7);
4527     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4528     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4529     __pyx_t_3 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
4530     __Pyx_GOTREF(__pyx_t_3);
4531     __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
4532     __Pyx_GOTREF(__pyx_t_5);
4533     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4534     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4535     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
4536     __Pyx_GOTREF(__pyx_t_3);
4537     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
4538     __Pyx_GOTREF(__pyx_t_7);
4539     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4540     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4541     __Pyx_XDECREF_SET(__pyx_v_sub_start, __pyx_t_7);
4542     __pyx_t_7 = 0;
4543 
4544     /* "urh/cythonext/path_creator.pyx":77
4545  *     for subpath_range in subpath_ranges:
4546  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
4547  *         sub_start =int(max(0, math.floor(sub_start)))             # <<<<<<<<<<<<<<
4548  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
4549  *         sub_end = int(max(0, math.ceil(sub_end)))
4550  */
4551     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
4552     __Pyx_GOTREF(__pyx_t_3);
4553     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
4554     __Pyx_GOTREF(__pyx_t_5);
4555     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4556     __pyx_t_3 = NULL;
4557     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4558       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
4559       if (likely(__pyx_t_3)) {
4560         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4561         __Pyx_INCREF(__pyx_t_3);
4562         __Pyx_INCREF(function);
4563         __Pyx_DECREF_SET(__pyx_t_5, function);
4564       }
4565     }
4566     __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_sub_start) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_sub_start);
4567     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4568     if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
4569     __Pyx_GOTREF(__pyx_t_7);
4570     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4571     __pyx_t_22 = 0;
4572     __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
4573     __Pyx_GOTREF(__pyx_t_3);
4574     __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
4575     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4576     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 77, __pyx_L1_error)
4577     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4578     if (__pyx_t_4) {
4579       __Pyx_INCREF(__pyx_t_7);
4580       __pyx_t_5 = __pyx_t_7;
4581     } else {
4582       __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
4583       __Pyx_GOTREF(__pyx_t_1);
4584       __pyx_t_5 = __pyx_t_1;
4585       __pyx_t_1 = 0;
4586     }
4587     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4588     __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
4589     __Pyx_GOTREF(__pyx_t_7);
4590     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4591     __Pyx_DECREF_SET(__pyx_v_sub_start, __pyx_t_7);
4592     __pyx_t_7 = 0;
4593 
4594     /* "urh/cythonext/path_creator.pyx":78
4595  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
4596  *         sub_start =int(max(0, math.floor(sub_start)))
4597  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
4598  *         sub_end = int(max(0, math.ceil(sub_end)))
4599  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
4600  */
4601     __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_subpath_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
4602     __Pyx_GOTREF(__pyx_t_7);
4603     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
4604     __Pyx_GOTREF(__pyx_t_5);
4605     __pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
4606     __Pyx_GOTREF(__pyx_t_1);
4607     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4608     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4609     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
4610     __Pyx_GOTREF(__pyx_t_5);
4611     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
4612     __Pyx_GOTREF(__pyx_t_7);
4613     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4614     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4615     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
4616     __Pyx_GOTREF(__pyx_t_5);
4617     __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
4618     __Pyx_GOTREF(__pyx_t_1);
4619     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4620     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4621     __pyx_t_5 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
4622     __Pyx_GOTREF(__pyx_t_5);
4623     __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
4624     __Pyx_GOTREF(__pyx_t_7);
4625     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4626     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4627     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
4628     __Pyx_GOTREF(__pyx_t_5);
4629     __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
4630     __Pyx_GOTREF(__pyx_t_1);
4631     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4632     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4633     __Pyx_XDECREF_SET(__pyx_v_sub_end, __pyx_t_1);
4634     __pyx_t_1 = 0;
4635 
4636     /* "urh/cythonext/path_creator.pyx":79
4637  *         sub_start =int(max(0, math.floor(sub_start)))
4638  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
4639  *         sub_end = int(max(0, math.ceil(sub_end)))             # <<<<<<<<<<<<<<
4640  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
4641  *
4642  */
4643     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
4644     __Pyx_GOTREF(__pyx_t_5);
4645     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ceil); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
4646     __Pyx_GOTREF(__pyx_t_7);
4647     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4648     __pyx_t_5 = NULL;
4649     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4650       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
4651       if (likely(__pyx_t_5)) {
4652         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4653         __Pyx_INCREF(__pyx_t_5);
4654         __Pyx_INCREF(function);
4655         __Pyx_DECREF_SET(__pyx_t_7, function);
4656       }
4657     }
4658     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_sub_end) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_sub_end);
4659     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4660     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
4661     __Pyx_GOTREF(__pyx_t_1);
4662     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4663     __pyx_t_22 = 0;
4664     __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
4665     __Pyx_GOTREF(__pyx_t_5);
4666     __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
4667     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4668     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
4669     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4670     if (__pyx_t_4) {
4671       __Pyx_INCREF(__pyx_t_1);
4672       __pyx_t_7 = __pyx_t_1;
4673     } else {
4674       __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
4675       __Pyx_GOTREF(__pyx_t_3);
4676       __pyx_t_7 = __pyx_t_3;
4677       __pyx_t_3 = 0;
4678     }
4679     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4680     __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
4681     __Pyx_GOTREF(__pyx_t_1);
4682     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4683     __Pyx_DECREF_SET(__pyx_v_sub_end, __pyx_t_1);
4684     __pyx_t_1 = 0;
4685 
4686     /* "urh/cythonext/path_creator.pyx":80
4687  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
4688  *         sub_end = int(max(0, math.ceil(sub_end)))
4689  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))             # <<<<<<<<<<<<<<
4690  *
4691  *     return result
4692  */
4693     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
4694     __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
4695     __pyx_t_20.data = __pyx_v_x.data;
4696     __pyx_t_20.memview = __pyx_v_x.memview;
4697     __PYX_INC_MEMVIEW(&__pyx_t_20, 0);
4698     __pyx_t_19 = -1;
4699     if (unlikely(__pyx_memoryview_slice_memviewslice(
4700     &__pyx_t_20,
4701     __pyx_v_x.shape[0], __pyx_v_x.strides[0], __pyx_v_x.suboffsets[0],
4702     0,
4703     0,
4704     &__pyx_t_19,
4705     __pyx_t_23,
4706     __pyx_t_24,
4707     0,
4708     1,
4709     1,
4710     0,
4711     1) < 0))
4712 {
4713     __PYX_ERR(0, 80, __pyx_L1_error)
4714 }
4715 
4716 __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
4717     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
4718     __pyx_t_10.data = __pyx_v_values.data;
4719     __pyx_t_10.memview = __pyx_v_values.memview;
4720     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
4721     __pyx_t_19 = -1;
4722     if (unlikely(__pyx_memoryview_slice_memviewslice(
4723     &__pyx_t_10,
4724     __pyx_v_values.shape[0], __pyx_v_values.strides[0], __pyx_v_values.suboffsets[0],
4725     0,
4726     0,
4727     &__pyx_t_19,
4728     __pyx_t_24,
4729     __pyx_t_23,
4730     0,
4731     1,
4732     1,
4733     0,
4734     1) < 0))
4735 {
4736     __PYX_ERR(0, 80, __pyx_L1_error)
4737 }
4738 
4739 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_10, 1, (PyObject *(*)(char *)) __pyx_memview_get_char, (int (*)(char *, PyObject *)) __pyx_memview_set_char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
4740     __Pyx_GOTREF(__pyx_t_1);
4741     __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
4742     __pyx_t_10.memview = NULL;
4743     __pyx_t_10.data = NULL;
4744     __pyx_t_7 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_20, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
4745     __Pyx_GOTREF(__pyx_t_7);
4746     __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4747     __pyx_t_20.memview = NULL;
4748     __pyx_t_20.data = NULL;
4749     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4750     __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error)
4751     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4752 
4753     /* "urh/cythonext/path_creator.pyx":75
4754  *         scale_factor = 1  # prevent division by zero
4755  *
4756  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
4757  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
4758  *         sub_start =int(max(0, math.floor(sub_start)))
4759  */
4760   }
4761   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4762 
4763   /* "urh/cythonext/path_creator.pyx":82
4764  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
4765  *
4766  *     return result             # <<<<<<<<<<<<<<
4767  *
4768  *
4769  */
4770   __Pyx_XDECREF(__pyx_r);
4771   __Pyx_INCREF(__pyx_v_result);
4772   __pyx_r = __pyx_v_result;
4773   goto __pyx_L0;
4774 
4775   /* "urh/cythonext/path_creator.pyx":19
4776  * import struct
4777  *
4778  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
4779  *     cdef iq[:] values
4780  *     cdef long long[::1] sample_rng
4781  */
4782 
4783   /* function exit code */
4784   __pyx_L1_error:;
4785   __Pyx_XDECREF(__pyx_t_1);
4786   __Pyx_XDECREF(__pyx_t_2);
4787   __Pyx_XDECREF(__pyx_t_3);
4788   __Pyx_XDECREF(__pyx_t_5);
4789   __Pyx_XDECREF(__pyx_t_7);
4790   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4791   __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
4792   __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4793   __Pyx_AddTraceback("urh.cythonext.path_creator.create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
4794   __pyx_r = 0;
4795   __pyx_L0:;
4796   __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
4797   __PYX_XDEC_MEMVIEW(&__pyx_v_sample_rng, 1);
4798   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
4799   __Pyx_XDECREF(__pyx_v_type_lookup);
4800   __Pyx_XDECREF(__pyx_v_result);
4801   __Pyx_XDECREF(__pyx_v_subpath_range);
4802   __Pyx_XDECREF(__pyx_v_sub_start);
4803   __Pyx_XDECREF(__pyx_v_sub_end);
4804   __Pyx_XDECREF(__pyx_v_subpath_ranges);
4805   __Pyx_XGIVEREF(__pyx_r);
4806   __Pyx_RefNannyFinishContext();
4807   return __pyx_r;
4808 }
4809 
4810 /* Python wrapper */
4811 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_7__pyx_fuse_0create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4812 static PyMethodDef __pyx_fuse_0__pyx_mdef_3urh_9cythonext_12path_creator_7__pyx_fuse_0create_path = {"__pyx_fuse_0create_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_7__pyx_fuse_0create_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_7__pyx_fuse_0create_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4813 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_7__pyx_fuse_0create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4814   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
4815   PY_LONG_LONG __pyx_v_start;
4816   PY_LONG_LONG __pyx_v_end;
4817   PyObject *__pyx_v_subpath_ranges = 0;
4818   int __pyx_lineno = 0;
4819   const char *__pyx_filename = NULL;
4820   int __pyx_clineno = 0;
4821   PyObject *__pyx_r = 0;
4822   __Pyx_RefNannyDeclarations
4823   __Pyx_RefNannySetupContext("__pyx_fuse_0create_path (wrapper)", 0);
4824   {
4825     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_subpath_ranges,0};
4826     PyObject* values[4] = {0,0,0,0};
4827     values[3] = __pyx_k__6;
4828     if (unlikely(__pyx_kwds)) {
4829       Py_ssize_t kw_args;
4830       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4831       switch (pos_args) {
4832         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4833         CYTHON_FALLTHROUGH;
4834         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4835         CYTHON_FALLTHROUGH;
4836         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4837         CYTHON_FALLTHROUGH;
4838         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4839         CYTHON_FALLTHROUGH;
4840         case  0: break;
4841         default: goto __pyx_L5_argtuple_error;
4842       }
4843       kw_args = PyDict_Size(__pyx_kwds);
4844       switch (pos_args) {
4845         case  0:
4846         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
4847         else goto __pyx_L5_argtuple_error;
4848         CYTHON_FALLTHROUGH;
4849         case  1:
4850         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
4851         else {
4852           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0create_path", 0, 3, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
4853         }
4854         CYTHON_FALLTHROUGH;
4855         case  2:
4856         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
4857         else {
4858           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0create_path", 0, 3, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
4859         }
4860         CYTHON_FALLTHROUGH;
4861         case  3:
4862         if (kw_args > 0) {
4863           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subpath_ranges);
4864           if (value) { values[3] = value; kw_args--; }
4865         }
4866       }
4867       if (unlikely(kw_args > 0)) {
4868         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0create_path") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
4869       }
4870     } else {
4871       switch (PyTuple_GET_SIZE(__pyx_args)) {
4872         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4873         CYTHON_FALLTHROUGH;
4874         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4875         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4876         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4877         break;
4878         default: goto __pyx_L5_argtuple_error;
4879       }
4880     }
4881     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_char(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 19, __pyx_L3_error)
4882     __pyx_v_start = __Pyx_PyInt_As_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_start == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
4883     __pyx_v_end = __Pyx_PyInt_As_PY_LONG_LONG(values[2]); if (unlikely((__pyx_v_end == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
4884     __pyx_v_subpath_ranges = ((PyObject*)values[3]);
4885   }
4886   goto __pyx_L4_argument_unpacking_done;
4887   __pyx_L5_argtuple_error:;
4888   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0create_path", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
4889   __pyx_L3_error:;
4890   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_0create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
4891   __Pyx_RefNannyFinishContext();
4892   return NULL;
4893   __pyx_L4_argument_unpacking_done:;
4894   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subpath_ranges), (&PyList_Type), 1, "subpath_ranges", 1))) __PYX_ERR(0, 19, __pyx_L1_error)
4895   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_6__pyx_fuse_0create_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end, __pyx_v_subpath_ranges);
4896 
4897   /* function exit code */
4898   goto __pyx_L0;
4899   __pyx_L1_error:;
4900   __pyx_r = NULL;
4901   __pyx_L0:;
4902   __Pyx_RefNannyFinishContext();
4903   return __pyx_r;
4904 }
4905 
__pyx_pf_3urh_9cythonext_12path_creator_6__pyx_fuse_0create_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,PyObject * __pyx_v_subpath_ranges)4906 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_6__pyx_fuse_0create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges) {
4907   PyObject *__pyx_r = NULL;
4908   __Pyx_RefNannyDeclarations
4909   PyObject *__pyx_t_1 = NULL;
4910   struct __pyx_fuse_0__pyx_opt_args_3urh_9cythonext_12path_creator_create_path __pyx_t_2;
4911   int __pyx_lineno = 0;
4912   const char *__pyx_filename = NULL;
4913   int __pyx_clineno = 0;
4914   __Pyx_RefNannySetupContext("__pyx_fuse_0create_path", 0);
4915   __Pyx_XDECREF(__pyx_r);
4916   __pyx_t_2.__pyx_n = 1;
4917   __pyx_t_2.subpath_ranges = __pyx_v_subpath_ranges;
4918   __pyx_t_1 = __pyx_fuse_0__pyx_f_3urh_9cythonext_12path_creator_create_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
4919   __Pyx_GOTREF(__pyx_t_1);
4920   __pyx_r = __pyx_t_1;
4921   __pyx_t_1 = 0;
4922   goto __pyx_L0;
4923 
4924   /* function exit code */
4925   __pyx_L1_error:;
4926   __Pyx_XDECREF(__pyx_t_1);
4927   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_0create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
4928   __pyx_r = NULL;
4929   __pyx_L0:;
4930   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
4931   __Pyx_XGIVEREF(__pyx_r);
4932   __Pyx_RefNannyFinishContext();
4933   return __pyx_r;
4934 }
4935 
4936 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_9__pyx_fuse_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4937 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_1__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_fuse_1__pyx_opt_args_3urh_9cythonext_12path_creator_create_path * __pyx_optional_args)4938 static PyObject *__pyx_fuse_1__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_fuse_1__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args) {
4939   PyObject *__pyx_v_subpath_ranges = __pyx_k__7;
4940   __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
4941   __Pyx_memviewslice __pyx_v_sample_rng = { 0, 0, { 0 }, { 0 }, { 0 } };
4942   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
4943   unsigned char __pyx_v_sample;
4944   unsigned char __pyx_v_minimum;
4945   unsigned char __pyx_v_maximum;
4946   unsigned char __pyx_v_tmp;
4947   float __pyx_v_scale_factor;
4948   PY_LONG_LONG __pyx_v_i;
4949   PY_LONG_LONG __pyx_v_j;
4950   PY_LONG_LONG __pyx_v_index;
4951   PY_LONG_LONG __pyx_v_chunk_end;
4952   PY_LONG_LONG __pyx_v_num_samples;
4953   PY_LONG_LONG __pyx_v_pixels_on_path;
4954   PY_LONG_LONG __pyx_v_samples_per_pixel;
4955   PyObject *__pyx_v_type_lookup = 0;
4956   CYTHON_UNUSED int __pyx_v_num_threads;
4957   PyObject *__pyx_v_result = 0;
4958   PyObject *__pyx_v_subpath_range = NULL;
4959   PyObject *__pyx_v_sub_start = NULL;
4960   PyObject *__pyx_v_sub_end = NULL;
4961   PyObject *__pyx_r = NULL;
4962   __Pyx_RefNannyDeclarations
4963   PyObject *__pyx_t_1 = NULL;
4964   PyObject *__pyx_t_2 = NULL;
4965   PyObject *__pyx_t_3 = NULL;
4966   int __pyx_t_4;
4967   PyObject *__pyx_t_5 = NULL;
4968   PY_LONG_LONG __pyx_t_6;
4969   PyObject *__pyx_t_7 = NULL;
4970   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4971   size_t __pyx_t_9;
4972   __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
4973   PY_LONG_LONG __pyx_t_11;
4974   PY_LONG_LONG __pyx_t_12;
4975   PY_LONG_LONG __pyx_t_13;
4976   PY_LONG_LONG __pyx_t_14;
4977   PY_LONG_LONG __pyx_t_15;
4978   PY_LONG_LONG __pyx_t_16;
4979   PY_LONG_LONG __pyx_t_17;
4980   PY_LONG_LONG __pyx_t_18;
4981   int __pyx_t_19;
4982   __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
4983   Py_ssize_t __pyx_t_21;
4984   long __pyx_t_22;
4985   Py_ssize_t __pyx_t_23;
4986   Py_ssize_t __pyx_t_24;
4987   int __pyx_t_25;
4988   int __pyx_lineno = 0;
4989   const char *__pyx_filename = NULL;
4990   int __pyx_clineno = 0;
4991   __Pyx_RefNannySetupContext("__pyx_fuse_1create_path", 0);
4992   if (__pyx_optional_args) {
4993     if (__pyx_optional_args->__pyx_n > 0) {
4994       __pyx_v_subpath_ranges = __pyx_optional_args->subpath_ranges;
4995     }
4996   }
4997   __Pyx_INCREF(__pyx_v_subpath_ranges);
4998 
4999   /* "urh/cythonext/path_creator.pyx":26
5000  *     cdef float scale_factor
5001  *     cdef long long i,j,index, chunk_end, num_samples, pixels_on_path, samples_per_pixel
5002  *     num_samples = end - start             # <<<<<<<<<<<<<<
5003  *
5004  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
5005  */
5006   __pyx_v_num_samples = (__pyx_v_end - __pyx_v_start);
5007 
5008   /* "urh/cythonext/path_creator.pyx":28
5009  *     num_samples = end - start
5010  *
5011  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,             # <<<<<<<<<<<<<<
5012  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
5013  *                              "float[:]": np.float32, "double[:]": np.float64}
5014  */
5015   __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
5016   __Pyx_GOTREF(__pyx_t_1);
5017   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
5018   __Pyx_GOTREF(__pyx_t_2);
5019   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
5020   __Pyx_GOTREF(__pyx_t_3);
5021   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5022   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_char_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
5023   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5024   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
5025   __Pyx_GOTREF(__pyx_t_3);
5026   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
5027   __Pyx_GOTREF(__pyx_t_2);
5028   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5029   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_char_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
5030   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5031 
5032   /* "urh/cythonext/path_creator.pyx":29
5033  *
5034  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
5035  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,             # <<<<<<<<<<<<<<
5036  *                              "float[:]": np.float32, "double[:]": np.float64}
5037  *
5038  */
5039   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
5040   __Pyx_GOTREF(__pyx_t_2);
5041   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
5042   __Pyx_GOTREF(__pyx_t_3);
5043   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5044   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_short_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
5045   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5046   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
5047   __Pyx_GOTREF(__pyx_t_3);
5048   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
5049   __Pyx_GOTREF(__pyx_t_2);
5050   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5051   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_short_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
5052   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5053 
5054   /* "urh/cythonext/path_creator.pyx":30
5055  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
5056  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
5057  *                              "float[:]": np.float32, "double[:]": np.float64}             # <<<<<<<<<<<<<<
5058  *
5059  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
5060  */
5061   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
5062   __Pyx_GOTREF(__pyx_t_2);
5063   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
5064   __Pyx_GOTREF(__pyx_t_3);
5065   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5066   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_float_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
5067   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5068   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
5069   __Pyx_GOTREF(__pyx_t_3);
5070   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
5071   __Pyx_GOTREF(__pyx_t_2);
5072   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5073   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_double, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
5074   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5075   __pyx_v_type_lookup = ((PyObject*)__pyx_t_1);
5076   __pyx_t_1 = 0;
5077 
5078   /* "urh/cythonext/path_creator.pyx":32
5079  *                              "float[:]": np.float32, "double[:]": np.float64}
5080  *
5081  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges             # <<<<<<<<<<<<<<
5082  *     pixels_on_path = settings.PIXELS_PER_PATH
5083  *
5084  */
5085   __pyx_t_4 = (__pyx_v_subpath_ranges == ((PyObject*)Py_None));
5086   if ((__pyx_t_4 != 0)) {
5087     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
5088     __Pyx_GOTREF(__pyx_t_2);
5089     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
5090     __Pyx_GOTREF(__pyx_t_3);
5091     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error)
5092     __Pyx_GOTREF(__pyx_t_5);
5093     __Pyx_GIVEREF(__pyx_t_2);
5094     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
5095     __Pyx_GIVEREF(__pyx_t_3);
5096     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
5097     __pyx_t_2 = 0;
5098     __pyx_t_3 = 0;
5099     __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
5100     __Pyx_GOTREF(__pyx_t_3);
5101     __Pyx_GIVEREF(__pyx_t_5);
5102     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
5103     __pyx_t_5 = 0;
5104     __pyx_t_1 = __pyx_t_3;
5105     __pyx_t_3 = 0;
5106   } else {
5107     __Pyx_INCREF(__pyx_v_subpath_ranges);
5108     __pyx_t_1 = __pyx_v_subpath_ranges;
5109   }
5110   __Pyx_DECREF_SET(__pyx_v_subpath_ranges, ((PyObject*)__pyx_t_1));
5111   __pyx_t_1 = 0;
5112 
5113   /* "urh/cythonext/path_creator.pyx":33
5114  *
5115  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
5116  *     pixels_on_path = settings.PIXELS_PER_PATH             # <<<<<<<<<<<<<<
5117  *
5118  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
5119  */
5120   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
5121   __Pyx_GOTREF(__pyx_t_1);
5122   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PIXELS_PER_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
5123   __Pyx_GOTREF(__pyx_t_3);
5124   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5125   __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error)
5126   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5127   __pyx_v_pixels_on_path = __pyx_t_6;
5128 
5129   /* "urh/cythonext/path_creator.pyx":35
5130  *     pixels_on_path = settings.PIXELS_PER_PATH
5131  *
5132  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)             # <<<<<<<<<<<<<<
5133  *
5134  *     cdef int num_threads = 0
5135  */
5136   __pyx_v_samples_per_pixel = ((PY_LONG_LONG)(__pyx_v_num_samples / __pyx_v_pixels_on_path));
5137 
5138   /* "urh/cythonext/path_creator.pyx":37
5139  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
5140  *
5141  *     cdef int num_threads = 0             # <<<<<<<<<<<<<<
5142  *     if samples_per_pixel < 20000:
5143  *         num_threads = 1
5144  */
5145   __pyx_v_num_threads = 0;
5146 
5147   /* "urh/cythonext/path_creator.pyx":38
5148  *
5149  *     cdef int num_threads = 0
5150  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
5151  *         num_threads = 1
5152  *
5153  */
5154   __pyx_t_4 = ((__pyx_v_samples_per_pixel < 0x4E20) != 0);
5155   if (__pyx_t_4) {
5156 
5157     /* "urh/cythonext/path_creator.pyx":39
5158  *     cdef int num_threads = 0
5159  *     if samples_per_pixel < 20000:
5160  *         num_threads = 1             # <<<<<<<<<<<<<<
5161  *
5162  *     if samples_per_pixel > 1:
5163  */
5164     __pyx_v_num_threads = 1;
5165 
5166     /* "urh/cythonext/path_creator.pyx":38
5167  *
5168  *     cdef int num_threads = 0
5169  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
5170  *         num_threads = 1
5171  *
5172  */
5173   }
5174 
5175   /* "urh/cythonext/path_creator.pyx":41
5176  *         num_threads = 1
5177  *
5178  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
5179  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
5180  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
5181  */
5182   __pyx_t_4 = ((__pyx_v_samples_per_pixel > 1) != 0);
5183   if (__pyx_t_4) {
5184 
5185     /* "urh/cythonext/path_creator.pyx":42
5186  *
5187  *     if samples_per_pixel > 1:
5188  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)             # <<<<<<<<<<<<<<
5189  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
5190  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
5191  */
5192     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
5193     __Pyx_GOTREF(__pyx_t_3);
5194     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
5195     __Pyx_GOTREF(__pyx_t_1);
5196     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5197     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
5198     __Pyx_GOTREF(__pyx_t_3);
5199     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
5200     __Pyx_GOTREF(__pyx_t_5);
5201     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_samples_per_pixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
5202     __Pyx_GOTREF(__pyx_t_2);
5203     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
5204     __Pyx_GOTREF(__pyx_t_7);
5205     __Pyx_GIVEREF(__pyx_t_3);
5206     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
5207     __Pyx_GIVEREF(__pyx_t_5);
5208     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
5209     __Pyx_GIVEREF(__pyx_t_2);
5210     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
5211     __pyx_t_3 = 0;
5212     __pyx_t_5 = 0;
5213     __pyx_t_2 = 0;
5214     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
5215     __Pyx_GOTREF(__pyx_t_2);
5216     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
5217     __Pyx_GOTREF(__pyx_t_5);
5218     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
5219     __Pyx_GOTREF(__pyx_t_3);
5220     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5221     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
5222     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5223     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
5224     __Pyx_GOTREF(__pyx_t_3);
5225     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5226     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5227     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5228     __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 42, __pyx_L1_error)
5229     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5230     __pyx_v_sample_rng = __pyx_t_8;
5231     __pyx_t_8.memview = NULL;
5232     __pyx_t_8.data = NULL;
5233 
5234     /* "urh/cythonext/path_creator.pyx":43
5235  *     if samples_per_pixel > 1:
5236  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
5237  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")             # <<<<<<<<<<<<<<
5238  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
5239  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
5240  */
5241     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
5242     __Pyx_GOTREF(__pyx_t_3);
5243     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
5244     __Pyx_GOTREF(__pyx_t_2);
5245     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5246     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
5247     __pyx_t_3 = PyInt_FromSsize_t((2 * __pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
5248     __Pyx_GOTREF(__pyx_t_3);
5249     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
5250     __Pyx_GOTREF(__pyx_t_7);
5251     __Pyx_GIVEREF(__pyx_t_3);
5252     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
5253     __pyx_t_3 = 0;
5254     __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
5255     __Pyx_GOTREF(__pyx_t_3);
5256     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_type_lookup, __pyx_kp_s_unsigned_char_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
5257     __Pyx_GOTREF(__pyx_t_1);
5258     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
5259     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5260     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
5261     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
5262     __Pyx_GOTREF(__pyx_t_1);
5263     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5264     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5265     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5266     __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 43, __pyx_L1_error)
5267     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5268     __pyx_v_values = __pyx_t_10;
5269     __pyx_t_10.memview = NULL;
5270     __pyx_t_10.data = NULL;
5271 
5272     /* "urh/cythonext/path_creator.pyx":44
5273  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
5274  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
5275  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!             # <<<<<<<<<<<<<<
5276  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
5277  *             chunk_end = i + samples_per_pixel
5278  */
5279     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
5280     __pyx_v_scale_factor = (((double)__pyx_v_num_samples) / (2.0 * __pyx_t_9));
5281 
5282     /* "urh/cythonext/path_creator.pyx":45
5283  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
5284  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
5285  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
5286  *             chunk_end = i + samples_per_pixel
5287  *             if chunk_end >= end:
5288  */
5289     {
5290         #ifdef WITH_THREAD
5291         PyThreadState *_save;
5292         Py_UNBLOCK_THREADS
5293         __Pyx_FastGIL_Remember();
5294         #endif
5295         /*try:*/ {
5296           __pyx_t_6 = __pyx_v_start;
5297           __pyx_t_11 = __pyx_v_end;
5298           __pyx_t_12 = __pyx_v_samples_per_pixel;
5299           if ((__pyx_t_12 == 0)) abort();
5300           {
5301               #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
5302                   #undef likely
5303                   #undef unlikely
5304                   #define likely(x)   (x)
5305                   #define unlikely(x) (x)
5306               #endif
5307               __pyx_t_14 = (__pyx_t_11 - __pyx_t_6 + __pyx_t_12 - __pyx_t_12/abs(__pyx_t_12)) / __pyx_t_12;
5308               if (__pyx_t_14 > 0)
5309               {
5310                   #ifdef _OPENMP
5311                   #pragma omp parallel num_threads(__pyx_v_num_threads) private(__pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_4)
5312                   #endif /* _OPENMP */
5313                   {
5314                       #ifdef _OPENMP
5315                       #pragma omp for lastprivate(__pyx_v_chunk_end) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_index) lastprivate(__pyx_v_j) lastprivate(__pyx_v_maximum) lastprivate(__pyx_v_minimum) lastprivate(__pyx_v_sample) lastprivate(__pyx_v_tmp) schedule(static)
5316                       #endif /* _OPENMP */
5317                       for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13++){
5318                           {
5319                               __pyx_v_i = (PY_LONG_LONG)(__pyx_t_6 + __pyx_t_12 * __pyx_t_13);
5320                               /* Initialize private variables to invalid values */
5321                               __pyx_v_chunk_end = ((PY_LONG_LONG)0xbad0bad0);
5322                               __pyx_v_index = ((PY_LONG_LONG)0xbad0bad0);
5323                               __pyx_v_j = ((PY_LONG_LONG)0xbad0bad0);
5324                               __pyx_v_maximum = ((unsigned char)'?');
5325                               __pyx_v_minimum = ((unsigned char)'?');
5326                               __pyx_v_sample = ((unsigned char)'?');
5327                               __pyx_v_tmp = ((unsigned char)'?');
5328 
5329                               /* "urh/cythonext/path_creator.pyx":46
5330  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
5331  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
5332  *             chunk_end = i + samples_per_pixel             # <<<<<<<<<<<<<<
5333  *             if chunk_end >= end:
5334  *                 chunk_end = end
5335  */
5336                               __pyx_v_chunk_end = (__pyx_v_i + __pyx_v_samples_per_pixel);
5337 
5338                               /* "urh/cythonext/path_creator.pyx":47
5339  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
5340  *             chunk_end = i + samples_per_pixel
5341  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
5342  *                 chunk_end = end
5343  *
5344  */
5345                               __pyx_t_4 = ((__pyx_v_chunk_end >= __pyx_v_end) != 0);
5346                               if (__pyx_t_4) {
5347 
5348                                 /* "urh/cythonext/path_creator.pyx":48
5349  *             chunk_end = i + samples_per_pixel
5350  *             if chunk_end >= end:
5351  *                 chunk_end = end             # <<<<<<<<<<<<<<
5352  *
5353  *             tmp = samples[i]
5354  */
5355                                 __pyx_v_chunk_end = __pyx_v_end;
5356 
5357                                 /* "urh/cythonext/path_creator.pyx":47
5358  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
5359  *             chunk_end = i + samples_per_pixel
5360  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
5361  *                 chunk_end = end
5362  *
5363  */
5364                               }
5365 
5366                               /* "urh/cythonext/path_creator.pyx":50
5367  *                 chunk_end = end
5368  *
5369  *             tmp = samples[i]             # <<<<<<<<<<<<<<
5370  *             minimum = tmp
5371  *             maximum = tmp
5372  */
5373                               __pyx_t_15 = __pyx_v_i;
5374                               __pyx_v_tmp = (*((unsigned char *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_15 * __pyx_v_samples.strides[0]) )));
5375 
5376                               /* "urh/cythonext/path_creator.pyx":51
5377  *
5378  *             tmp = samples[i]
5379  *             minimum = tmp             # <<<<<<<<<<<<<<
5380  *             maximum = tmp
5381  *
5382  */
5383                               __pyx_v_minimum = __pyx_v_tmp;
5384 
5385                               /* "urh/cythonext/path_creator.pyx":52
5386  *             tmp = samples[i]
5387  *             minimum = tmp
5388  *             maximum = tmp             # <<<<<<<<<<<<<<
5389  *
5390  *             for j in range(i + 1, chunk_end):
5391  */
5392                               __pyx_v_maximum = __pyx_v_tmp;
5393 
5394                               /* "urh/cythonext/path_creator.pyx":54
5395  *             maximum = tmp
5396  *
5397  *             for j in range(i + 1, chunk_end):             # <<<<<<<<<<<<<<
5398  *                 sample = samples[j]
5399  *                 if sample < minimum:
5400  */
5401                               __pyx_t_15 = __pyx_v_chunk_end;
5402                               __pyx_t_16 = __pyx_t_15;
5403                               for (__pyx_t_17 = (__pyx_v_i + 1); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
5404                                 __pyx_v_j = __pyx_t_17;
5405 
5406                                 /* "urh/cythonext/path_creator.pyx":55
5407  *
5408  *             for j in range(i + 1, chunk_end):
5409  *                 sample = samples[j]             # <<<<<<<<<<<<<<
5410  *                 if sample < minimum:
5411  *                     minimum = sample
5412  */
5413                                 __pyx_t_18 = __pyx_v_j;
5414                                 __pyx_v_sample = (*((unsigned char *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )));
5415 
5416                                 /* "urh/cythonext/path_creator.pyx":56
5417  *             for j in range(i + 1, chunk_end):
5418  *                 sample = samples[j]
5419  *                 if sample < minimum:             # <<<<<<<<<<<<<<
5420  *                     minimum = sample
5421  *                 elif sample > maximum:
5422  */
5423                                 __pyx_t_4 = ((__pyx_v_sample < __pyx_v_minimum) != 0);
5424                                 if (__pyx_t_4) {
5425 
5426                                   /* "urh/cythonext/path_creator.pyx":57
5427  *                 sample = samples[j]
5428  *                 if sample < minimum:
5429  *                     minimum = sample             # <<<<<<<<<<<<<<
5430  *                 elif sample > maximum:
5431  *                     maximum = sample
5432  */
5433                                   __pyx_v_minimum = __pyx_v_sample;
5434 
5435                                   /* "urh/cythonext/path_creator.pyx":56
5436  *             for j in range(i + 1, chunk_end):
5437  *                 sample = samples[j]
5438  *                 if sample < minimum:             # <<<<<<<<<<<<<<
5439  *                     minimum = sample
5440  *                 elif sample > maximum:
5441  */
5442                                   goto __pyx_L15;
5443                                 }
5444 
5445                                 /* "urh/cythonext/path_creator.pyx":58
5446  *                 if sample < minimum:
5447  *                     minimum = sample
5448  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
5449  *                     maximum = sample
5450  *
5451  */
5452                                 __pyx_t_4 = ((__pyx_v_sample > __pyx_v_maximum) != 0);
5453                                 if (__pyx_t_4) {
5454 
5455                                   /* "urh/cythonext/path_creator.pyx":59
5456  *                     minimum = sample
5457  *                 elif sample > maximum:
5458  *                     maximum = sample             # <<<<<<<<<<<<<<
5459  *
5460  *             index = <long long>(2*(i-start)/samples_per_pixel)
5461  */
5462                                   __pyx_v_maximum = __pyx_v_sample;
5463 
5464                                   /* "urh/cythonext/path_creator.pyx":58
5465  *                 if sample < minimum:
5466  *                     minimum = sample
5467  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
5468  *                     maximum = sample
5469  *
5470  */
5471                                 }
5472                                 __pyx_L15:;
5473                               }
5474 
5475                               /* "urh/cythonext/path_creator.pyx":61
5476  *                     maximum = sample
5477  *
5478  *             index = <long long>(2*(i-start)/samples_per_pixel)             # <<<<<<<<<<<<<<
5479  *             values[index] = minimum
5480  *             values[index + 1] = maximum
5481  */
5482                               __pyx_v_index = ((PY_LONG_LONG)((2 * (__pyx_v_i - __pyx_v_start)) / __pyx_v_samples_per_pixel));
5483 
5484                               /* "urh/cythonext/path_creator.pyx":62
5485  *
5486  *             index = <long long>(2*(i-start)/samples_per_pixel)
5487  *             values[index] = minimum             # <<<<<<<<<<<<<<
5488  *             values[index + 1] = maximum
5489  *
5490  */
5491                               __pyx_t_15 = __pyx_v_index;
5492                               *((unsigned char *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_minimum;
5493 
5494                               /* "urh/cythonext/path_creator.pyx":63
5495  *             index = <long long>(2*(i-start)/samples_per_pixel)
5496  *             values[index] = minimum
5497  *             values[index + 1] = maximum             # <<<<<<<<<<<<<<
5498  *
5499  *         x = np.repeat(sample_rng, 2)
5500  */
5501                               __pyx_t_15 = (__pyx_v_index + 1);
5502                               *((unsigned char *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_maximum;
5503                           }
5504                       }
5505                   }
5506               }
5507           }
5508           #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
5509               #undef likely
5510               #undef unlikely
5511               #define likely(x)   __builtin_expect(!!(x), 1)
5512               #define unlikely(x) __builtin_expect(!!(x), 0)
5513           #endif
5514         }
5515 
5516         /* "urh/cythonext/path_creator.pyx":45
5517  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
5518  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
5519  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
5520  *             chunk_end = i + samples_per_pixel
5521  *             if chunk_end >= end:
5522  */
5523         /*finally:*/ {
5524           /*normal exit:*/{
5525             #ifdef WITH_THREAD
5526             __Pyx_FastGIL_Forget();
5527             Py_BLOCK_THREADS
5528             #endif
5529             goto __pyx_L7;
5530           }
5531           __pyx_L7:;
5532         }
5533     }
5534 
5535     /* "urh/cythonext/path_creator.pyx":65
5536  *             values[index + 1] = maximum
5537  *
5538  *         x = np.repeat(sample_rng, 2)             # <<<<<<<<<<<<<<
5539  *     else:
5540  *         x = np.arange(start, end, dtype=np.int64)
5541  */
5542     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
5543     __Pyx_GOTREF(__pyx_t_3);
5544     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_repeat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
5545     __Pyx_GOTREF(__pyx_t_7);
5546     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5547     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sample_rng, 1, (PyObject *(*)(char *)) __pyx_memview_get_PY_LONG_LONG, (int (*)(char *, PyObject *)) __pyx_memview_set_PY_LONG_LONG, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
5548     __Pyx_GOTREF(__pyx_t_3);
5549     __pyx_t_2 = NULL;
5550     __pyx_t_19 = 0;
5551     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
5552       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
5553       if (likely(__pyx_t_2)) {
5554         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
5555         __Pyx_INCREF(__pyx_t_2);
5556         __Pyx_INCREF(function);
5557         __Pyx_DECREF_SET(__pyx_t_7, function);
5558         __pyx_t_19 = 1;
5559       }
5560     }
5561     #if CYTHON_FAST_PYCALL
5562     if (PyFunction_Check(__pyx_t_7)) {
5563       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
5564       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
5565       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5566       __Pyx_GOTREF(__pyx_t_1);
5567       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5568     } else
5569     #endif
5570     #if CYTHON_FAST_PYCCALL
5571     if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
5572       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
5573       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
5574       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5575       __Pyx_GOTREF(__pyx_t_1);
5576       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5577     } else
5578     #endif
5579     {
5580       __pyx_t_5 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
5581       __Pyx_GOTREF(__pyx_t_5);
5582       if (__pyx_t_2) {
5583         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
5584       }
5585       __Pyx_GIVEREF(__pyx_t_3);
5586       PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_19, __pyx_t_3);
5587       __Pyx_INCREF(__pyx_int_2);
5588       __Pyx_GIVEREF(__pyx_int_2);
5589       PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_19, __pyx_int_2);
5590       __pyx_t_3 = 0;
5591       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
5592       __Pyx_GOTREF(__pyx_t_1);
5593       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5594     }
5595     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5596     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 65, __pyx_L1_error)
5597     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5598     __pyx_v_x = __pyx_t_20;
5599     __pyx_t_20.memview = NULL;
5600     __pyx_t_20.data = NULL;
5601 
5602     /* "urh/cythonext/path_creator.pyx":41
5603  *         num_threads = 1
5604  *
5605  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
5606  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
5607  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
5608  */
5609     goto __pyx_L4;
5610   }
5611 
5612   /* "urh/cythonext/path_creator.pyx":67
5613  *         x = np.repeat(sample_rng, 2)
5614  *     else:
5615  *         x = np.arange(start, end, dtype=np.int64)             # <<<<<<<<<<<<<<
5616  *         values = samples[start:end]
5617  *         scale_factor = 1.0
5618  */
5619   /*else*/ {
5620     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
5621     __Pyx_GOTREF(__pyx_t_1);
5622     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error)
5623     __Pyx_GOTREF(__pyx_t_7);
5624     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5625     __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
5626     __Pyx_GOTREF(__pyx_t_1);
5627     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
5628     __Pyx_GOTREF(__pyx_t_5);
5629     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
5630     __Pyx_GOTREF(__pyx_t_3);
5631     __Pyx_GIVEREF(__pyx_t_1);
5632     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
5633     __Pyx_GIVEREF(__pyx_t_5);
5634     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
5635     __pyx_t_1 = 0;
5636     __pyx_t_5 = 0;
5637     __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
5638     __Pyx_GOTREF(__pyx_t_5);
5639     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
5640     __Pyx_GOTREF(__pyx_t_1);
5641     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
5642     __Pyx_GOTREF(__pyx_t_2);
5643     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5644     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
5645     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5646     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
5647     __Pyx_GOTREF(__pyx_t_2);
5648     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5649     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5650     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5651     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 67, __pyx_L1_error)
5652     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5653     __pyx_v_x = __pyx_t_20;
5654     __pyx_t_20.memview = NULL;
5655     __pyx_t_20.data = NULL;
5656 
5657     /* "urh/cythonext/path_creator.pyx":68
5658  *     else:
5659  *         x = np.arange(start, end, dtype=np.int64)
5660  *         values = samples[start:end]             # <<<<<<<<<<<<<<
5661  *         scale_factor = 1.0
5662  *
5663  */
5664     __pyx_t_10.data = __pyx_v_samples.data;
5665     __pyx_t_10.memview = __pyx_v_samples.memview;
5666     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
5667     __pyx_t_19 = -1;
5668     if (unlikely(__pyx_memoryview_slice_memviewslice(
5669     &__pyx_t_10,
5670     __pyx_v_samples.shape[0], __pyx_v_samples.strides[0], __pyx_v_samples.suboffsets[0],
5671     0,
5672     0,
5673     &__pyx_t_19,
5674     __pyx_v_start,
5675     __pyx_v_end,
5676     0,
5677     1,
5678     1,
5679     0,
5680     1) < 0))
5681 {
5682     __PYX_ERR(0, 68, __pyx_L1_error)
5683 }
5684 
5685 __pyx_v_values = __pyx_t_10;
5686     __pyx_t_10.memview = NULL;
5687     __pyx_t_10.data = NULL;
5688 
5689     /* "urh/cythonext/path_creator.pyx":69
5690  *         x = np.arange(start, end, dtype=np.int64)
5691  *         values = samples[start:end]
5692  *         scale_factor = 1.0             # <<<<<<<<<<<<<<
5693  *
5694  *     cdef list result = []
5695  */
5696     __pyx_v_scale_factor = 1.0;
5697   }
5698   __pyx_L4:;
5699 
5700   /* "urh/cythonext/path_creator.pyx":71
5701  *         scale_factor = 1.0
5702  *
5703  *     cdef list result = []             # <<<<<<<<<<<<<<
5704  *     if scale_factor == 0:
5705  *         scale_factor = 1  # prevent division by zero
5706  */
5707   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
5708   __Pyx_GOTREF(__pyx_t_2);
5709   __pyx_v_result = ((PyObject*)__pyx_t_2);
5710   __pyx_t_2 = 0;
5711 
5712   /* "urh/cythonext/path_creator.pyx":72
5713  *
5714  *     cdef list result = []
5715  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
5716  *         scale_factor = 1  # prevent division by zero
5717  *
5718  */
5719   __pyx_t_4 = ((__pyx_v_scale_factor == 0.0) != 0);
5720   if (__pyx_t_4) {
5721 
5722     /* "urh/cythonext/path_creator.pyx":73
5723  *     cdef list result = []
5724  *     if scale_factor == 0:
5725  *         scale_factor = 1  # prevent division by zero             # <<<<<<<<<<<<<<
5726  *
5727  *     for subpath_range in subpath_ranges:
5728  */
5729     __pyx_v_scale_factor = 1.0;
5730 
5731     /* "urh/cythonext/path_creator.pyx":72
5732  *
5733  *     cdef list result = []
5734  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
5735  *         scale_factor = 1  # prevent division by zero
5736  *
5737  */
5738   }
5739 
5740   /* "urh/cythonext/path_creator.pyx":75
5741  *         scale_factor = 1  # prevent division by zero
5742  *
5743  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
5744  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
5745  *         sub_start =int(max(0, math.floor(sub_start)))
5746  */
5747   if (unlikely(__pyx_v_subpath_ranges == Py_None)) {
5748     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
5749     __PYX_ERR(0, 75, __pyx_L1_error)
5750   }
5751   __pyx_t_2 = __pyx_v_subpath_ranges; __Pyx_INCREF(__pyx_t_2); __pyx_t_21 = 0;
5752   for (;;) {
5753     if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_2)) break;
5754     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5755     __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_21); __Pyx_INCREF(__pyx_t_5); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error)
5756     #else
5757     __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
5758     __Pyx_GOTREF(__pyx_t_5);
5759     #endif
5760     __Pyx_XDECREF_SET(__pyx_v_subpath_range, __pyx_t_5);
5761     __pyx_t_5 = 0;
5762 
5763     /* "urh/cythonext/path_creator.pyx":76
5764  *
5765  *     for subpath_range in subpath_ranges:
5766  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
5767  *         sub_start =int(max(0, math.floor(sub_start)))
5768  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
5769  */
5770     __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_subpath_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5771     __Pyx_GOTREF(__pyx_t_5);
5772     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5773     __Pyx_GOTREF(__pyx_t_3);
5774     __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
5775     __Pyx_GOTREF(__pyx_t_7);
5776     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5777     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5778     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5779     __Pyx_GOTREF(__pyx_t_3);
5780     __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5781     __Pyx_GOTREF(__pyx_t_5);
5782     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5783     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5784     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5785     __Pyx_GOTREF(__pyx_t_3);
5786     __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
5787     __Pyx_GOTREF(__pyx_t_7);
5788     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5789     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5790     __pyx_t_3 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5791     __Pyx_GOTREF(__pyx_t_3);
5792     __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5793     __Pyx_GOTREF(__pyx_t_5);
5794     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5795     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5796     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5797     __Pyx_GOTREF(__pyx_t_3);
5798     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
5799     __Pyx_GOTREF(__pyx_t_7);
5800     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5801     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5802     __Pyx_XDECREF_SET(__pyx_v_sub_start, __pyx_t_7);
5803     __pyx_t_7 = 0;
5804 
5805     /* "urh/cythonext/path_creator.pyx":77
5806  *     for subpath_range in subpath_ranges:
5807  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
5808  *         sub_start =int(max(0, math.floor(sub_start)))             # <<<<<<<<<<<<<<
5809  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
5810  *         sub_end = int(max(0, math.ceil(sub_end)))
5811  */
5812     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
5813     __Pyx_GOTREF(__pyx_t_3);
5814     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
5815     __Pyx_GOTREF(__pyx_t_5);
5816     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5817     __pyx_t_3 = NULL;
5818     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5819       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
5820       if (likely(__pyx_t_3)) {
5821         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5822         __Pyx_INCREF(__pyx_t_3);
5823         __Pyx_INCREF(function);
5824         __Pyx_DECREF_SET(__pyx_t_5, function);
5825       }
5826     }
5827     __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_sub_start) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_sub_start);
5828     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5829     if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
5830     __Pyx_GOTREF(__pyx_t_7);
5831     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5832     __pyx_t_22 = 0;
5833     __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
5834     __Pyx_GOTREF(__pyx_t_3);
5835     __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
5836     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5837     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 77, __pyx_L1_error)
5838     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5839     if (__pyx_t_4) {
5840       __Pyx_INCREF(__pyx_t_7);
5841       __pyx_t_5 = __pyx_t_7;
5842     } else {
5843       __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
5844       __Pyx_GOTREF(__pyx_t_1);
5845       __pyx_t_5 = __pyx_t_1;
5846       __pyx_t_1 = 0;
5847     }
5848     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5849     __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
5850     __Pyx_GOTREF(__pyx_t_7);
5851     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5852     __Pyx_DECREF_SET(__pyx_v_sub_start, __pyx_t_7);
5853     __pyx_t_7 = 0;
5854 
5855     /* "urh/cythonext/path_creator.pyx":78
5856  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
5857  *         sub_start =int(max(0, math.floor(sub_start)))
5858  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
5859  *         sub_end = int(max(0, math.ceil(sub_end)))
5860  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
5861  */
5862     __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_subpath_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
5863     __Pyx_GOTREF(__pyx_t_7);
5864     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
5865     __Pyx_GOTREF(__pyx_t_5);
5866     __pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
5867     __Pyx_GOTREF(__pyx_t_1);
5868     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5869     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5870     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
5871     __Pyx_GOTREF(__pyx_t_5);
5872     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
5873     __Pyx_GOTREF(__pyx_t_7);
5874     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5875     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5876     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
5877     __Pyx_GOTREF(__pyx_t_5);
5878     __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
5879     __Pyx_GOTREF(__pyx_t_1);
5880     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5881     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5882     __pyx_t_5 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
5883     __Pyx_GOTREF(__pyx_t_5);
5884     __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
5885     __Pyx_GOTREF(__pyx_t_7);
5886     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5887     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5888     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
5889     __Pyx_GOTREF(__pyx_t_5);
5890     __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
5891     __Pyx_GOTREF(__pyx_t_1);
5892     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5893     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5894     __Pyx_XDECREF_SET(__pyx_v_sub_end, __pyx_t_1);
5895     __pyx_t_1 = 0;
5896 
5897     /* "urh/cythonext/path_creator.pyx":79
5898  *         sub_start =int(max(0, math.floor(sub_start)))
5899  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
5900  *         sub_end = int(max(0, math.ceil(sub_end)))             # <<<<<<<<<<<<<<
5901  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
5902  *
5903  */
5904     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
5905     __Pyx_GOTREF(__pyx_t_5);
5906     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ceil); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
5907     __Pyx_GOTREF(__pyx_t_7);
5908     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5909     __pyx_t_5 = NULL;
5910     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
5911       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
5912       if (likely(__pyx_t_5)) {
5913         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
5914         __Pyx_INCREF(__pyx_t_5);
5915         __Pyx_INCREF(function);
5916         __Pyx_DECREF_SET(__pyx_t_7, function);
5917       }
5918     }
5919     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_sub_end) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_sub_end);
5920     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5921     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
5922     __Pyx_GOTREF(__pyx_t_1);
5923     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5924     __pyx_t_22 = 0;
5925     __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
5926     __Pyx_GOTREF(__pyx_t_5);
5927     __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
5928     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5929     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
5930     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5931     if (__pyx_t_4) {
5932       __Pyx_INCREF(__pyx_t_1);
5933       __pyx_t_7 = __pyx_t_1;
5934     } else {
5935       __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
5936       __Pyx_GOTREF(__pyx_t_3);
5937       __pyx_t_7 = __pyx_t_3;
5938       __pyx_t_3 = 0;
5939     }
5940     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5941     __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
5942     __Pyx_GOTREF(__pyx_t_1);
5943     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5944     __Pyx_DECREF_SET(__pyx_v_sub_end, __pyx_t_1);
5945     __pyx_t_1 = 0;
5946 
5947     /* "urh/cythonext/path_creator.pyx":80
5948  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
5949  *         sub_end = int(max(0, math.ceil(sub_end)))
5950  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))             # <<<<<<<<<<<<<<
5951  *
5952  *     return result
5953  */
5954     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
5955     __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
5956     __pyx_t_20.data = __pyx_v_x.data;
5957     __pyx_t_20.memview = __pyx_v_x.memview;
5958     __PYX_INC_MEMVIEW(&__pyx_t_20, 0);
5959     __pyx_t_19 = -1;
5960     if (unlikely(__pyx_memoryview_slice_memviewslice(
5961     &__pyx_t_20,
5962     __pyx_v_x.shape[0], __pyx_v_x.strides[0], __pyx_v_x.suboffsets[0],
5963     0,
5964     0,
5965     &__pyx_t_19,
5966     __pyx_t_23,
5967     __pyx_t_24,
5968     0,
5969     1,
5970     1,
5971     0,
5972     1) < 0))
5973 {
5974     __PYX_ERR(0, 80, __pyx_L1_error)
5975 }
5976 
5977 __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
5978     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
5979     __pyx_t_10.data = __pyx_v_values.data;
5980     __pyx_t_10.memview = __pyx_v_values.memview;
5981     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
5982     __pyx_t_19 = -1;
5983     if (unlikely(__pyx_memoryview_slice_memviewslice(
5984     &__pyx_t_10,
5985     __pyx_v_values.shape[0], __pyx_v_values.strides[0], __pyx_v_values.suboffsets[0],
5986     0,
5987     0,
5988     &__pyx_t_19,
5989     __pyx_t_24,
5990     __pyx_t_23,
5991     0,
5992     1,
5993     1,
5994     0,
5995     1) < 0))
5996 {
5997     __PYX_ERR(0, 80, __pyx_L1_error)
5998 }
5999 
6000 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_10, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
6001     __Pyx_GOTREF(__pyx_t_1);
6002     __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
6003     __pyx_t_10.memview = NULL;
6004     __pyx_t_10.data = NULL;
6005     __pyx_t_7 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_20, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
6006     __Pyx_GOTREF(__pyx_t_7);
6007     __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
6008     __pyx_t_20.memview = NULL;
6009     __pyx_t_20.data = NULL;
6010     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6011     __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error)
6012     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6013 
6014     /* "urh/cythonext/path_creator.pyx":75
6015  *         scale_factor = 1  # prevent division by zero
6016  *
6017  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
6018  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
6019  *         sub_start =int(max(0, math.floor(sub_start)))
6020  */
6021   }
6022   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6023 
6024   /* "urh/cythonext/path_creator.pyx":82
6025  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
6026  *
6027  *     return result             # <<<<<<<<<<<<<<
6028  *
6029  *
6030  */
6031   __Pyx_XDECREF(__pyx_r);
6032   __Pyx_INCREF(__pyx_v_result);
6033   __pyx_r = __pyx_v_result;
6034   goto __pyx_L0;
6035 
6036   /* "urh/cythonext/path_creator.pyx":19
6037  * import struct
6038  *
6039  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
6040  *     cdef iq[:] values
6041  *     cdef long long[::1] sample_rng
6042  */
6043 
6044   /* function exit code */
6045   __pyx_L1_error:;
6046   __Pyx_XDECREF(__pyx_t_1);
6047   __Pyx_XDECREF(__pyx_t_2);
6048   __Pyx_XDECREF(__pyx_t_3);
6049   __Pyx_XDECREF(__pyx_t_5);
6050   __Pyx_XDECREF(__pyx_t_7);
6051   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6052   __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
6053   __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
6054   __Pyx_AddTraceback("urh.cythonext.path_creator.create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
6055   __pyx_r = 0;
6056   __pyx_L0:;
6057   __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
6058   __PYX_XDEC_MEMVIEW(&__pyx_v_sample_rng, 1);
6059   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
6060   __Pyx_XDECREF(__pyx_v_type_lookup);
6061   __Pyx_XDECREF(__pyx_v_result);
6062   __Pyx_XDECREF(__pyx_v_subpath_range);
6063   __Pyx_XDECREF(__pyx_v_sub_start);
6064   __Pyx_XDECREF(__pyx_v_sub_end);
6065   __Pyx_XDECREF(__pyx_v_subpath_ranges);
6066   __Pyx_XGIVEREF(__pyx_r);
6067   __Pyx_RefNannyFinishContext();
6068   return __pyx_r;
6069 }
6070 
6071 /* Python wrapper */
6072 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_9__pyx_fuse_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6073 static PyMethodDef __pyx_fuse_1__pyx_mdef_3urh_9cythonext_12path_creator_9__pyx_fuse_1create_path = {"__pyx_fuse_1create_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_9__pyx_fuse_1create_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_9__pyx_fuse_1create_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6074 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_9__pyx_fuse_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6075   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
6076   PY_LONG_LONG __pyx_v_start;
6077   PY_LONG_LONG __pyx_v_end;
6078   PyObject *__pyx_v_subpath_ranges = 0;
6079   int __pyx_lineno = 0;
6080   const char *__pyx_filename = NULL;
6081   int __pyx_clineno = 0;
6082   PyObject *__pyx_r = 0;
6083   __Pyx_RefNannyDeclarations
6084   __Pyx_RefNannySetupContext("__pyx_fuse_1create_path (wrapper)", 0);
6085   {
6086     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_subpath_ranges,0};
6087     PyObject* values[4] = {0,0,0,0};
6088     values[3] = __pyx_k__7;
6089     if (unlikely(__pyx_kwds)) {
6090       Py_ssize_t kw_args;
6091       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6092       switch (pos_args) {
6093         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6094         CYTHON_FALLTHROUGH;
6095         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6096         CYTHON_FALLTHROUGH;
6097         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6098         CYTHON_FALLTHROUGH;
6099         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6100         CYTHON_FALLTHROUGH;
6101         case  0: break;
6102         default: goto __pyx_L5_argtuple_error;
6103       }
6104       kw_args = PyDict_Size(__pyx_kwds);
6105       switch (pos_args) {
6106         case  0:
6107         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
6108         else goto __pyx_L5_argtuple_error;
6109         CYTHON_FALLTHROUGH;
6110         case  1:
6111         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
6112         else {
6113           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1create_path", 0, 3, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
6114         }
6115         CYTHON_FALLTHROUGH;
6116         case  2:
6117         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
6118         else {
6119           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1create_path", 0, 3, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
6120         }
6121         CYTHON_FALLTHROUGH;
6122         case  3:
6123         if (kw_args > 0) {
6124           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subpath_ranges);
6125           if (value) { values[3] = value; kw_args--; }
6126         }
6127       }
6128       if (unlikely(kw_args > 0)) {
6129         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1create_path") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
6130       }
6131     } else {
6132       switch (PyTuple_GET_SIZE(__pyx_args)) {
6133         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6134         CYTHON_FALLTHROUGH;
6135         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6136         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6137         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6138         break;
6139         default: goto __pyx_L5_argtuple_error;
6140       }
6141     }
6142     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 19, __pyx_L3_error)
6143     __pyx_v_start = __Pyx_PyInt_As_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_start == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
6144     __pyx_v_end = __Pyx_PyInt_As_PY_LONG_LONG(values[2]); if (unlikely((__pyx_v_end == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
6145     __pyx_v_subpath_ranges = ((PyObject*)values[3]);
6146   }
6147   goto __pyx_L4_argument_unpacking_done;
6148   __pyx_L5_argtuple_error:;
6149   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1create_path", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
6150   __pyx_L3_error:;
6151   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_1create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
6152   __Pyx_RefNannyFinishContext();
6153   return NULL;
6154   __pyx_L4_argument_unpacking_done:;
6155   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subpath_ranges), (&PyList_Type), 1, "subpath_ranges", 1))) __PYX_ERR(0, 19, __pyx_L1_error)
6156   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_8__pyx_fuse_1create_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end, __pyx_v_subpath_ranges);
6157 
6158   /* function exit code */
6159   goto __pyx_L0;
6160   __pyx_L1_error:;
6161   __pyx_r = NULL;
6162   __pyx_L0:;
6163   __Pyx_RefNannyFinishContext();
6164   return __pyx_r;
6165 }
6166 
__pyx_pf_3urh_9cythonext_12path_creator_8__pyx_fuse_1create_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,PyObject * __pyx_v_subpath_ranges)6167 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_8__pyx_fuse_1create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges) {
6168   PyObject *__pyx_r = NULL;
6169   __Pyx_RefNannyDeclarations
6170   PyObject *__pyx_t_1 = NULL;
6171   struct __pyx_fuse_1__pyx_opt_args_3urh_9cythonext_12path_creator_create_path __pyx_t_2;
6172   int __pyx_lineno = 0;
6173   const char *__pyx_filename = NULL;
6174   int __pyx_clineno = 0;
6175   __Pyx_RefNannySetupContext("__pyx_fuse_1create_path", 0);
6176   __Pyx_XDECREF(__pyx_r);
6177   __pyx_t_2.__pyx_n = 1;
6178   __pyx_t_2.subpath_ranges = __pyx_v_subpath_ranges;
6179   __pyx_t_1 = __pyx_fuse_1__pyx_f_3urh_9cythonext_12path_creator_create_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
6180   __Pyx_GOTREF(__pyx_t_1);
6181   __pyx_r = __pyx_t_1;
6182   __pyx_t_1 = 0;
6183   goto __pyx_L0;
6184 
6185   /* function exit code */
6186   __pyx_L1_error:;
6187   __Pyx_XDECREF(__pyx_t_1);
6188   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_1create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
6189   __pyx_r = NULL;
6190   __pyx_L0:;
6191   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
6192   __Pyx_XGIVEREF(__pyx_r);
6193   __Pyx_RefNannyFinishContext();
6194   return __pyx_r;
6195 }
6196 
6197 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_11__pyx_fuse_2create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6198 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_2__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_fuse_2__pyx_opt_args_3urh_9cythonext_12path_creator_create_path * __pyx_optional_args)6199 static PyObject *__pyx_fuse_2__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_fuse_2__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args) {
6200   PyObject *__pyx_v_subpath_ranges = __pyx_k__8;
6201   __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
6202   __Pyx_memviewslice __pyx_v_sample_rng = { 0, 0, { 0 }, { 0 }, { 0 } };
6203   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
6204   short __pyx_v_sample;
6205   short __pyx_v_minimum;
6206   short __pyx_v_maximum;
6207   short __pyx_v_tmp;
6208   float __pyx_v_scale_factor;
6209   PY_LONG_LONG __pyx_v_i;
6210   PY_LONG_LONG __pyx_v_j;
6211   PY_LONG_LONG __pyx_v_index;
6212   PY_LONG_LONG __pyx_v_chunk_end;
6213   PY_LONG_LONG __pyx_v_num_samples;
6214   PY_LONG_LONG __pyx_v_pixels_on_path;
6215   PY_LONG_LONG __pyx_v_samples_per_pixel;
6216   PyObject *__pyx_v_type_lookup = 0;
6217   CYTHON_UNUSED int __pyx_v_num_threads;
6218   PyObject *__pyx_v_result = 0;
6219   PyObject *__pyx_v_subpath_range = NULL;
6220   PyObject *__pyx_v_sub_start = NULL;
6221   PyObject *__pyx_v_sub_end = NULL;
6222   PyObject *__pyx_r = NULL;
6223   __Pyx_RefNannyDeclarations
6224   PyObject *__pyx_t_1 = NULL;
6225   PyObject *__pyx_t_2 = NULL;
6226   PyObject *__pyx_t_3 = NULL;
6227   int __pyx_t_4;
6228   PyObject *__pyx_t_5 = NULL;
6229   PY_LONG_LONG __pyx_t_6;
6230   PyObject *__pyx_t_7 = NULL;
6231   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6232   size_t __pyx_t_9;
6233   __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
6234   PY_LONG_LONG __pyx_t_11;
6235   PY_LONG_LONG __pyx_t_12;
6236   PY_LONG_LONG __pyx_t_13;
6237   PY_LONG_LONG __pyx_t_14;
6238   PY_LONG_LONG __pyx_t_15;
6239   PY_LONG_LONG __pyx_t_16;
6240   PY_LONG_LONG __pyx_t_17;
6241   PY_LONG_LONG __pyx_t_18;
6242   int __pyx_t_19;
6243   __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
6244   Py_ssize_t __pyx_t_21;
6245   long __pyx_t_22;
6246   Py_ssize_t __pyx_t_23;
6247   Py_ssize_t __pyx_t_24;
6248   int __pyx_t_25;
6249   int __pyx_lineno = 0;
6250   const char *__pyx_filename = NULL;
6251   int __pyx_clineno = 0;
6252   __Pyx_RefNannySetupContext("__pyx_fuse_2create_path", 0);
6253   if (__pyx_optional_args) {
6254     if (__pyx_optional_args->__pyx_n > 0) {
6255       __pyx_v_subpath_ranges = __pyx_optional_args->subpath_ranges;
6256     }
6257   }
6258   __Pyx_INCREF(__pyx_v_subpath_ranges);
6259 
6260   /* "urh/cythonext/path_creator.pyx":26
6261  *     cdef float scale_factor
6262  *     cdef long long i,j,index, chunk_end, num_samples, pixels_on_path, samples_per_pixel
6263  *     num_samples = end - start             # <<<<<<<<<<<<<<
6264  *
6265  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
6266  */
6267   __pyx_v_num_samples = (__pyx_v_end - __pyx_v_start);
6268 
6269   /* "urh/cythonext/path_creator.pyx":28
6270  *     num_samples = end - start
6271  *
6272  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,             # <<<<<<<<<<<<<<
6273  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
6274  *                              "float[:]": np.float32, "double[:]": np.float64}
6275  */
6276   __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
6277   __Pyx_GOTREF(__pyx_t_1);
6278   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
6279   __Pyx_GOTREF(__pyx_t_2);
6280   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
6281   __Pyx_GOTREF(__pyx_t_3);
6282   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6283   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_char_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
6284   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6285   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
6286   __Pyx_GOTREF(__pyx_t_3);
6287   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
6288   __Pyx_GOTREF(__pyx_t_2);
6289   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6290   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_char_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
6291   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6292 
6293   /* "urh/cythonext/path_creator.pyx":29
6294  *
6295  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
6296  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,             # <<<<<<<<<<<<<<
6297  *                              "float[:]": np.float32, "double[:]": np.float64}
6298  *
6299  */
6300   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
6301   __Pyx_GOTREF(__pyx_t_2);
6302   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
6303   __Pyx_GOTREF(__pyx_t_3);
6304   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6305   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_short_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
6306   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6307   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
6308   __Pyx_GOTREF(__pyx_t_3);
6309   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
6310   __Pyx_GOTREF(__pyx_t_2);
6311   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6312   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_short_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
6313   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6314 
6315   /* "urh/cythonext/path_creator.pyx":30
6316  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
6317  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
6318  *                              "float[:]": np.float32, "double[:]": np.float64}             # <<<<<<<<<<<<<<
6319  *
6320  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
6321  */
6322   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
6323   __Pyx_GOTREF(__pyx_t_2);
6324   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
6325   __Pyx_GOTREF(__pyx_t_3);
6326   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6327   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_float_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
6328   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6329   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
6330   __Pyx_GOTREF(__pyx_t_3);
6331   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
6332   __Pyx_GOTREF(__pyx_t_2);
6333   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6334   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_double, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
6335   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6336   __pyx_v_type_lookup = ((PyObject*)__pyx_t_1);
6337   __pyx_t_1 = 0;
6338 
6339   /* "urh/cythonext/path_creator.pyx":32
6340  *                              "float[:]": np.float32, "double[:]": np.float64}
6341  *
6342  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges             # <<<<<<<<<<<<<<
6343  *     pixels_on_path = settings.PIXELS_PER_PATH
6344  *
6345  */
6346   __pyx_t_4 = (__pyx_v_subpath_ranges == ((PyObject*)Py_None));
6347   if ((__pyx_t_4 != 0)) {
6348     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
6349     __Pyx_GOTREF(__pyx_t_2);
6350     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
6351     __Pyx_GOTREF(__pyx_t_3);
6352     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error)
6353     __Pyx_GOTREF(__pyx_t_5);
6354     __Pyx_GIVEREF(__pyx_t_2);
6355     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
6356     __Pyx_GIVEREF(__pyx_t_3);
6357     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
6358     __pyx_t_2 = 0;
6359     __pyx_t_3 = 0;
6360     __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
6361     __Pyx_GOTREF(__pyx_t_3);
6362     __Pyx_GIVEREF(__pyx_t_5);
6363     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
6364     __pyx_t_5 = 0;
6365     __pyx_t_1 = __pyx_t_3;
6366     __pyx_t_3 = 0;
6367   } else {
6368     __Pyx_INCREF(__pyx_v_subpath_ranges);
6369     __pyx_t_1 = __pyx_v_subpath_ranges;
6370   }
6371   __Pyx_DECREF_SET(__pyx_v_subpath_ranges, ((PyObject*)__pyx_t_1));
6372   __pyx_t_1 = 0;
6373 
6374   /* "urh/cythonext/path_creator.pyx":33
6375  *
6376  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
6377  *     pixels_on_path = settings.PIXELS_PER_PATH             # <<<<<<<<<<<<<<
6378  *
6379  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
6380  */
6381   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
6382   __Pyx_GOTREF(__pyx_t_1);
6383   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PIXELS_PER_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
6384   __Pyx_GOTREF(__pyx_t_3);
6385   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6386   __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error)
6387   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6388   __pyx_v_pixels_on_path = __pyx_t_6;
6389 
6390   /* "urh/cythonext/path_creator.pyx":35
6391  *     pixels_on_path = settings.PIXELS_PER_PATH
6392  *
6393  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)             # <<<<<<<<<<<<<<
6394  *
6395  *     cdef int num_threads = 0
6396  */
6397   __pyx_v_samples_per_pixel = ((PY_LONG_LONG)(__pyx_v_num_samples / __pyx_v_pixels_on_path));
6398 
6399   /* "urh/cythonext/path_creator.pyx":37
6400  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
6401  *
6402  *     cdef int num_threads = 0             # <<<<<<<<<<<<<<
6403  *     if samples_per_pixel < 20000:
6404  *         num_threads = 1
6405  */
6406   __pyx_v_num_threads = 0;
6407 
6408   /* "urh/cythonext/path_creator.pyx":38
6409  *
6410  *     cdef int num_threads = 0
6411  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
6412  *         num_threads = 1
6413  *
6414  */
6415   __pyx_t_4 = ((__pyx_v_samples_per_pixel < 0x4E20) != 0);
6416   if (__pyx_t_4) {
6417 
6418     /* "urh/cythonext/path_creator.pyx":39
6419  *     cdef int num_threads = 0
6420  *     if samples_per_pixel < 20000:
6421  *         num_threads = 1             # <<<<<<<<<<<<<<
6422  *
6423  *     if samples_per_pixel > 1:
6424  */
6425     __pyx_v_num_threads = 1;
6426 
6427     /* "urh/cythonext/path_creator.pyx":38
6428  *
6429  *     cdef int num_threads = 0
6430  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
6431  *         num_threads = 1
6432  *
6433  */
6434   }
6435 
6436   /* "urh/cythonext/path_creator.pyx":41
6437  *         num_threads = 1
6438  *
6439  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
6440  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
6441  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
6442  */
6443   __pyx_t_4 = ((__pyx_v_samples_per_pixel > 1) != 0);
6444   if (__pyx_t_4) {
6445 
6446     /* "urh/cythonext/path_creator.pyx":42
6447  *
6448  *     if samples_per_pixel > 1:
6449  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)             # <<<<<<<<<<<<<<
6450  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
6451  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
6452  */
6453     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
6454     __Pyx_GOTREF(__pyx_t_3);
6455     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
6456     __Pyx_GOTREF(__pyx_t_1);
6457     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6458     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
6459     __Pyx_GOTREF(__pyx_t_3);
6460     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
6461     __Pyx_GOTREF(__pyx_t_5);
6462     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_samples_per_pixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
6463     __Pyx_GOTREF(__pyx_t_2);
6464     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
6465     __Pyx_GOTREF(__pyx_t_7);
6466     __Pyx_GIVEREF(__pyx_t_3);
6467     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
6468     __Pyx_GIVEREF(__pyx_t_5);
6469     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
6470     __Pyx_GIVEREF(__pyx_t_2);
6471     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
6472     __pyx_t_3 = 0;
6473     __pyx_t_5 = 0;
6474     __pyx_t_2 = 0;
6475     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
6476     __Pyx_GOTREF(__pyx_t_2);
6477     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
6478     __Pyx_GOTREF(__pyx_t_5);
6479     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
6480     __Pyx_GOTREF(__pyx_t_3);
6481     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6482     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
6483     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6484     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
6485     __Pyx_GOTREF(__pyx_t_3);
6486     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6487     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6488     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6489     __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 42, __pyx_L1_error)
6490     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6491     __pyx_v_sample_rng = __pyx_t_8;
6492     __pyx_t_8.memview = NULL;
6493     __pyx_t_8.data = NULL;
6494 
6495     /* "urh/cythonext/path_creator.pyx":43
6496  *     if samples_per_pixel > 1:
6497  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
6498  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")             # <<<<<<<<<<<<<<
6499  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
6500  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
6501  */
6502     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
6503     __Pyx_GOTREF(__pyx_t_3);
6504     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
6505     __Pyx_GOTREF(__pyx_t_2);
6506     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6507     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
6508     __pyx_t_3 = PyInt_FromSsize_t((2 * __pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
6509     __Pyx_GOTREF(__pyx_t_3);
6510     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
6511     __Pyx_GOTREF(__pyx_t_7);
6512     __Pyx_GIVEREF(__pyx_t_3);
6513     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
6514     __pyx_t_3 = 0;
6515     __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
6516     __Pyx_GOTREF(__pyx_t_3);
6517     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_type_lookup, __pyx_kp_s_short_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
6518     __Pyx_GOTREF(__pyx_t_1);
6519     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
6520     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6521     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
6522     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
6523     __Pyx_GOTREF(__pyx_t_1);
6524     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6525     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6526     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6527     __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_short(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 43, __pyx_L1_error)
6528     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6529     __pyx_v_values = __pyx_t_10;
6530     __pyx_t_10.memview = NULL;
6531     __pyx_t_10.data = NULL;
6532 
6533     /* "urh/cythonext/path_creator.pyx":44
6534  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
6535  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
6536  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!             # <<<<<<<<<<<<<<
6537  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
6538  *             chunk_end = i + samples_per_pixel
6539  */
6540     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
6541     __pyx_v_scale_factor = (((double)__pyx_v_num_samples) / (2.0 * __pyx_t_9));
6542 
6543     /* "urh/cythonext/path_creator.pyx":45
6544  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
6545  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
6546  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
6547  *             chunk_end = i + samples_per_pixel
6548  *             if chunk_end >= end:
6549  */
6550     {
6551         #ifdef WITH_THREAD
6552         PyThreadState *_save;
6553         Py_UNBLOCK_THREADS
6554         __Pyx_FastGIL_Remember();
6555         #endif
6556         /*try:*/ {
6557           __pyx_t_6 = __pyx_v_start;
6558           __pyx_t_11 = __pyx_v_end;
6559           __pyx_t_12 = __pyx_v_samples_per_pixel;
6560           if ((__pyx_t_12 == 0)) abort();
6561           {
6562               #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
6563                   #undef likely
6564                   #undef unlikely
6565                   #define likely(x)   (x)
6566                   #define unlikely(x) (x)
6567               #endif
6568               __pyx_t_14 = (__pyx_t_11 - __pyx_t_6 + __pyx_t_12 - __pyx_t_12/abs(__pyx_t_12)) / __pyx_t_12;
6569               if (__pyx_t_14 > 0)
6570               {
6571                   #ifdef _OPENMP
6572                   #pragma omp parallel num_threads(__pyx_v_num_threads) private(__pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_4)
6573                   #endif /* _OPENMP */
6574                   {
6575                       #ifdef _OPENMP
6576                       #pragma omp for lastprivate(__pyx_v_chunk_end) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_index) lastprivate(__pyx_v_j) lastprivate(__pyx_v_maximum) lastprivate(__pyx_v_minimum) lastprivate(__pyx_v_sample) lastprivate(__pyx_v_tmp) schedule(static)
6577                       #endif /* _OPENMP */
6578                       for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13++){
6579                           {
6580                               __pyx_v_i = (PY_LONG_LONG)(__pyx_t_6 + __pyx_t_12 * __pyx_t_13);
6581                               /* Initialize private variables to invalid values */
6582                               __pyx_v_chunk_end = ((PY_LONG_LONG)0xbad0bad0);
6583                               __pyx_v_index = ((PY_LONG_LONG)0xbad0bad0);
6584                               __pyx_v_j = ((PY_LONG_LONG)0xbad0bad0);
6585                               __pyx_v_maximum = ((short)0xbad0bad0);
6586                               __pyx_v_minimum = ((short)0xbad0bad0);
6587                               __pyx_v_sample = ((short)0xbad0bad0);
6588                               __pyx_v_tmp = ((short)0xbad0bad0);
6589 
6590                               /* "urh/cythonext/path_creator.pyx":46
6591  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
6592  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
6593  *             chunk_end = i + samples_per_pixel             # <<<<<<<<<<<<<<
6594  *             if chunk_end >= end:
6595  *                 chunk_end = end
6596  */
6597                               __pyx_v_chunk_end = (__pyx_v_i + __pyx_v_samples_per_pixel);
6598 
6599                               /* "urh/cythonext/path_creator.pyx":47
6600  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
6601  *             chunk_end = i + samples_per_pixel
6602  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
6603  *                 chunk_end = end
6604  *
6605  */
6606                               __pyx_t_4 = ((__pyx_v_chunk_end >= __pyx_v_end) != 0);
6607                               if (__pyx_t_4) {
6608 
6609                                 /* "urh/cythonext/path_creator.pyx":48
6610  *             chunk_end = i + samples_per_pixel
6611  *             if chunk_end >= end:
6612  *                 chunk_end = end             # <<<<<<<<<<<<<<
6613  *
6614  *             tmp = samples[i]
6615  */
6616                                 __pyx_v_chunk_end = __pyx_v_end;
6617 
6618                                 /* "urh/cythonext/path_creator.pyx":47
6619  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
6620  *             chunk_end = i + samples_per_pixel
6621  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
6622  *                 chunk_end = end
6623  *
6624  */
6625                               }
6626 
6627                               /* "urh/cythonext/path_creator.pyx":50
6628  *                 chunk_end = end
6629  *
6630  *             tmp = samples[i]             # <<<<<<<<<<<<<<
6631  *             minimum = tmp
6632  *             maximum = tmp
6633  */
6634                               __pyx_t_15 = __pyx_v_i;
6635                               __pyx_v_tmp = (*((short *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_15 * __pyx_v_samples.strides[0]) )));
6636 
6637                               /* "urh/cythonext/path_creator.pyx":51
6638  *
6639  *             tmp = samples[i]
6640  *             minimum = tmp             # <<<<<<<<<<<<<<
6641  *             maximum = tmp
6642  *
6643  */
6644                               __pyx_v_minimum = __pyx_v_tmp;
6645 
6646                               /* "urh/cythonext/path_creator.pyx":52
6647  *             tmp = samples[i]
6648  *             minimum = tmp
6649  *             maximum = tmp             # <<<<<<<<<<<<<<
6650  *
6651  *             for j in range(i + 1, chunk_end):
6652  */
6653                               __pyx_v_maximum = __pyx_v_tmp;
6654 
6655                               /* "urh/cythonext/path_creator.pyx":54
6656  *             maximum = tmp
6657  *
6658  *             for j in range(i + 1, chunk_end):             # <<<<<<<<<<<<<<
6659  *                 sample = samples[j]
6660  *                 if sample < minimum:
6661  */
6662                               __pyx_t_15 = __pyx_v_chunk_end;
6663                               __pyx_t_16 = __pyx_t_15;
6664                               for (__pyx_t_17 = (__pyx_v_i + 1); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
6665                                 __pyx_v_j = __pyx_t_17;
6666 
6667                                 /* "urh/cythonext/path_creator.pyx":55
6668  *
6669  *             for j in range(i + 1, chunk_end):
6670  *                 sample = samples[j]             # <<<<<<<<<<<<<<
6671  *                 if sample < minimum:
6672  *                     minimum = sample
6673  */
6674                                 __pyx_t_18 = __pyx_v_j;
6675                                 __pyx_v_sample = (*((short *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )));
6676 
6677                                 /* "urh/cythonext/path_creator.pyx":56
6678  *             for j in range(i + 1, chunk_end):
6679  *                 sample = samples[j]
6680  *                 if sample < minimum:             # <<<<<<<<<<<<<<
6681  *                     minimum = sample
6682  *                 elif sample > maximum:
6683  */
6684                                 __pyx_t_4 = ((__pyx_v_sample < __pyx_v_minimum) != 0);
6685                                 if (__pyx_t_4) {
6686 
6687                                   /* "urh/cythonext/path_creator.pyx":57
6688  *                 sample = samples[j]
6689  *                 if sample < minimum:
6690  *                     minimum = sample             # <<<<<<<<<<<<<<
6691  *                 elif sample > maximum:
6692  *                     maximum = sample
6693  */
6694                                   __pyx_v_minimum = __pyx_v_sample;
6695 
6696                                   /* "urh/cythonext/path_creator.pyx":56
6697  *             for j in range(i + 1, chunk_end):
6698  *                 sample = samples[j]
6699  *                 if sample < minimum:             # <<<<<<<<<<<<<<
6700  *                     minimum = sample
6701  *                 elif sample > maximum:
6702  */
6703                                   goto __pyx_L15;
6704                                 }
6705 
6706                                 /* "urh/cythonext/path_creator.pyx":58
6707  *                 if sample < minimum:
6708  *                     minimum = sample
6709  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
6710  *                     maximum = sample
6711  *
6712  */
6713                                 __pyx_t_4 = ((__pyx_v_sample > __pyx_v_maximum) != 0);
6714                                 if (__pyx_t_4) {
6715 
6716                                   /* "urh/cythonext/path_creator.pyx":59
6717  *                     minimum = sample
6718  *                 elif sample > maximum:
6719  *                     maximum = sample             # <<<<<<<<<<<<<<
6720  *
6721  *             index = <long long>(2*(i-start)/samples_per_pixel)
6722  */
6723                                   __pyx_v_maximum = __pyx_v_sample;
6724 
6725                                   /* "urh/cythonext/path_creator.pyx":58
6726  *                 if sample < minimum:
6727  *                     minimum = sample
6728  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
6729  *                     maximum = sample
6730  *
6731  */
6732                                 }
6733                                 __pyx_L15:;
6734                               }
6735 
6736                               /* "urh/cythonext/path_creator.pyx":61
6737  *                     maximum = sample
6738  *
6739  *             index = <long long>(2*(i-start)/samples_per_pixel)             # <<<<<<<<<<<<<<
6740  *             values[index] = minimum
6741  *             values[index + 1] = maximum
6742  */
6743                               __pyx_v_index = ((PY_LONG_LONG)((2 * (__pyx_v_i - __pyx_v_start)) / __pyx_v_samples_per_pixel));
6744 
6745                               /* "urh/cythonext/path_creator.pyx":62
6746  *
6747  *             index = <long long>(2*(i-start)/samples_per_pixel)
6748  *             values[index] = minimum             # <<<<<<<<<<<<<<
6749  *             values[index + 1] = maximum
6750  *
6751  */
6752                               __pyx_t_15 = __pyx_v_index;
6753                               *((short *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_minimum;
6754 
6755                               /* "urh/cythonext/path_creator.pyx":63
6756  *             index = <long long>(2*(i-start)/samples_per_pixel)
6757  *             values[index] = minimum
6758  *             values[index + 1] = maximum             # <<<<<<<<<<<<<<
6759  *
6760  *         x = np.repeat(sample_rng, 2)
6761  */
6762                               __pyx_t_15 = (__pyx_v_index + 1);
6763                               *((short *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_maximum;
6764                           }
6765                       }
6766                   }
6767               }
6768           }
6769           #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
6770               #undef likely
6771               #undef unlikely
6772               #define likely(x)   __builtin_expect(!!(x), 1)
6773               #define unlikely(x) __builtin_expect(!!(x), 0)
6774           #endif
6775         }
6776 
6777         /* "urh/cythonext/path_creator.pyx":45
6778  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
6779  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
6780  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
6781  *             chunk_end = i + samples_per_pixel
6782  *             if chunk_end >= end:
6783  */
6784         /*finally:*/ {
6785           /*normal exit:*/{
6786             #ifdef WITH_THREAD
6787             __Pyx_FastGIL_Forget();
6788             Py_BLOCK_THREADS
6789             #endif
6790             goto __pyx_L7;
6791           }
6792           __pyx_L7:;
6793         }
6794     }
6795 
6796     /* "urh/cythonext/path_creator.pyx":65
6797  *             values[index + 1] = maximum
6798  *
6799  *         x = np.repeat(sample_rng, 2)             # <<<<<<<<<<<<<<
6800  *     else:
6801  *         x = np.arange(start, end, dtype=np.int64)
6802  */
6803     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
6804     __Pyx_GOTREF(__pyx_t_3);
6805     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_repeat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
6806     __Pyx_GOTREF(__pyx_t_7);
6807     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6808     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sample_rng, 1, (PyObject *(*)(char *)) __pyx_memview_get_PY_LONG_LONG, (int (*)(char *, PyObject *)) __pyx_memview_set_PY_LONG_LONG, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
6809     __Pyx_GOTREF(__pyx_t_3);
6810     __pyx_t_2 = NULL;
6811     __pyx_t_19 = 0;
6812     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6813       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
6814       if (likely(__pyx_t_2)) {
6815         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6816         __Pyx_INCREF(__pyx_t_2);
6817         __Pyx_INCREF(function);
6818         __Pyx_DECREF_SET(__pyx_t_7, function);
6819         __pyx_t_19 = 1;
6820       }
6821     }
6822     #if CYTHON_FAST_PYCALL
6823     if (PyFunction_Check(__pyx_t_7)) {
6824       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
6825       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
6826       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6827       __Pyx_GOTREF(__pyx_t_1);
6828       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6829     } else
6830     #endif
6831     #if CYTHON_FAST_PYCCALL
6832     if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
6833       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
6834       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
6835       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6836       __Pyx_GOTREF(__pyx_t_1);
6837       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6838     } else
6839     #endif
6840     {
6841       __pyx_t_5 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
6842       __Pyx_GOTREF(__pyx_t_5);
6843       if (__pyx_t_2) {
6844         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
6845       }
6846       __Pyx_GIVEREF(__pyx_t_3);
6847       PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_19, __pyx_t_3);
6848       __Pyx_INCREF(__pyx_int_2);
6849       __Pyx_GIVEREF(__pyx_int_2);
6850       PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_19, __pyx_int_2);
6851       __pyx_t_3 = 0;
6852       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
6853       __Pyx_GOTREF(__pyx_t_1);
6854       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6855     }
6856     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6857     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 65, __pyx_L1_error)
6858     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6859     __pyx_v_x = __pyx_t_20;
6860     __pyx_t_20.memview = NULL;
6861     __pyx_t_20.data = NULL;
6862 
6863     /* "urh/cythonext/path_creator.pyx":41
6864  *         num_threads = 1
6865  *
6866  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
6867  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
6868  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
6869  */
6870     goto __pyx_L4;
6871   }
6872 
6873   /* "urh/cythonext/path_creator.pyx":67
6874  *         x = np.repeat(sample_rng, 2)
6875  *     else:
6876  *         x = np.arange(start, end, dtype=np.int64)             # <<<<<<<<<<<<<<
6877  *         values = samples[start:end]
6878  *         scale_factor = 1.0
6879  */
6880   /*else*/ {
6881     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
6882     __Pyx_GOTREF(__pyx_t_1);
6883     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error)
6884     __Pyx_GOTREF(__pyx_t_7);
6885     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6886     __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
6887     __Pyx_GOTREF(__pyx_t_1);
6888     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
6889     __Pyx_GOTREF(__pyx_t_5);
6890     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
6891     __Pyx_GOTREF(__pyx_t_3);
6892     __Pyx_GIVEREF(__pyx_t_1);
6893     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
6894     __Pyx_GIVEREF(__pyx_t_5);
6895     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
6896     __pyx_t_1 = 0;
6897     __pyx_t_5 = 0;
6898     __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
6899     __Pyx_GOTREF(__pyx_t_5);
6900     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
6901     __Pyx_GOTREF(__pyx_t_1);
6902     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
6903     __Pyx_GOTREF(__pyx_t_2);
6904     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6905     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
6906     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6907     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
6908     __Pyx_GOTREF(__pyx_t_2);
6909     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6910     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6911     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6912     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 67, __pyx_L1_error)
6913     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6914     __pyx_v_x = __pyx_t_20;
6915     __pyx_t_20.memview = NULL;
6916     __pyx_t_20.data = NULL;
6917 
6918     /* "urh/cythonext/path_creator.pyx":68
6919  *     else:
6920  *         x = np.arange(start, end, dtype=np.int64)
6921  *         values = samples[start:end]             # <<<<<<<<<<<<<<
6922  *         scale_factor = 1.0
6923  *
6924  */
6925     __pyx_t_10.data = __pyx_v_samples.data;
6926     __pyx_t_10.memview = __pyx_v_samples.memview;
6927     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
6928     __pyx_t_19 = -1;
6929     if (unlikely(__pyx_memoryview_slice_memviewslice(
6930     &__pyx_t_10,
6931     __pyx_v_samples.shape[0], __pyx_v_samples.strides[0], __pyx_v_samples.suboffsets[0],
6932     0,
6933     0,
6934     &__pyx_t_19,
6935     __pyx_v_start,
6936     __pyx_v_end,
6937     0,
6938     1,
6939     1,
6940     0,
6941     1) < 0))
6942 {
6943     __PYX_ERR(0, 68, __pyx_L1_error)
6944 }
6945 
6946 __pyx_v_values = __pyx_t_10;
6947     __pyx_t_10.memview = NULL;
6948     __pyx_t_10.data = NULL;
6949 
6950     /* "urh/cythonext/path_creator.pyx":69
6951  *         x = np.arange(start, end, dtype=np.int64)
6952  *         values = samples[start:end]
6953  *         scale_factor = 1.0             # <<<<<<<<<<<<<<
6954  *
6955  *     cdef list result = []
6956  */
6957     __pyx_v_scale_factor = 1.0;
6958   }
6959   __pyx_L4:;
6960 
6961   /* "urh/cythonext/path_creator.pyx":71
6962  *         scale_factor = 1.0
6963  *
6964  *     cdef list result = []             # <<<<<<<<<<<<<<
6965  *     if scale_factor == 0:
6966  *         scale_factor = 1  # prevent division by zero
6967  */
6968   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
6969   __Pyx_GOTREF(__pyx_t_2);
6970   __pyx_v_result = ((PyObject*)__pyx_t_2);
6971   __pyx_t_2 = 0;
6972 
6973   /* "urh/cythonext/path_creator.pyx":72
6974  *
6975  *     cdef list result = []
6976  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
6977  *         scale_factor = 1  # prevent division by zero
6978  *
6979  */
6980   __pyx_t_4 = ((__pyx_v_scale_factor == 0.0) != 0);
6981   if (__pyx_t_4) {
6982 
6983     /* "urh/cythonext/path_creator.pyx":73
6984  *     cdef list result = []
6985  *     if scale_factor == 0:
6986  *         scale_factor = 1  # prevent division by zero             # <<<<<<<<<<<<<<
6987  *
6988  *     for subpath_range in subpath_ranges:
6989  */
6990     __pyx_v_scale_factor = 1.0;
6991 
6992     /* "urh/cythonext/path_creator.pyx":72
6993  *
6994  *     cdef list result = []
6995  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
6996  *         scale_factor = 1  # prevent division by zero
6997  *
6998  */
6999   }
7000 
7001   /* "urh/cythonext/path_creator.pyx":75
7002  *         scale_factor = 1  # prevent division by zero
7003  *
7004  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
7005  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
7006  *         sub_start =int(max(0, math.floor(sub_start)))
7007  */
7008   if (unlikely(__pyx_v_subpath_ranges == Py_None)) {
7009     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7010     __PYX_ERR(0, 75, __pyx_L1_error)
7011   }
7012   __pyx_t_2 = __pyx_v_subpath_ranges; __Pyx_INCREF(__pyx_t_2); __pyx_t_21 = 0;
7013   for (;;) {
7014     if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_2)) break;
7015     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7016     __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_21); __Pyx_INCREF(__pyx_t_5); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error)
7017     #else
7018     __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
7019     __Pyx_GOTREF(__pyx_t_5);
7020     #endif
7021     __Pyx_XDECREF_SET(__pyx_v_subpath_range, __pyx_t_5);
7022     __pyx_t_5 = 0;
7023 
7024     /* "urh/cythonext/path_creator.pyx":76
7025  *
7026  *     for subpath_range in subpath_ranges:
7027  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
7028  *         sub_start =int(max(0, math.floor(sub_start)))
7029  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
7030  */
7031     __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_subpath_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
7032     __Pyx_GOTREF(__pyx_t_5);
7033     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
7034     __Pyx_GOTREF(__pyx_t_3);
7035     __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
7036     __Pyx_GOTREF(__pyx_t_7);
7037     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7038     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7039     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
7040     __Pyx_GOTREF(__pyx_t_3);
7041     __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
7042     __Pyx_GOTREF(__pyx_t_5);
7043     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7044     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7045     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
7046     __Pyx_GOTREF(__pyx_t_3);
7047     __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
7048     __Pyx_GOTREF(__pyx_t_7);
7049     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7050     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7051     __pyx_t_3 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
7052     __Pyx_GOTREF(__pyx_t_3);
7053     __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
7054     __Pyx_GOTREF(__pyx_t_5);
7055     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7056     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7057     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
7058     __Pyx_GOTREF(__pyx_t_3);
7059     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
7060     __Pyx_GOTREF(__pyx_t_7);
7061     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7062     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7063     __Pyx_XDECREF_SET(__pyx_v_sub_start, __pyx_t_7);
7064     __pyx_t_7 = 0;
7065 
7066     /* "urh/cythonext/path_creator.pyx":77
7067  *     for subpath_range in subpath_ranges:
7068  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
7069  *         sub_start =int(max(0, math.floor(sub_start)))             # <<<<<<<<<<<<<<
7070  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
7071  *         sub_end = int(max(0, math.ceil(sub_end)))
7072  */
7073     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
7074     __Pyx_GOTREF(__pyx_t_3);
7075     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
7076     __Pyx_GOTREF(__pyx_t_5);
7077     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7078     __pyx_t_3 = NULL;
7079     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7080       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
7081       if (likely(__pyx_t_3)) {
7082         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7083         __Pyx_INCREF(__pyx_t_3);
7084         __Pyx_INCREF(function);
7085         __Pyx_DECREF_SET(__pyx_t_5, function);
7086       }
7087     }
7088     __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_sub_start) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_sub_start);
7089     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7090     if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
7091     __Pyx_GOTREF(__pyx_t_7);
7092     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7093     __pyx_t_22 = 0;
7094     __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
7095     __Pyx_GOTREF(__pyx_t_3);
7096     __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
7097     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7098     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 77, __pyx_L1_error)
7099     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7100     if (__pyx_t_4) {
7101       __Pyx_INCREF(__pyx_t_7);
7102       __pyx_t_5 = __pyx_t_7;
7103     } else {
7104       __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
7105       __Pyx_GOTREF(__pyx_t_1);
7106       __pyx_t_5 = __pyx_t_1;
7107       __pyx_t_1 = 0;
7108     }
7109     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7110     __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
7111     __Pyx_GOTREF(__pyx_t_7);
7112     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7113     __Pyx_DECREF_SET(__pyx_v_sub_start, __pyx_t_7);
7114     __pyx_t_7 = 0;
7115 
7116     /* "urh/cythonext/path_creator.pyx":78
7117  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
7118  *         sub_start =int(max(0, math.floor(sub_start)))
7119  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
7120  *         sub_end = int(max(0, math.ceil(sub_end)))
7121  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
7122  */
7123     __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_subpath_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
7124     __Pyx_GOTREF(__pyx_t_7);
7125     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
7126     __Pyx_GOTREF(__pyx_t_5);
7127     __pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
7128     __Pyx_GOTREF(__pyx_t_1);
7129     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7130     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7131     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
7132     __Pyx_GOTREF(__pyx_t_5);
7133     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
7134     __Pyx_GOTREF(__pyx_t_7);
7135     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7136     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7137     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
7138     __Pyx_GOTREF(__pyx_t_5);
7139     __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
7140     __Pyx_GOTREF(__pyx_t_1);
7141     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7142     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7143     __pyx_t_5 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
7144     __Pyx_GOTREF(__pyx_t_5);
7145     __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
7146     __Pyx_GOTREF(__pyx_t_7);
7147     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7148     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7149     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
7150     __Pyx_GOTREF(__pyx_t_5);
7151     __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
7152     __Pyx_GOTREF(__pyx_t_1);
7153     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7154     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7155     __Pyx_XDECREF_SET(__pyx_v_sub_end, __pyx_t_1);
7156     __pyx_t_1 = 0;
7157 
7158     /* "urh/cythonext/path_creator.pyx":79
7159  *         sub_start =int(max(0, math.floor(sub_start)))
7160  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
7161  *         sub_end = int(max(0, math.ceil(sub_end)))             # <<<<<<<<<<<<<<
7162  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
7163  *
7164  */
7165     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
7166     __Pyx_GOTREF(__pyx_t_5);
7167     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ceil); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
7168     __Pyx_GOTREF(__pyx_t_7);
7169     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7170     __pyx_t_5 = NULL;
7171     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7172       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
7173       if (likely(__pyx_t_5)) {
7174         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7175         __Pyx_INCREF(__pyx_t_5);
7176         __Pyx_INCREF(function);
7177         __Pyx_DECREF_SET(__pyx_t_7, function);
7178       }
7179     }
7180     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_sub_end) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_sub_end);
7181     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7182     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
7183     __Pyx_GOTREF(__pyx_t_1);
7184     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7185     __pyx_t_22 = 0;
7186     __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
7187     __Pyx_GOTREF(__pyx_t_5);
7188     __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
7189     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7190     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
7191     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7192     if (__pyx_t_4) {
7193       __Pyx_INCREF(__pyx_t_1);
7194       __pyx_t_7 = __pyx_t_1;
7195     } else {
7196       __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
7197       __Pyx_GOTREF(__pyx_t_3);
7198       __pyx_t_7 = __pyx_t_3;
7199       __pyx_t_3 = 0;
7200     }
7201     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7202     __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
7203     __Pyx_GOTREF(__pyx_t_1);
7204     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7205     __Pyx_DECREF_SET(__pyx_v_sub_end, __pyx_t_1);
7206     __pyx_t_1 = 0;
7207 
7208     /* "urh/cythonext/path_creator.pyx":80
7209  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
7210  *         sub_end = int(max(0, math.ceil(sub_end)))
7211  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))             # <<<<<<<<<<<<<<
7212  *
7213  *     return result
7214  */
7215     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
7216     __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
7217     __pyx_t_20.data = __pyx_v_x.data;
7218     __pyx_t_20.memview = __pyx_v_x.memview;
7219     __PYX_INC_MEMVIEW(&__pyx_t_20, 0);
7220     __pyx_t_19 = -1;
7221     if (unlikely(__pyx_memoryview_slice_memviewslice(
7222     &__pyx_t_20,
7223     __pyx_v_x.shape[0], __pyx_v_x.strides[0], __pyx_v_x.suboffsets[0],
7224     0,
7225     0,
7226     &__pyx_t_19,
7227     __pyx_t_23,
7228     __pyx_t_24,
7229     0,
7230     1,
7231     1,
7232     0,
7233     1) < 0))
7234 {
7235     __PYX_ERR(0, 80, __pyx_L1_error)
7236 }
7237 
7238 __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
7239     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
7240     __pyx_t_10.data = __pyx_v_values.data;
7241     __pyx_t_10.memview = __pyx_v_values.memview;
7242     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
7243     __pyx_t_19 = -1;
7244     if (unlikely(__pyx_memoryview_slice_memviewslice(
7245     &__pyx_t_10,
7246     __pyx_v_values.shape[0], __pyx_v_values.strides[0], __pyx_v_values.suboffsets[0],
7247     0,
7248     0,
7249     &__pyx_t_19,
7250     __pyx_t_24,
7251     __pyx_t_23,
7252     0,
7253     1,
7254     1,
7255     0,
7256     1) < 0))
7257 {
7258     __PYX_ERR(0, 80, __pyx_L1_error)
7259 }
7260 
7261 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_10, 1, (PyObject *(*)(char *)) __pyx_memview_get_short, (int (*)(char *, PyObject *)) __pyx_memview_set_short, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
7262     __Pyx_GOTREF(__pyx_t_1);
7263     __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
7264     __pyx_t_10.memview = NULL;
7265     __pyx_t_10.data = NULL;
7266     __pyx_t_7 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_20, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
7267     __Pyx_GOTREF(__pyx_t_7);
7268     __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
7269     __pyx_t_20.memview = NULL;
7270     __pyx_t_20.data = NULL;
7271     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7272     __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error)
7273     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7274 
7275     /* "urh/cythonext/path_creator.pyx":75
7276  *         scale_factor = 1  # prevent division by zero
7277  *
7278  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
7279  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
7280  *         sub_start =int(max(0, math.floor(sub_start)))
7281  */
7282   }
7283   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7284 
7285   /* "urh/cythonext/path_creator.pyx":82
7286  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
7287  *
7288  *     return result             # <<<<<<<<<<<<<<
7289  *
7290  *
7291  */
7292   __Pyx_XDECREF(__pyx_r);
7293   __Pyx_INCREF(__pyx_v_result);
7294   __pyx_r = __pyx_v_result;
7295   goto __pyx_L0;
7296 
7297   /* "urh/cythonext/path_creator.pyx":19
7298  * import struct
7299  *
7300  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
7301  *     cdef iq[:] values
7302  *     cdef long long[::1] sample_rng
7303  */
7304 
7305   /* function exit code */
7306   __pyx_L1_error:;
7307   __Pyx_XDECREF(__pyx_t_1);
7308   __Pyx_XDECREF(__pyx_t_2);
7309   __Pyx_XDECREF(__pyx_t_3);
7310   __Pyx_XDECREF(__pyx_t_5);
7311   __Pyx_XDECREF(__pyx_t_7);
7312   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
7313   __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
7314   __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
7315   __Pyx_AddTraceback("urh.cythonext.path_creator.create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
7316   __pyx_r = 0;
7317   __pyx_L0:;
7318   __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
7319   __PYX_XDEC_MEMVIEW(&__pyx_v_sample_rng, 1);
7320   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
7321   __Pyx_XDECREF(__pyx_v_type_lookup);
7322   __Pyx_XDECREF(__pyx_v_result);
7323   __Pyx_XDECREF(__pyx_v_subpath_range);
7324   __Pyx_XDECREF(__pyx_v_sub_start);
7325   __Pyx_XDECREF(__pyx_v_sub_end);
7326   __Pyx_XDECREF(__pyx_v_subpath_ranges);
7327   __Pyx_XGIVEREF(__pyx_r);
7328   __Pyx_RefNannyFinishContext();
7329   return __pyx_r;
7330 }
7331 
7332 /* Python wrapper */
7333 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_11__pyx_fuse_2create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7334 static PyMethodDef __pyx_fuse_2__pyx_mdef_3urh_9cythonext_12path_creator_11__pyx_fuse_2create_path = {"__pyx_fuse_2create_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_11__pyx_fuse_2create_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_11__pyx_fuse_2create_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7335 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_11__pyx_fuse_2create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7336   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
7337   PY_LONG_LONG __pyx_v_start;
7338   PY_LONG_LONG __pyx_v_end;
7339   PyObject *__pyx_v_subpath_ranges = 0;
7340   int __pyx_lineno = 0;
7341   const char *__pyx_filename = NULL;
7342   int __pyx_clineno = 0;
7343   PyObject *__pyx_r = 0;
7344   __Pyx_RefNannyDeclarations
7345   __Pyx_RefNannySetupContext("__pyx_fuse_2create_path (wrapper)", 0);
7346   {
7347     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_subpath_ranges,0};
7348     PyObject* values[4] = {0,0,0,0};
7349     values[3] = __pyx_k__8;
7350     if (unlikely(__pyx_kwds)) {
7351       Py_ssize_t kw_args;
7352       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7353       switch (pos_args) {
7354         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7355         CYTHON_FALLTHROUGH;
7356         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7357         CYTHON_FALLTHROUGH;
7358         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7359         CYTHON_FALLTHROUGH;
7360         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7361         CYTHON_FALLTHROUGH;
7362         case  0: break;
7363         default: goto __pyx_L5_argtuple_error;
7364       }
7365       kw_args = PyDict_Size(__pyx_kwds);
7366       switch (pos_args) {
7367         case  0:
7368         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
7369         else goto __pyx_L5_argtuple_error;
7370         CYTHON_FALLTHROUGH;
7371         case  1:
7372         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
7373         else {
7374           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2create_path", 0, 3, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
7375         }
7376         CYTHON_FALLTHROUGH;
7377         case  2:
7378         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
7379         else {
7380           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2create_path", 0, 3, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
7381         }
7382         CYTHON_FALLTHROUGH;
7383         case  3:
7384         if (kw_args > 0) {
7385           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subpath_ranges);
7386           if (value) { values[3] = value; kw_args--; }
7387         }
7388       }
7389       if (unlikely(kw_args > 0)) {
7390         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2create_path") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
7391       }
7392     } else {
7393       switch (PyTuple_GET_SIZE(__pyx_args)) {
7394         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7395         CYTHON_FALLTHROUGH;
7396         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7397         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7398         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7399         break;
7400         default: goto __pyx_L5_argtuple_error;
7401       }
7402     }
7403     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 19, __pyx_L3_error)
7404     __pyx_v_start = __Pyx_PyInt_As_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_start == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
7405     __pyx_v_end = __Pyx_PyInt_As_PY_LONG_LONG(values[2]); if (unlikely((__pyx_v_end == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
7406     __pyx_v_subpath_ranges = ((PyObject*)values[3]);
7407   }
7408   goto __pyx_L4_argument_unpacking_done;
7409   __pyx_L5_argtuple_error:;
7410   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2create_path", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
7411   __pyx_L3_error:;
7412   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_2create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
7413   __Pyx_RefNannyFinishContext();
7414   return NULL;
7415   __pyx_L4_argument_unpacking_done:;
7416   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subpath_ranges), (&PyList_Type), 1, "subpath_ranges", 1))) __PYX_ERR(0, 19, __pyx_L1_error)
7417   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_10__pyx_fuse_2create_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end, __pyx_v_subpath_ranges);
7418 
7419   /* function exit code */
7420   goto __pyx_L0;
7421   __pyx_L1_error:;
7422   __pyx_r = NULL;
7423   __pyx_L0:;
7424   __Pyx_RefNannyFinishContext();
7425   return __pyx_r;
7426 }
7427 
__pyx_pf_3urh_9cythonext_12path_creator_10__pyx_fuse_2create_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,PyObject * __pyx_v_subpath_ranges)7428 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_10__pyx_fuse_2create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges) {
7429   PyObject *__pyx_r = NULL;
7430   __Pyx_RefNannyDeclarations
7431   PyObject *__pyx_t_1 = NULL;
7432   struct __pyx_fuse_2__pyx_opt_args_3urh_9cythonext_12path_creator_create_path __pyx_t_2;
7433   int __pyx_lineno = 0;
7434   const char *__pyx_filename = NULL;
7435   int __pyx_clineno = 0;
7436   __Pyx_RefNannySetupContext("__pyx_fuse_2create_path", 0);
7437   __Pyx_XDECREF(__pyx_r);
7438   __pyx_t_2.__pyx_n = 1;
7439   __pyx_t_2.subpath_ranges = __pyx_v_subpath_ranges;
7440   __pyx_t_1 = __pyx_fuse_2__pyx_f_3urh_9cythonext_12path_creator_create_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
7441   __Pyx_GOTREF(__pyx_t_1);
7442   __pyx_r = __pyx_t_1;
7443   __pyx_t_1 = 0;
7444   goto __pyx_L0;
7445 
7446   /* function exit code */
7447   __pyx_L1_error:;
7448   __Pyx_XDECREF(__pyx_t_1);
7449   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_2create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
7450   __pyx_r = NULL;
7451   __pyx_L0:;
7452   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
7453   __Pyx_XGIVEREF(__pyx_r);
7454   __Pyx_RefNannyFinishContext();
7455   return __pyx_r;
7456 }
7457 
7458 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_13__pyx_fuse_3create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7459 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_3__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_fuse_3__pyx_opt_args_3urh_9cythonext_12path_creator_create_path * __pyx_optional_args)7460 static PyObject *__pyx_fuse_3__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_fuse_3__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args) {
7461   PyObject *__pyx_v_subpath_ranges = __pyx_k__9;
7462   __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
7463   __Pyx_memviewslice __pyx_v_sample_rng = { 0, 0, { 0 }, { 0 }, { 0 } };
7464   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
7465   unsigned short __pyx_v_sample;
7466   unsigned short __pyx_v_minimum;
7467   unsigned short __pyx_v_maximum;
7468   unsigned short __pyx_v_tmp;
7469   float __pyx_v_scale_factor;
7470   PY_LONG_LONG __pyx_v_i;
7471   PY_LONG_LONG __pyx_v_j;
7472   PY_LONG_LONG __pyx_v_index;
7473   PY_LONG_LONG __pyx_v_chunk_end;
7474   PY_LONG_LONG __pyx_v_num_samples;
7475   PY_LONG_LONG __pyx_v_pixels_on_path;
7476   PY_LONG_LONG __pyx_v_samples_per_pixel;
7477   PyObject *__pyx_v_type_lookup = 0;
7478   CYTHON_UNUSED int __pyx_v_num_threads;
7479   PyObject *__pyx_v_result = 0;
7480   PyObject *__pyx_v_subpath_range = NULL;
7481   PyObject *__pyx_v_sub_start = NULL;
7482   PyObject *__pyx_v_sub_end = NULL;
7483   PyObject *__pyx_r = NULL;
7484   __Pyx_RefNannyDeclarations
7485   PyObject *__pyx_t_1 = NULL;
7486   PyObject *__pyx_t_2 = NULL;
7487   PyObject *__pyx_t_3 = NULL;
7488   int __pyx_t_4;
7489   PyObject *__pyx_t_5 = NULL;
7490   PY_LONG_LONG __pyx_t_6;
7491   PyObject *__pyx_t_7 = NULL;
7492   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
7493   size_t __pyx_t_9;
7494   __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
7495   PY_LONG_LONG __pyx_t_11;
7496   PY_LONG_LONG __pyx_t_12;
7497   PY_LONG_LONG __pyx_t_13;
7498   PY_LONG_LONG __pyx_t_14;
7499   PY_LONG_LONG __pyx_t_15;
7500   PY_LONG_LONG __pyx_t_16;
7501   PY_LONG_LONG __pyx_t_17;
7502   PY_LONG_LONG __pyx_t_18;
7503   int __pyx_t_19;
7504   __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
7505   Py_ssize_t __pyx_t_21;
7506   long __pyx_t_22;
7507   Py_ssize_t __pyx_t_23;
7508   Py_ssize_t __pyx_t_24;
7509   int __pyx_t_25;
7510   int __pyx_lineno = 0;
7511   const char *__pyx_filename = NULL;
7512   int __pyx_clineno = 0;
7513   __Pyx_RefNannySetupContext("__pyx_fuse_3create_path", 0);
7514   if (__pyx_optional_args) {
7515     if (__pyx_optional_args->__pyx_n > 0) {
7516       __pyx_v_subpath_ranges = __pyx_optional_args->subpath_ranges;
7517     }
7518   }
7519   __Pyx_INCREF(__pyx_v_subpath_ranges);
7520 
7521   /* "urh/cythonext/path_creator.pyx":26
7522  *     cdef float scale_factor
7523  *     cdef long long i,j,index, chunk_end, num_samples, pixels_on_path, samples_per_pixel
7524  *     num_samples = end - start             # <<<<<<<<<<<<<<
7525  *
7526  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
7527  */
7528   __pyx_v_num_samples = (__pyx_v_end - __pyx_v_start);
7529 
7530   /* "urh/cythonext/path_creator.pyx":28
7531  *     num_samples = end - start
7532  *
7533  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,             # <<<<<<<<<<<<<<
7534  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
7535  *                              "float[:]": np.float32, "double[:]": np.float64}
7536  */
7537   __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
7538   __Pyx_GOTREF(__pyx_t_1);
7539   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
7540   __Pyx_GOTREF(__pyx_t_2);
7541   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
7542   __Pyx_GOTREF(__pyx_t_3);
7543   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7544   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_char_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
7545   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7546   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
7547   __Pyx_GOTREF(__pyx_t_3);
7548   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
7549   __Pyx_GOTREF(__pyx_t_2);
7550   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7551   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_char_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
7552   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7553 
7554   /* "urh/cythonext/path_creator.pyx":29
7555  *
7556  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
7557  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,             # <<<<<<<<<<<<<<
7558  *                              "float[:]": np.float32, "double[:]": np.float64}
7559  *
7560  */
7561   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
7562   __Pyx_GOTREF(__pyx_t_2);
7563   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
7564   __Pyx_GOTREF(__pyx_t_3);
7565   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7566   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_short_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
7567   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7568   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
7569   __Pyx_GOTREF(__pyx_t_3);
7570   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
7571   __Pyx_GOTREF(__pyx_t_2);
7572   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7573   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_short_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
7574   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7575 
7576   /* "urh/cythonext/path_creator.pyx":30
7577  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
7578  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
7579  *                              "float[:]": np.float32, "double[:]": np.float64}             # <<<<<<<<<<<<<<
7580  *
7581  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
7582  */
7583   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
7584   __Pyx_GOTREF(__pyx_t_2);
7585   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
7586   __Pyx_GOTREF(__pyx_t_3);
7587   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7588   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_float_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
7589   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7590   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
7591   __Pyx_GOTREF(__pyx_t_3);
7592   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
7593   __Pyx_GOTREF(__pyx_t_2);
7594   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7595   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_double, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
7596   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7597   __pyx_v_type_lookup = ((PyObject*)__pyx_t_1);
7598   __pyx_t_1 = 0;
7599 
7600   /* "urh/cythonext/path_creator.pyx":32
7601  *                              "float[:]": np.float32, "double[:]": np.float64}
7602  *
7603  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges             # <<<<<<<<<<<<<<
7604  *     pixels_on_path = settings.PIXELS_PER_PATH
7605  *
7606  */
7607   __pyx_t_4 = (__pyx_v_subpath_ranges == ((PyObject*)Py_None));
7608   if ((__pyx_t_4 != 0)) {
7609     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
7610     __Pyx_GOTREF(__pyx_t_2);
7611     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
7612     __Pyx_GOTREF(__pyx_t_3);
7613     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error)
7614     __Pyx_GOTREF(__pyx_t_5);
7615     __Pyx_GIVEREF(__pyx_t_2);
7616     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
7617     __Pyx_GIVEREF(__pyx_t_3);
7618     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
7619     __pyx_t_2 = 0;
7620     __pyx_t_3 = 0;
7621     __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
7622     __Pyx_GOTREF(__pyx_t_3);
7623     __Pyx_GIVEREF(__pyx_t_5);
7624     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
7625     __pyx_t_5 = 0;
7626     __pyx_t_1 = __pyx_t_3;
7627     __pyx_t_3 = 0;
7628   } else {
7629     __Pyx_INCREF(__pyx_v_subpath_ranges);
7630     __pyx_t_1 = __pyx_v_subpath_ranges;
7631   }
7632   __Pyx_DECREF_SET(__pyx_v_subpath_ranges, ((PyObject*)__pyx_t_1));
7633   __pyx_t_1 = 0;
7634 
7635   /* "urh/cythonext/path_creator.pyx":33
7636  *
7637  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
7638  *     pixels_on_path = settings.PIXELS_PER_PATH             # <<<<<<<<<<<<<<
7639  *
7640  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
7641  */
7642   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
7643   __Pyx_GOTREF(__pyx_t_1);
7644   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PIXELS_PER_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
7645   __Pyx_GOTREF(__pyx_t_3);
7646   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7647   __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error)
7648   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7649   __pyx_v_pixels_on_path = __pyx_t_6;
7650 
7651   /* "urh/cythonext/path_creator.pyx":35
7652  *     pixels_on_path = settings.PIXELS_PER_PATH
7653  *
7654  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)             # <<<<<<<<<<<<<<
7655  *
7656  *     cdef int num_threads = 0
7657  */
7658   __pyx_v_samples_per_pixel = ((PY_LONG_LONG)(__pyx_v_num_samples / __pyx_v_pixels_on_path));
7659 
7660   /* "urh/cythonext/path_creator.pyx":37
7661  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
7662  *
7663  *     cdef int num_threads = 0             # <<<<<<<<<<<<<<
7664  *     if samples_per_pixel < 20000:
7665  *         num_threads = 1
7666  */
7667   __pyx_v_num_threads = 0;
7668 
7669   /* "urh/cythonext/path_creator.pyx":38
7670  *
7671  *     cdef int num_threads = 0
7672  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
7673  *         num_threads = 1
7674  *
7675  */
7676   __pyx_t_4 = ((__pyx_v_samples_per_pixel < 0x4E20) != 0);
7677   if (__pyx_t_4) {
7678 
7679     /* "urh/cythonext/path_creator.pyx":39
7680  *     cdef int num_threads = 0
7681  *     if samples_per_pixel < 20000:
7682  *         num_threads = 1             # <<<<<<<<<<<<<<
7683  *
7684  *     if samples_per_pixel > 1:
7685  */
7686     __pyx_v_num_threads = 1;
7687 
7688     /* "urh/cythonext/path_creator.pyx":38
7689  *
7690  *     cdef int num_threads = 0
7691  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
7692  *         num_threads = 1
7693  *
7694  */
7695   }
7696 
7697   /* "urh/cythonext/path_creator.pyx":41
7698  *         num_threads = 1
7699  *
7700  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
7701  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
7702  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
7703  */
7704   __pyx_t_4 = ((__pyx_v_samples_per_pixel > 1) != 0);
7705   if (__pyx_t_4) {
7706 
7707     /* "urh/cythonext/path_creator.pyx":42
7708  *
7709  *     if samples_per_pixel > 1:
7710  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)             # <<<<<<<<<<<<<<
7711  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
7712  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
7713  */
7714     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
7715     __Pyx_GOTREF(__pyx_t_3);
7716     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
7717     __Pyx_GOTREF(__pyx_t_1);
7718     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7719     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
7720     __Pyx_GOTREF(__pyx_t_3);
7721     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
7722     __Pyx_GOTREF(__pyx_t_5);
7723     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_samples_per_pixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
7724     __Pyx_GOTREF(__pyx_t_2);
7725     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
7726     __Pyx_GOTREF(__pyx_t_7);
7727     __Pyx_GIVEREF(__pyx_t_3);
7728     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
7729     __Pyx_GIVEREF(__pyx_t_5);
7730     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
7731     __Pyx_GIVEREF(__pyx_t_2);
7732     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
7733     __pyx_t_3 = 0;
7734     __pyx_t_5 = 0;
7735     __pyx_t_2 = 0;
7736     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
7737     __Pyx_GOTREF(__pyx_t_2);
7738     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
7739     __Pyx_GOTREF(__pyx_t_5);
7740     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
7741     __Pyx_GOTREF(__pyx_t_3);
7742     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7743     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
7744     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7745     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
7746     __Pyx_GOTREF(__pyx_t_3);
7747     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7748     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7749     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7750     __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 42, __pyx_L1_error)
7751     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7752     __pyx_v_sample_rng = __pyx_t_8;
7753     __pyx_t_8.memview = NULL;
7754     __pyx_t_8.data = NULL;
7755 
7756     /* "urh/cythonext/path_creator.pyx":43
7757  *     if samples_per_pixel > 1:
7758  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
7759  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")             # <<<<<<<<<<<<<<
7760  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
7761  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
7762  */
7763     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
7764     __Pyx_GOTREF(__pyx_t_3);
7765     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
7766     __Pyx_GOTREF(__pyx_t_2);
7767     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7768     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
7769     __pyx_t_3 = PyInt_FromSsize_t((2 * __pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
7770     __Pyx_GOTREF(__pyx_t_3);
7771     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
7772     __Pyx_GOTREF(__pyx_t_7);
7773     __Pyx_GIVEREF(__pyx_t_3);
7774     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
7775     __pyx_t_3 = 0;
7776     __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
7777     __Pyx_GOTREF(__pyx_t_3);
7778     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_type_lookup, __pyx_kp_s_unsigned_short_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
7779     __Pyx_GOTREF(__pyx_t_1);
7780     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
7781     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7782     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
7783     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
7784     __Pyx_GOTREF(__pyx_t_1);
7785     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7786     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7787     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7788     __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 43, __pyx_L1_error)
7789     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7790     __pyx_v_values = __pyx_t_10;
7791     __pyx_t_10.memview = NULL;
7792     __pyx_t_10.data = NULL;
7793 
7794     /* "urh/cythonext/path_creator.pyx":44
7795  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
7796  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
7797  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!             # <<<<<<<<<<<<<<
7798  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
7799  *             chunk_end = i + samples_per_pixel
7800  */
7801     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
7802     __pyx_v_scale_factor = (((double)__pyx_v_num_samples) / (2.0 * __pyx_t_9));
7803 
7804     /* "urh/cythonext/path_creator.pyx":45
7805  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
7806  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
7807  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
7808  *             chunk_end = i + samples_per_pixel
7809  *             if chunk_end >= end:
7810  */
7811     {
7812         #ifdef WITH_THREAD
7813         PyThreadState *_save;
7814         Py_UNBLOCK_THREADS
7815         __Pyx_FastGIL_Remember();
7816         #endif
7817         /*try:*/ {
7818           __pyx_t_6 = __pyx_v_start;
7819           __pyx_t_11 = __pyx_v_end;
7820           __pyx_t_12 = __pyx_v_samples_per_pixel;
7821           if ((__pyx_t_12 == 0)) abort();
7822           {
7823               #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
7824                   #undef likely
7825                   #undef unlikely
7826                   #define likely(x)   (x)
7827                   #define unlikely(x) (x)
7828               #endif
7829               __pyx_t_14 = (__pyx_t_11 - __pyx_t_6 + __pyx_t_12 - __pyx_t_12/abs(__pyx_t_12)) / __pyx_t_12;
7830               if (__pyx_t_14 > 0)
7831               {
7832                   #ifdef _OPENMP
7833                   #pragma omp parallel num_threads(__pyx_v_num_threads) private(__pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_4)
7834                   #endif /* _OPENMP */
7835                   {
7836                       #ifdef _OPENMP
7837                       #pragma omp for lastprivate(__pyx_v_chunk_end) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_index) lastprivate(__pyx_v_j) lastprivate(__pyx_v_maximum) lastprivate(__pyx_v_minimum) lastprivate(__pyx_v_sample) lastprivate(__pyx_v_tmp) schedule(static)
7838                       #endif /* _OPENMP */
7839                       for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13++){
7840                           {
7841                               __pyx_v_i = (PY_LONG_LONG)(__pyx_t_6 + __pyx_t_12 * __pyx_t_13);
7842                               /* Initialize private variables to invalid values */
7843                               __pyx_v_chunk_end = ((PY_LONG_LONG)0xbad0bad0);
7844                               __pyx_v_index = ((PY_LONG_LONG)0xbad0bad0);
7845                               __pyx_v_j = ((PY_LONG_LONG)0xbad0bad0);
7846                               __pyx_v_maximum = ((unsigned short)0xbad0bad0);
7847                               __pyx_v_minimum = ((unsigned short)0xbad0bad0);
7848                               __pyx_v_sample = ((unsigned short)0xbad0bad0);
7849                               __pyx_v_tmp = ((unsigned short)0xbad0bad0);
7850 
7851                               /* "urh/cythonext/path_creator.pyx":46
7852  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
7853  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
7854  *             chunk_end = i + samples_per_pixel             # <<<<<<<<<<<<<<
7855  *             if chunk_end >= end:
7856  *                 chunk_end = end
7857  */
7858                               __pyx_v_chunk_end = (__pyx_v_i + __pyx_v_samples_per_pixel);
7859 
7860                               /* "urh/cythonext/path_creator.pyx":47
7861  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
7862  *             chunk_end = i + samples_per_pixel
7863  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
7864  *                 chunk_end = end
7865  *
7866  */
7867                               __pyx_t_4 = ((__pyx_v_chunk_end >= __pyx_v_end) != 0);
7868                               if (__pyx_t_4) {
7869 
7870                                 /* "urh/cythonext/path_creator.pyx":48
7871  *             chunk_end = i + samples_per_pixel
7872  *             if chunk_end >= end:
7873  *                 chunk_end = end             # <<<<<<<<<<<<<<
7874  *
7875  *             tmp = samples[i]
7876  */
7877                                 __pyx_v_chunk_end = __pyx_v_end;
7878 
7879                                 /* "urh/cythonext/path_creator.pyx":47
7880  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
7881  *             chunk_end = i + samples_per_pixel
7882  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
7883  *                 chunk_end = end
7884  *
7885  */
7886                               }
7887 
7888                               /* "urh/cythonext/path_creator.pyx":50
7889  *                 chunk_end = end
7890  *
7891  *             tmp = samples[i]             # <<<<<<<<<<<<<<
7892  *             minimum = tmp
7893  *             maximum = tmp
7894  */
7895                               __pyx_t_15 = __pyx_v_i;
7896                               __pyx_v_tmp = (*((unsigned short *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_15 * __pyx_v_samples.strides[0]) )));
7897 
7898                               /* "urh/cythonext/path_creator.pyx":51
7899  *
7900  *             tmp = samples[i]
7901  *             minimum = tmp             # <<<<<<<<<<<<<<
7902  *             maximum = tmp
7903  *
7904  */
7905                               __pyx_v_minimum = __pyx_v_tmp;
7906 
7907                               /* "urh/cythonext/path_creator.pyx":52
7908  *             tmp = samples[i]
7909  *             minimum = tmp
7910  *             maximum = tmp             # <<<<<<<<<<<<<<
7911  *
7912  *             for j in range(i + 1, chunk_end):
7913  */
7914                               __pyx_v_maximum = __pyx_v_tmp;
7915 
7916                               /* "urh/cythonext/path_creator.pyx":54
7917  *             maximum = tmp
7918  *
7919  *             for j in range(i + 1, chunk_end):             # <<<<<<<<<<<<<<
7920  *                 sample = samples[j]
7921  *                 if sample < minimum:
7922  */
7923                               __pyx_t_15 = __pyx_v_chunk_end;
7924                               __pyx_t_16 = __pyx_t_15;
7925                               for (__pyx_t_17 = (__pyx_v_i + 1); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
7926                                 __pyx_v_j = __pyx_t_17;
7927 
7928                                 /* "urh/cythonext/path_creator.pyx":55
7929  *
7930  *             for j in range(i + 1, chunk_end):
7931  *                 sample = samples[j]             # <<<<<<<<<<<<<<
7932  *                 if sample < minimum:
7933  *                     minimum = sample
7934  */
7935                                 __pyx_t_18 = __pyx_v_j;
7936                                 __pyx_v_sample = (*((unsigned short *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )));
7937 
7938                                 /* "urh/cythonext/path_creator.pyx":56
7939  *             for j in range(i + 1, chunk_end):
7940  *                 sample = samples[j]
7941  *                 if sample < minimum:             # <<<<<<<<<<<<<<
7942  *                     minimum = sample
7943  *                 elif sample > maximum:
7944  */
7945                                 __pyx_t_4 = ((__pyx_v_sample < __pyx_v_minimum) != 0);
7946                                 if (__pyx_t_4) {
7947 
7948                                   /* "urh/cythonext/path_creator.pyx":57
7949  *                 sample = samples[j]
7950  *                 if sample < minimum:
7951  *                     minimum = sample             # <<<<<<<<<<<<<<
7952  *                 elif sample > maximum:
7953  *                     maximum = sample
7954  */
7955                                   __pyx_v_minimum = __pyx_v_sample;
7956 
7957                                   /* "urh/cythonext/path_creator.pyx":56
7958  *             for j in range(i + 1, chunk_end):
7959  *                 sample = samples[j]
7960  *                 if sample < minimum:             # <<<<<<<<<<<<<<
7961  *                     minimum = sample
7962  *                 elif sample > maximum:
7963  */
7964                                   goto __pyx_L15;
7965                                 }
7966 
7967                                 /* "urh/cythonext/path_creator.pyx":58
7968  *                 if sample < minimum:
7969  *                     minimum = sample
7970  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
7971  *                     maximum = sample
7972  *
7973  */
7974                                 __pyx_t_4 = ((__pyx_v_sample > __pyx_v_maximum) != 0);
7975                                 if (__pyx_t_4) {
7976 
7977                                   /* "urh/cythonext/path_creator.pyx":59
7978  *                     minimum = sample
7979  *                 elif sample > maximum:
7980  *                     maximum = sample             # <<<<<<<<<<<<<<
7981  *
7982  *             index = <long long>(2*(i-start)/samples_per_pixel)
7983  */
7984                                   __pyx_v_maximum = __pyx_v_sample;
7985 
7986                                   /* "urh/cythonext/path_creator.pyx":58
7987  *                 if sample < minimum:
7988  *                     minimum = sample
7989  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
7990  *                     maximum = sample
7991  *
7992  */
7993                                 }
7994                                 __pyx_L15:;
7995                               }
7996 
7997                               /* "urh/cythonext/path_creator.pyx":61
7998  *                     maximum = sample
7999  *
8000  *             index = <long long>(2*(i-start)/samples_per_pixel)             # <<<<<<<<<<<<<<
8001  *             values[index] = minimum
8002  *             values[index + 1] = maximum
8003  */
8004                               __pyx_v_index = ((PY_LONG_LONG)((2 * (__pyx_v_i - __pyx_v_start)) / __pyx_v_samples_per_pixel));
8005 
8006                               /* "urh/cythonext/path_creator.pyx":62
8007  *
8008  *             index = <long long>(2*(i-start)/samples_per_pixel)
8009  *             values[index] = minimum             # <<<<<<<<<<<<<<
8010  *             values[index + 1] = maximum
8011  *
8012  */
8013                               __pyx_t_15 = __pyx_v_index;
8014                               *((unsigned short *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_minimum;
8015 
8016                               /* "urh/cythonext/path_creator.pyx":63
8017  *             index = <long long>(2*(i-start)/samples_per_pixel)
8018  *             values[index] = minimum
8019  *             values[index + 1] = maximum             # <<<<<<<<<<<<<<
8020  *
8021  *         x = np.repeat(sample_rng, 2)
8022  */
8023                               __pyx_t_15 = (__pyx_v_index + 1);
8024                               *((unsigned short *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_maximum;
8025                           }
8026                       }
8027                   }
8028               }
8029           }
8030           #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
8031               #undef likely
8032               #undef unlikely
8033               #define likely(x)   __builtin_expect(!!(x), 1)
8034               #define unlikely(x) __builtin_expect(!!(x), 0)
8035           #endif
8036         }
8037 
8038         /* "urh/cythonext/path_creator.pyx":45
8039  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
8040  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
8041  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
8042  *             chunk_end = i + samples_per_pixel
8043  *             if chunk_end >= end:
8044  */
8045         /*finally:*/ {
8046           /*normal exit:*/{
8047             #ifdef WITH_THREAD
8048             __Pyx_FastGIL_Forget();
8049             Py_BLOCK_THREADS
8050             #endif
8051             goto __pyx_L7;
8052           }
8053           __pyx_L7:;
8054         }
8055     }
8056 
8057     /* "urh/cythonext/path_creator.pyx":65
8058  *             values[index + 1] = maximum
8059  *
8060  *         x = np.repeat(sample_rng, 2)             # <<<<<<<<<<<<<<
8061  *     else:
8062  *         x = np.arange(start, end, dtype=np.int64)
8063  */
8064     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
8065     __Pyx_GOTREF(__pyx_t_3);
8066     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_repeat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
8067     __Pyx_GOTREF(__pyx_t_7);
8068     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8069     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sample_rng, 1, (PyObject *(*)(char *)) __pyx_memview_get_PY_LONG_LONG, (int (*)(char *, PyObject *)) __pyx_memview_set_PY_LONG_LONG, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
8070     __Pyx_GOTREF(__pyx_t_3);
8071     __pyx_t_2 = NULL;
8072     __pyx_t_19 = 0;
8073     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
8074       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
8075       if (likely(__pyx_t_2)) {
8076         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
8077         __Pyx_INCREF(__pyx_t_2);
8078         __Pyx_INCREF(function);
8079         __Pyx_DECREF_SET(__pyx_t_7, function);
8080         __pyx_t_19 = 1;
8081       }
8082     }
8083     #if CYTHON_FAST_PYCALL
8084     if (PyFunction_Check(__pyx_t_7)) {
8085       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
8086       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
8087       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8088       __Pyx_GOTREF(__pyx_t_1);
8089       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8090     } else
8091     #endif
8092     #if CYTHON_FAST_PYCCALL
8093     if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
8094       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
8095       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
8096       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8097       __Pyx_GOTREF(__pyx_t_1);
8098       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8099     } else
8100     #endif
8101     {
8102       __pyx_t_5 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
8103       __Pyx_GOTREF(__pyx_t_5);
8104       if (__pyx_t_2) {
8105         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
8106       }
8107       __Pyx_GIVEREF(__pyx_t_3);
8108       PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_19, __pyx_t_3);
8109       __Pyx_INCREF(__pyx_int_2);
8110       __Pyx_GIVEREF(__pyx_int_2);
8111       PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_19, __pyx_int_2);
8112       __pyx_t_3 = 0;
8113       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
8114       __Pyx_GOTREF(__pyx_t_1);
8115       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8116     }
8117     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8118     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 65, __pyx_L1_error)
8119     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8120     __pyx_v_x = __pyx_t_20;
8121     __pyx_t_20.memview = NULL;
8122     __pyx_t_20.data = NULL;
8123 
8124     /* "urh/cythonext/path_creator.pyx":41
8125  *         num_threads = 1
8126  *
8127  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
8128  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
8129  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
8130  */
8131     goto __pyx_L4;
8132   }
8133 
8134   /* "urh/cythonext/path_creator.pyx":67
8135  *         x = np.repeat(sample_rng, 2)
8136  *     else:
8137  *         x = np.arange(start, end, dtype=np.int64)             # <<<<<<<<<<<<<<
8138  *         values = samples[start:end]
8139  *         scale_factor = 1.0
8140  */
8141   /*else*/ {
8142     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
8143     __Pyx_GOTREF(__pyx_t_1);
8144     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error)
8145     __Pyx_GOTREF(__pyx_t_7);
8146     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8147     __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
8148     __Pyx_GOTREF(__pyx_t_1);
8149     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
8150     __Pyx_GOTREF(__pyx_t_5);
8151     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
8152     __Pyx_GOTREF(__pyx_t_3);
8153     __Pyx_GIVEREF(__pyx_t_1);
8154     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
8155     __Pyx_GIVEREF(__pyx_t_5);
8156     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
8157     __pyx_t_1 = 0;
8158     __pyx_t_5 = 0;
8159     __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
8160     __Pyx_GOTREF(__pyx_t_5);
8161     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
8162     __Pyx_GOTREF(__pyx_t_1);
8163     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
8164     __Pyx_GOTREF(__pyx_t_2);
8165     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8166     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
8167     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8168     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
8169     __Pyx_GOTREF(__pyx_t_2);
8170     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8171     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8172     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8173     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 67, __pyx_L1_error)
8174     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8175     __pyx_v_x = __pyx_t_20;
8176     __pyx_t_20.memview = NULL;
8177     __pyx_t_20.data = NULL;
8178 
8179     /* "urh/cythonext/path_creator.pyx":68
8180  *     else:
8181  *         x = np.arange(start, end, dtype=np.int64)
8182  *         values = samples[start:end]             # <<<<<<<<<<<<<<
8183  *         scale_factor = 1.0
8184  *
8185  */
8186     __pyx_t_10.data = __pyx_v_samples.data;
8187     __pyx_t_10.memview = __pyx_v_samples.memview;
8188     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
8189     __pyx_t_19 = -1;
8190     if (unlikely(__pyx_memoryview_slice_memviewslice(
8191     &__pyx_t_10,
8192     __pyx_v_samples.shape[0], __pyx_v_samples.strides[0], __pyx_v_samples.suboffsets[0],
8193     0,
8194     0,
8195     &__pyx_t_19,
8196     __pyx_v_start,
8197     __pyx_v_end,
8198     0,
8199     1,
8200     1,
8201     0,
8202     1) < 0))
8203 {
8204     __PYX_ERR(0, 68, __pyx_L1_error)
8205 }
8206 
8207 __pyx_v_values = __pyx_t_10;
8208     __pyx_t_10.memview = NULL;
8209     __pyx_t_10.data = NULL;
8210 
8211     /* "urh/cythonext/path_creator.pyx":69
8212  *         x = np.arange(start, end, dtype=np.int64)
8213  *         values = samples[start:end]
8214  *         scale_factor = 1.0             # <<<<<<<<<<<<<<
8215  *
8216  *     cdef list result = []
8217  */
8218     __pyx_v_scale_factor = 1.0;
8219   }
8220   __pyx_L4:;
8221 
8222   /* "urh/cythonext/path_creator.pyx":71
8223  *         scale_factor = 1.0
8224  *
8225  *     cdef list result = []             # <<<<<<<<<<<<<<
8226  *     if scale_factor == 0:
8227  *         scale_factor = 1  # prevent division by zero
8228  */
8229   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
8230   __Pyx_GOTREF(__pyx_t_2);
8231   __pyx_v_result = ((PyObject*)__pyx_t_2);
8232   __pyx_t_2 = 0;
8233 
8234   /* "urh/cythonext/path_creator.pyx":72
8235  *
8236  *     cdef list result = []
8237  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
8238  *         scale_factor = 1  # prevent division by zero
8239  *
8240  */
8241   __pyx_t_4 = ((__pyx_v_scale_factor == 0.0) != 0);
8242   if (__pyx_t_4) {
8243 
8244     /* "urh/cythonext/path_creator.pyx":73
8245  *     cdef list result = []
8246  *     if scale_factor == 0:
8247  *         scale_factor = 1  # prevent division by zero             # <<<<<<<<<<<<<<
8248  *
8249  *     for subpath_range in subpath_ranges:
8250  */
8251     __pyx_v_scale_factor = 1.0;
8252 
8253     /* "urh/cythonext/path_creator.pyx":72
8254  *
8255  *     cdef list result = []
8256  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
8257  *         scale_factor = 1  # prevent division by zero
8258  *
8259  */
8260   }
8261 
8262   /* "urh/cythonext/path_creator.pyx":75
8263  *         scale_factor = 1  # prevent division by zero
8264  *
8265  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
8266  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
8267  *         sub_start =int(max(0, math.floor(sub_start)))
8268  */
8269   if (unlikely(__pyx_v_subpath_ranges == Py_None)) {
8270     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
8271     __PYX_ERR(0, 75, __pyx_L1_error)
8272   }
8273   __pyx_t_2 = __pyx_v_subpath_ranges; __Pyx_INCREF(__pyx_t_2); __pyx_t_21 = 0;
8274   for (;;) {
8275     if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_2)) break;
8276     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8277     __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_21); __Pyx_INCREF(__pyx_t_5); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error)
8278     #else
8279     __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
8280     __Pyx_GOTREF(__pyx_t_5);
8281     #endif
8282     __Pyx_XDECREF_SET(__pyx_v_subpath_range, __pyx_t_5);
8283     __pyx_t_5 = 0;
8284 
8285     /* "urh/cythonext/path_creator.pyx":76
8286  *
8287  *     for subpath_range in subpath_ranges:
8288  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
8289  *         sub_start =int(max(0, math.floor(sub_start)))
8290  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
8291  */
8292     __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_subpath_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
8293     __Pyx_GOTREF(__pyx_t_5);
8294     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
8295     __Pyx_GOTREF(__pyx_t_3);
8296     __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
8297     __Pyx_GOTREF(__pyx_t_7);
8298     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8299     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8300     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
8301     __Pyx_GOTREF(__pyx_t_3);
8302     __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
8303     __Pyx_GOTREF(__pyx_t_5);
8304     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8305     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8306     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
8307     __Pyx_GOTREF(__pyx_t_3);
8308     __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
8309     __Pyx_GOTREF(__pyx_t_7);
8310     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8311     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8312     __pyx_t_3 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
8313     __Pyx_GOTREF(__pyx_t_3);
8314     __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
8315     __Pyx_GOTREF(__pyx_t_5);
8316     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8317     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8318     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
8319     __Pyx_GOTREF(__pyx_t_3);
8320     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
8321     __Pyx_GOTREF(__pyx_t_7);
8322     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8323     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8324     __Pyx_XDECREF_SET(__pyx_v_sub_start, __pyx_t_7);
8325     __pyx_t_7 = 0;
8326 
8327     /* "urh/cythonext/path_creator.pyx":77
8328  *     for subpath_range in subpath_ranges:
8329  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
8330  *         sub_start =int(max(0, math.floor(sub_start)))             # <<<<<<<<<<<<<<
8331  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
8332  *         sub_end = int(max(0, math.ceil(sub_end)))
8333  */
8334     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
8335     __Pyx_GOTREF(__pyx_t_3);
8336     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
8337     __Pyx_GOTREF(__pyx_t_5);
8338     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8339     __pyx_t_3 = NULL;
8340     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8341       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
8342       if (likely(__pyx_t_3)) {
8343         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8344         __Pyx_INCREF(__pyx_t_3);
8345         __Pyx_INCREF(function);
8346         __Pyx_DECREF_SET(__pyx_t_5, function);
8347       }
8348     }
8349     __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_sub_start) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_sub_start);
8350     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8351     if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
8352     __Pyx_GOTREF(__pyx_t_7);
8353     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8354     __pyx_t_22 = 0;
8355     __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
8356     __Pyx_GOTREF(__pyx_t_3);
8357     __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
8358     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8359     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 77, __pyx_L1_error)
8360     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8361     if (__pyx_t_4) {
8362       __Pyx_INCREF(__pyx_t_7);
8363       __pyx_t_5 = __pyx_t_7;
8364     } else {
8365       __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
8366       __Pyx_GOTREF(__pyx_t_1);
8367       __pyx_t_5 = __pyx_t_1;
8368       __pyx_t_1 = 0;
8369     }
8370     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8371     __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
8372     __Pyx_GOTREF(__pyx_t_7);
8373     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8374     __Pyx_DECREF_SET(__pyx_v_sub_start, __pyx_t_7);
8375     __pyx_t_7 = 0;
8376 
8377     /* "urh/cythonext/path_creator.pyx":78
8378  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
8379  *         sub_start =int(max(0, math.floor(sub_start)))
8380  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
8381  *         sub_end = int(max(0, math.ceil(sub_end)))
8382  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
8383  */
8384     __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_subpath_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
8385     __Pyx_GOTREF(__pyx_t_7);
8386     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
8387     __Pyx_GOTREF(__pyx_t_5);
8388     __pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
8389     __Pyx_GOTREF(__pyx_t_1);
8390     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8391     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8392     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
8393     __Pyx_GOTREF(__pyx_t_5);
8394     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
8395     __Pyx_GOTREF(__pyx_t_7);
8396     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8397     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8398     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
8399     __Pyx_GOTREF(__pyx_t_5);
8400     __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
8401     __Pyx_GOTREF(__pyx_t_1);
8402     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8403     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8404     __pyx_t_5 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
8405     __Pyx_GOTREF(__pyx_t_5);
8406     __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
8407     __Pyx_GOTREF(__pyx_t_7);
8408     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8409     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8410     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
8411     __Pyx_GOTREF(__pyx_t_5);
8412     __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
8413     __Pyx_GOTREF(__pyx_t_1);
8414     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8415     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8416     __Pyx_XDECREF_SET(__pyx_v_sub_end, __pyx_t_1);
8417     __pyx_t_1 = 0;
8418 
8419     /* "urh/cythonext/path_creator.pyx":79
8420  *         sub_start =int(max(0, math.floor(sub_start)))
8421  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
8422  *         sub_end = int(max(0, math.ceil(sub_end)))             # <<<<<<<<<<<<<<
8423  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
8424  *
8425  */
8426     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
8427     __Pyx_GOTREF(__pyx_t_5);
8428     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ceil); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
8429     __Pyx_GOTREF(__pyx_t_7);
8430     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8431     __pyx_t_5 = NULL;
8432     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
8433       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
8434       if (likely(__pyx_t_5)) {
8435         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
8436         __Pyx_INCREF(__pyx_t_5);
8437         __Pyx_INCREF(function);
8438         __Pyx_DECREF_SET(__pyx_t_7, function);
8439       }
8440     }
8441     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_sub_end) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_sub_end);
8442     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8443     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
8444     __Pyx_GOTREF(__pyx_t_1);
8445     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8446     __pyx_t_22 = 0;
8447     __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
8448     __Pyx_GOTREF(__pyx_t_5);
8449     __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
8450     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8451     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
8452     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8453     if (__pyx_t_4) {
8454       __Pyx_INCREF(__pyx_t_1);
8455       __pyx_t_7 = __pyx_t_1;
8456     } else {
8457       __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
8458       __Pyx_GOTREF(__pyx_t_3);
8459       __pyx_t_7 = __pyx_t_3;
8460       __pyx_t_3 = 0;
8461     }
8462     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8463     __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
8464     __Pyx_GOTREF(__pyx_t_1);
8465     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8466     __Pyx_DECREF_SET(__pyx_v_sub_end, __pyx_t_1);
8467     __pyx_t_1 = 0;
8468 
8469     /* "urh/cythonext/path_creator.pyx":80
8470  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
8471  *         sub_end = int(max(0, math.ceil(sub_end)))
8472  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))             # <<<<<<<<<<<<<<
8473  *
8474  *     return result
8475  */
8476     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
8477     __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
8478     __pyx_t_20.data = __pyx_v_x.data;
8479     __pyx_t_20.memview = __pyx_v_x.memview;
8480     __PYX_INC_MEMVIEW(&__pyx_t_20, 0);
8481     __pyx_t_19 = -1;
8482     if (unlikely(__pyx_memoryview_slice_memviewslice(
8483     &__pyx_t_20,
8484     __pyx_v_x.shape[0], __pyx_v_x.strides[0], __pyx_v_x.suboffsets[0],
8485     0,
8486     0,
8487     &__pyx_t_19,
8488     __pyx_t_23,
8489     __pyx_t_24,
8490     0,
8491     1,
8492     1,
8493     0,
8494     1) < 0))
8495 {
8496     __PYX_ERR(0, 80, __pyx_L1_error)
8497 }
8498 
8499 __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
8500     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
8501     __pyx_t_10.data = __pyx_v_values.data;
8502     __pyx_t_10.memview = __pyx_v_values.memview;
8503     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
8504     __pyx_t_19 = -1;
8505     if (unlikely(__pyx_memoryview_slice_memviewslice(
8506     &__pyx_t_10,
8507     __pyx_v_values.shape[0], __pyx_v_values.strides[0], __pyx_v_values.suboffsets[0],
8508     0,
8509     0,
8510     &__pyx_t_19,
8511     __pyx_t_24,
8512     __pyx_t_23,
8513     0,
8514     1,
8515     1,
8516     0,
8517     1) < 0))
8518 {
8519     __PYX_ERR(0, 80, __pyx_L1_error)
8520 }
8521 
8522 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_10, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_short, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_short, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
8523     __Pyx_GOTREF(__pyx_t_1);
8524     __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
8525     __pyx_t_10.memview = NULL;
8526     __pyx_t_10.data = NULL;
8527     __pyx_t_7 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_20, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
8528     __Pyx_GOTREF(__pyx_t_7);
8529     __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
8530     __pyx_t_20.memview = NULL;
8531     __pyx_t_20.data = NULL;
8532     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8533     __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error)
8534     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8535 
8536     /* "urh/cythonext/path_creator.pyx":75
8537  *         scale_factor = 1  # prevent division by zero
8538  *
8539  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
8540  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
8541  *         sub_start =int(max(0, math.floor(sub_start)))
8542  */
8543   }
8544   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8545 
8546   /* "urh/cythonext/path_creator.pyx":82
8547  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
8548  *
8549  *     return result             # <<<<<<<<<<<<<<
8550  *
8551  *
8552  */
8553   __Pyx_XDECREF(__pyx_r);
8554   __Pyx_INCREF(__pyx_v_result);
8555   __pyx_r = __pyx_v_result;
8556   goto __pyx_L0;
8557 
8558   /* "urh/cythonext/path_creator.pyx":19
8559  * import struct
8560  *
8561  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
8562  *     cdef iq[:] values
8563  *     cdef long long[::1] sample_rng
8564  */
8565 
8566   /* function exit code */
8567   __pyx_L1_error:;
8568   __Pyx_XDECREF(__pyx_t_1);
8569   __Pyx_XDECREF(__pyx_t_2);
8570   __Pyx_XDECREF(__pyx_t_3);
8571   __Pyx_XDECREF(__pyx_t_5);
8572   __Pyx_XDECREF(__pyx_t_7);
8573   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
8574   __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
8575   __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
8576   __Pyx_AddTraceback("urh.cythonext.path_creator.create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
8577   __pyx_r = 0;
8578   __pyx_L0:;
8579   __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
8580   __PYX_XDEC_MEMVIEW(&__pyx_v_sample_rng, 1);
8581   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
8582   __Pyx_XDECREF(__pyx_v_type_lookup);
8583   __Pyx_XDECREF(__pyx_v_result);
8584   __Pyx_XDECREF(__pyx_v_subpath_range);
8585   __Pyx_XDECREF(__pyx_v_sub_start);
8586   __Pyx_XDECREF(__pyx_v_sub_end);
8587   __Pyx_XDECREF(__pyx_v_subpath_ranges);
8588   __Pyx_XGIVEREF(__pyx_r);
8589   __Pyx_RefNannyFinishContext();
8590   return __pyx_r;
8591 }
8592 
8593 /* Python wrapper */
8594 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_13__pyx_fuse_3create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8595 static PyMethodDef __pyx_fuse_3__pyx_mdef_3urh_9cythonext_12path_creator_13__pyx_fuse_3create_path = {"__pyx_fuse_3create_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_13__pyx_fuse_3create_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_13__pyx_fuse_3create_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8596 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_13__pyx_fuse_3create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8597   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
8598   PY_LONG_LONG __pyx_v_start;
8599   PY_LONG_LONG __pyx_v_end;
8600   PyObject *__pyx_v_subpath_ranges = 0;
8601   int __pyx_lineno = 0;
8602   const char *__pyx_filename = NULL;
8603   int __pyx_clineno = 0;
8604   PyObject *__pyx_r = 0;
8605   __Pyx_RefNannyDeclarations
8606   __Pyx_RefNannySetupContext("__pyx_fuse_3create_path (wrapper)", 0);
8607   {
8608     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_subpath_ranges,0};
8609     PyObject* values[4] = {0,0,0,0};
8610     values[3] = __pyx_k__9;
8611     if (unlikely(__pyx_kwds)) {
8612       Py_ssize_t kw_args;
8613       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8614       switch (pos_args) {
8615         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8616         CYTHON_FALLTHROUGH;
8617         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8618         CYTHON_FALLTHROUGH;
8619         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8620         CYTHON_FALLTHROUGH;
8621         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8622         CYTHON_FALLTHROUGH;
8623         case  0: break;
8624         default: goto __pyx_L5_argtuple_error;
8625       }
8626       kw_args = PyDict_Size(__pyx_kwds);
8627       switch (pos_args) {
8628         case  0:
8629         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
8630         else goto __pyx_L5_argtuple_error;
8631         CYTHON_FALLTHROUGH;
8632         case  1:
8633         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
8634         else {
8635           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3create_path", 0, 3, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
8636         }
8637         CYTHON_FALLTHROUGH;
8638         case  2:
8639         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
8640         else {
8641           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3create_path", 0, 3, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
8642         }
8643         CYTHON_FALLTHROUGH;
8644         case  3:
8645         if (kw_args > 0) {
8646           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subpath_ranges);
8647           if (value) { values[3] = value; kw_args--; }
8648         }
8649       }
8650       if (unlikely(kw_args > 0)) {
8651         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3create_path") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
8652       }
8653     } else {
8654       switch (PyTuple_GET_SIZE(__pyx_args)) {
8655         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8656         CYTHON_FALLTHROUGH;
8657         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8658         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8659         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8660         break;
8661         default: goto __pyx_L5_argtuple_error;
8662       }
8663     }
8664     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 19, __pyx_L3_error)
8665     __pyx_v_start = __Pyx_PyInt_As_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_start == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
8666     __pyx_v_end = __Pyx_PyInt_As_PY_LONG_LONG(values[2]); if (unlikely((__pyx_v_end == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
8667     __pyx_v_subpath_ranges = ((PyObject*)values[3]);
8668   }
8669   goto __pyx_L4_argument_unpacking_done;
8670   __pyx_L5_argtuple_error:;
8671   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3create_path", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
8672   __pyx_L3_error:;
8673   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_3create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
8674   __Pyx_RefNannyFinishContext();
8675   return NULL;
8676   __pyx_L4_argument_unpacking_done:;
8677   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subpath_ranges), (&PyList_Type), 1, "subpath_ranges", 1))) __PYX_ERR(0, 19, __pyx_L1_error)
8678   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_12__pyx_fuse_3create_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end, __pyx_v_subpath_ranges);
8679 
8680   /* function exit code */
8681   goto __pyx_L0;
8682   __pyx_L1_error:;
8683   __pyx_r = NULL;
8684   __pyx_L0:;
8685   __Pyx_RefNannyFinishContext();
8686   return __pyx_r;
8687 }
8688 
__pyx_pf_3urh_9cythonext_12path_creator_12__pyx_fuse_3create_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,PyObject * __pyx_v_subpath_ranges)8689 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_12__pyx_fuse_3create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges) {
8690   PyObject *__pyx_r = NULL;
8691   __Pyx_RefNannyDeclarations
8692   PyObject *__pyx_t_1 = NULL;
8693   struct __pyx_fuse_3__pyx_opt_args_3urh_9cythonext_12path_creator_create_path __pyx_t_2;
8694   int __pyx_lineno = 0;
8695   const char *__pyx_filename = NULL;
8696   int __pyx_clineno = 0;
8697   __Pyx_RefNannySetupContext("__pyx_fuse_3create_path", 0);
8698   __Pyx_XDECREF(__pyx_r);
8699   __pyx_t_2.__pyx_n = 1;
8700   __pyx_t_2.subpath_ranges = __pyx_v_subpath_ranges;
8701   __pyx_t_1 = __pyx_fuse_3__pyx_f_3urh_9cythonext_12path_creator_create_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
8702   __Pyx_GOTREF(__pyx_t_1);
8703   __pyx_r = __pyx_t_1;
8704   __pyx_t_1 = 0;
8705   goto __pyx_L0;
8706 
8707   /* function exit code */
8708   __pyx_L1_error:;
8709   __Pyx_XDECREF(__pyx_t_1);
8710   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_3create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
8711   __pyx_r = NULL;
8712   __pyx_L0:;
8713   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
8714   __Pyx_XGIVEREF(__pyx_r);
8715   __Pyx_RefNannyFinishContext();
8716   return __pyx_r;
8717 }
8718 
8719 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_15__pyx_fuse_4create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8720 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_1create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_4__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_fuse_4__pyx_opt_args_3urh_9cythonext_12path_creator_create_path * __pyx_optional_args)8721 static PyObject *__pyx_fuse_4__pyx_f_3urh_9cythonext_12path_creator_create_path(__Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_fuse_4__pyx_opt_args_3urh_9cythonext_12path_creator_create_path *__pyx_optional_args) {
8722   PyObject *__pyx_v_subpath_ranges = __pyx_k__10;
8723   __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
8724   __Pyx_memviewslice __pyx_v_sample_rng = { 0, 0, { 0 }, { 0 }, { 0 } };
8725   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
8726   float __pyx_v_sample;
8727   float __pyx_v_minimum;
8728   float __pyx_v_maximum;
8729   float __pyx_v_tmp;
8730   float __pyx_v_scale_factor;
8731   PY_LONG_LONG __pyx_v_i;
8732   PY_LONG_LONG __pyx_v_j;
8733   PY_LONG_LONG __pyx_v_index;
8734   PY_LONG_LONG __pyx_v_chunk_end;
8735   PY_LONG_LONG __pyx_v_num_samples;
8736   PY_LONG_LONG __pyx_v_pixels_on_path;
8737   PY_LONG_LONG __pyx_v_samples_per_pixel;
8738   PyObject *__pyx_v_type_lookup = 0;
8739   CYTHON_UNUSED int __pyx_v_num_threads;
8740   PyObject *__pyx_v_result = 0;
8741   PyObject *__pyx_v_subpath_range = NULL;
8742   PyObject *__pyx_v_sub_start = NULL;
8743   PyObject *__pyx_v_sub_end = NULL;
8744   PyObject *__pyx_r = NULL;
8745   __Pyx_RefNannyDeclarations
8746   PyObject *__pyx_t_1 = NULL;
8747   PyObject *__pyx_t_2 = NULL;
8748   PyObject *__pyx_t_3 = NULL;
8749   int __pyx_t_4;
8750   PyObject *__pyx_t_5 = NULL;
8751   PY_LONG_LONG __pyx_t_6;
8752   PyObject *__pyx_t_7 = NULL;
8753   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
8754   size_t __pyx_t_9;
8755   __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
8756   PY_LONG_LONG __pyx_t_11;
8757   PY_LONG_LONG __pyx_t_12;
8758   PY_LONG_LONG __pyx_t_13;
8759   PY_LONG_LONG __pyx_t_14;
8760   PY_LONG_LONG __pyx_t_15;
8761   PY_LONG_LONG __pyx_t_16;
8762   PY_LONG_LONG __pyx_t_17;
8763   PY_LONG_LONG __pyx_t_18;
8764   int __pyx_t_19;
8765   __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
8766   Py_ssize_t __pyx_t_21;
8767   long __pyx_t_22;
8768   Py_ssize_t __pyx_t_23;
8769   Py_ssize_t __pyx_t_24;
8770   int __pyx_t_25;
8771   int __pyx_lineno = 0;
8772   const char *__pyx_filename = NULL;
8773   int __pyx_clineno = 0;
8774   __Pyx_RefNannySetupContext("__pyx_fuse_4create_path", 0);
8775   if (__pyx_optional_args) {
8776     if (__pyx_optional_args->__pyx_n > 0) {
8777       __pyx_v_subpath_ranges = __pyx_optional_args->subpath_ranges;
8778     }
8779   }
8780   __Pyx_INCREF(__pyx_v_subpath_ranges);
8781 
8782   /* "urh/cythonext/path_creator.pyx":26
8783  *     cdef float scale_factor
8784  *     cdef long long i,j,index, chunk_end, num_samples, pixels_on_path, samples_per_pixel
8785  *     num_samples = end - start             # <<<<<<<<<<<<<<
8786  *
8787  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
8788  */
8789   __pyx_v_num_samples = (__pyx_v_end - __pyx_v_start);
8790 
8791   /* "urh/cythonext/path_creator.pyx":28
8792  *     num_samples = end - start
8793  *
8794  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,             # <<<<<<<<<<<<<<
8795  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
8796  *                              "float[:]": np.float32, "double[:]": np.float64}
8797  */
8798   __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
8799   __Pyx_GOTREF(__pyx_t_1);
8800   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
8801   __Pyx_GOTREF(__pyx_t_2);
8802   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
8803   __Pyx_GOTREF(__pyx_t_3);
8804   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8805   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_char_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
8806   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8807   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
8808   __Pyx_GOTREF(__pyx_t_3);
8809   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
8810   __Pyx_GOTREF(__pyx_t_2);
8811   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8812   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_char_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
8813   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8814 
8815   /* "urh/cythonext/path_creator.pyx":29
8816  *
8817  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
8818  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,             # <<<<<<<<<<<<<<
8819  *                              "float[:]": np.float32, "double[:]": np.float64}
8820  *
8821  */
8822   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
8823   __Pyx_GOTREF(__pyx_t_2);
8824   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
8825   __Pyx_GOTREF(__pyx_t_3);
8826   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8827   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_short_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
8828   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8829   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
8830   __Pyx_GOTREF(__pyx_t_3);
8831   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
8832   __Pyx_GOTREF(__pyx_t_2);
8833   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8834   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_unsigned_short_2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
8835   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8836 
8837   /* "urh/cythonext/path_creator.pyx":30
8838  *     cdef dict type_lookup = {"char[:]": np.int8, "unsigned char[:]": np.uint8,
8839  *                              "short[:]": np.int16, "unsigned short[:]": np.uint16,
8840  *                              "float[:]": np.float32, "double[:]": np.float64}             # <<<<<<<<<<<<<<
8841  *
8842  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
8843  */
8844   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
8845   __Pyx_GOTREF(__pyx_t_2);
8846   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
8847   __Pyx_GOTREF(__pyx_t_3);
8848   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8849   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_float_2, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
8850   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8851   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
8852   __Pyx_GOTREF(__pyx_t_3);
8853   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
8854   __Pyx_GOTREF(__pyx_t_2);
8855   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8856   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_double, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
8857   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8858   __pyx_v_type_lookup = ((PyObject*)__pyx_t_1);
8859   __pyx_t_1 = 0;
8860 
8861   /* "urh/cythonext/path_creator.pyx":32
8862  *                              "float[:]": np.float32, "double[:]": np.float64}
8863  *
8864  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges             # <<<<<<<<<<<<<<
8865  *     pixels_on_path = settings.PIXELS_PER_PATH
8866  *
8867  */
8868   __pyx_t_4 = (__pyx_v_subpath_ranges == ((PyObject*)Py_None));
8869   if ((__pyx_t_4 != 0)) {
8870     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
8871     __Pyx_GOTREF(__pyx_t_2);
8872     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
8873     __Pyx_GOTREF(__pyx_t_3);
8874     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error)
8875     __Pyx_GOTREF(__pyx_t_5);
8876     __Pyx_GIVEREF(__pyx_t_2);
8877     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
8878     __Pyx_GIVEREF(__pyx_t_3);
8879     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
8880     __pyx_t_2 = 0;
8881     __pyx_t_3 = 0;
8882     __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
8883     __Pyx_GOTREF(__pyx_t_3);
8884     __Pyx_GIVEREF(__pyx_t_5);
8885     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
8886     __pyx_t_5 = 0;
8887     __pyx_t_1 = __pyx_t_3;
8888     __pyx_t_3 = 0;
8889   } else {
8890     __Pyx_INCREF(__pyx_v_subpath_ranges);
8891     __pyx_t_1 = __pyx_v_subpath_ranges;
8892   }
8893   __Pyx_DECREF_SET(__pyx_v_subpath_ranges, ((PyObject*)__pyx_t_1));
8894   __pyx_t_1 = 0;
8895 
8896   /* "urh/cythonext/path_creator.pyx":33
8897  *
8898  *     subpath_ranges = [(start, end)] if subpath_ranges is None else subpath_ranges
8899  *     pixels_on_path = settings.PIXELS_PER_PATH             # <<<<<<<<<<<<<<
8900  *
8901  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
8902  */
8903   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
8904   __Pyx_GOTREF(__pyx_t_1);
8905   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PIXELS_PER_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
8906   __Pyx_GOTREF(__pyx_t_3);
8907   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8908   __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error)
8909   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8910   __pyx_v_pixels_on_path = __pyx_t_6;
8911 
8912   /* "urh/cythonext/path_creator.pyx":35
8913  *     pixels_on_path = settings.PIXELS_PER_PATH
8914  *
8915  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)             # <<<<<<<<<<<<<<
8916  *
8917  *     cdef int num_threads = 0
8918  */
8919   __pyx_v_samples_per_pixel = ((PY_LONG_LONG)(__pyx_v_num_samples / __pyx_v_pixels_on_path));
8920 
8921   /* "urh/cythonext/path_creator.pyx":37
8922  *     samples_per_pixel = <long long>(num_samples / pixels_on_path)
8923  *
8924  *     cdef int num_threads = 0             # <<<<<<<<<<<<<<
8925  *     if samples_per_pixel < 20000:
8926  *         num_threads = 1
8927  */
8928   __pyx_v_num_threads = 0;
8929 
8930   /* "urh/cythonext/path_creator.pyx":38
8931  *
8932  *     cdef int num_threads = 0
8933  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
8934  *         num_threads = 1
8935  *
8936  */
8937   __pyx_t_4 = ((__pyx_v_samples_per_pixel < 0x4E20) != 0);
8938   if (__pyx_t_4) {
8939 
8940     /* "urh/cythonext/path_creator.pyx":39
8941  *     cdef int num_threads = 0
8942  *     if samples_per_pixel < 20000:
8943  *         num_threads = 1             # <<<<<<<<<<<<<<
8944  *
8945  *     if samples_per_pixel > 1:
8946  */
8947     __pyx_v_num_threads = 1;
8948 
8949     /* "urh/cythonext/path_creator.pyx":38
8950  *
8951  *     cdef int num_threads = 0
8952  *     if samples_per_pixel < 20000:             # <<<<<<<<<<<<<<
8953  *         num_threads = 1
8954  *
8955  */
8956   }
8957 
8958   /* "urh/cythonext/path_creator.pyx":41
8959  *         num_threads = 1
8960  *
8961  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
8962  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
8963  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
8964  */
8965   __pyx_t_4 = ((__pyx_v_samples_per_pixel > 1) != 0);
8966   if (__pyx_t_4) {
8967 
8968     /* "urh/cythonext/path_creator.pyx":42
8969  *
8970  *     if samples_per_pixel > 1:
8971  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)             # <<<<<<<<<<<<<<
8972  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
8973  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
8974  */
8975     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
8976     __Pyx_GOTREF(__pyx_t_3);
8977     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
8978     __Pyx_GOTREF(__pyx_t_1);
8979     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8980     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
8981     __Pyx_GOTREF(__pyx_t_3);
8982     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
8983     __Pyx_GOTREF(__pyx_t_5);
8984     __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_samples_per_pixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
8985     __Pyx_GOTREF(__pyx_t_2);
8986     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
8987     __Pyx_GOTREF(__pyx_t_7);
8988     __Pyx_GIVEREF(__pyx_t_3);
8989     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
8990     __Pyx_GIVEREF(__pyx_t_5);
8991     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
8992     __Pyx_GIVEREF(__pyx_t_2);
8993     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
8994     __pyx_t_3 = 0;
8995     __pyx_t_5 = 0;
8996     __pyx_t_2 = 0;
8997     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
8998     __Pyx_GOTREF(__pyx_t_2);
8999     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
9000     __Pyx_GOTREF(__pyx_t_5);
9001     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
9002     __Pyx_GOTREF(__pyx_t_3);
9003     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9004     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
9005     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9006     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
9007     __Pyx_GOTREF(__pyx_t_3);
9008     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9009     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9010     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9011     __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 42, __pyx_L1_error)
9012     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9013     __pyx_v_sample_rng = __pyx_t_8;
9014     __pyx_t_8.memview = NULL;
9015     __pyx_t_8.data = NULL;
9016 
9017     /* "urh/cythonext/path_creator.pyx":43
9018  *     if samples_per_pixel > 1:
9019  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
9020  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")             # <<<<<<<<<<<<<<
9021  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
9022  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
9023  */
9024     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
9025     __Pyx_GOTREF(__pyx_t_3);
9026     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
9027     __Pyx_GOTREF(__pyx_t_2);
9028     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9029     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
9030     __pyx_t_3 = PyInt_FromSsize_t((2 * __pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
9031     __Pyx_GOTREF(__pyx_t_3);
9032     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
9033     __Pyx_GOTREF(__pyx_t_7);
9034     __Pyx_GIVEREF(__pyx_t_3);
9035     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
9036     __pyx_t_3 = 0;
9037     __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
9038     __Pyx_GOTREF(__pyx_t_3);
9039     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_type_lookup, __pyx_kp_s_float_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
9040     __Pyx_GOTREF(__pyx_t_1);
9041     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
9042     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9043     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
9044     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
9045     __Pyx_GOTREF(__pyx_t_1);
9046     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9047     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9048     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9049     __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 43, __pyx_L1_error)
9050     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9051     __pyx_v_values = __pyx_t_10;
9052     __pyx_t_10.memview = NULL;
9053     __pyx_t_10.data = NULL;
9054 
9055     /* "urh/cythonext/path_creator.pyx":44
9056  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
9057  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
9058  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!             # <<<<<<<<<<<<<<
9059  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
9060  *             chunk_end = i + samples_per_pixel
9061  */
9062     __pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_sample_rng);
9063     __pyx_v_scale_factor = (((double)__pyx_v_num_samples) / (2.0 * __pyx_t_9));
9064 
9065     /* "urh/cythonext/path_creator.pyx":45
9066  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
9067  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
9068  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
9069  *             chunk_end = i + samples_per_pixel
9070  *             if chunk_end >= end:
9071  */
9072     {
9073         #ifdef WITH_THREAD
9074         PyThreadState *_save;
9075         Py_UNBLOCK_THREADS
9076         __Pyx_FastGIL_Remember();
9077         #endif
9078         /*try:*/ {
9079           __pyx_t_6 = __pyx_v_start;
9080           __pyx_t_11 = __pyx_v_end;
9081           __pyx_t_12 = __pyx_v_samples_per_pixel;
9082           if ((__pyx_t_12 == 0)) abort();
9083           {
9084               #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
9085                   #undef likely
9086                   #undef unlikely
9087                   #define likely(x)   (x)
9088                   #define unlikely(x) (x)
9089               #endif
9090               __pyx_t_14 = (__pyx_t_11 - __pyx_t_6 + __pyx_t_12 - __pyx_t_12/abs(__pyx_t_12)) / __pyx_t_12;
9091               if (__pyx_t_14 > 0)
9092               {
9093                   #ifdef _OPENMP
9094                   #pragma omp parallel num_threads(__pyx_v_num_threads) private(__pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_4)
9095                   #endif /* _OPENMP */
9096                   {
9097                       #ifdef _OPENMP
9098                       #pragma omp for lastprivate(__pyx_v_chunk_end) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_index) lastprivate(__pyx_v_j) lastprivate(__pyx_v_maximum) lastprivate(__pyx_v_minimum) lastprivate(__pyx_v_sample) lastprivate(__pyx_v_tmp) schedule(static)
9099                       #endif /* _OPENMP */
9100                       for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13++){
9101                           {
9102                               __pyx_v_i = (PY_LONG_LONG)(__pyx_t_6 + __pyx_t_12 * __pyx_t_13);
9103                               /* Initialize private variables to invalid values */
9104                               __pyx_v_chunk_end = ((PY_LONG_LONG)0xbad0bad0);
9105                               __pyx_v_index = ((PY_LONG_LONG)0xbad0bad0);
9106                               __pyx_v_j = ((PY_LONG_LONG)0xbad0bad0);
9107                               __pyx_v_maximum = ((float)__PYX_NAN());
9108                               __pyx_v_minimum = ((float)__PYX_NAN());
9109                               __pyx_v_sample = ((float)__PYX_NAN());
9110                               __pyx_v_tmp = ((float)__PYX_NAN());
9111 
9112                               /* "urh/cythonext/path_creator.pyx":46
9113  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
9114  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
9115  *             chunk_end = i + samples_per_pixel             # <<<<<<<<<<<<<<
9116  *             if chunk_end >= end:
9117  *                 chunk_end = end
9118  */
9119                               __pyx_v_chunk_end = (__pyx_v_i + __pyx_v_samples_per_pixel);
9120 
9121                               /* "urh/cythonext/path_creator.pyx":47
9122  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
9123  *             chunk_end = i + samples_per_pixel
9124  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
9125  *                 chunk_end = end
9126  *
9127  */
9128                               __pyx_t_4 = ((__pyx_v_chunk_end >= __pyx_v_end) != 0);
9129                               if (__pyx_t_4) {
9130 
9131                                 /* "urh/cythonext/path_creator.pyx":48
9132  *             chunk_end = i + samples_per_pixel
9133  *             if chunk_end >= end:
9134  *                 chunk_end = end             # <<<<<<<<<<<<<<
9135  *
9136  *             tmp = samples[i]
9137  */
9138                                 __pyx_v_chunk_end = __pyx_v_end;
9139 
9140                                 /* "urh/cythonext/path_creator.pyx":47
9141  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):
9142  *             chunk_end = i + samples_per_pixel
9143  *             if chunk_end >= end:             # <<<<<<<<<<<<<<
9144  *                 chunk_end = end
9145  *
9146  */
9147                               }
9148 
9149                               /* "urh/cythonext/path_creator.pyx":50
9150  *                 chunk_end = end
9151  *
9152  *             tmp = samples[i]             # <<<<<<<<<<<<<<
9153  *             minimum = tmp
9154  *             maximum = tmp
9155  */
9156                               __pyx_t_15 = __pyx_v_i;
9157                               __pyx_v_tmp = (*((float *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_15 * __pyx_v_samples.strides[0]) )));
9158 
9159                               /* "urh/cythonext/path_creator.pyx":51
9160  *
9161  *             tmp = samples[i]
9162  *             minimum = tmp             # <<<<<<<<<<<<<<
9163  *             maximum = tmp
9164  *
9165  */
9166                               __pyx_v_minimum = __pyx_v_tmp;
9167 
9168                               /* "urh/cythonext/path_creator.pyx":52
9169  *             tmp = samples[i]
9170  *             minimum = tmp
9171  *             maximum = tmp             # <<<<<<<<<<<<<<
9172  *
9173  *             for j in range(i + 1, chunk_end):
9174  */
9175                               __pyx_v_maximum = __pyx_v_tmp;
9176 
9177                               /* "urh/cythonext/path_creator.pyx":54
9178  *             maximum = tmp
9179  *
9180  *             for j in range(i + 1, chunk_end):             # <<<<<<<<<<<<<<
9181  *                 sample = samples[j]
9182  *                 if sample < minimum:
9183  */
9184                               __pyx_t_15 = __pyx_v_chunk_end;
9185                               __pyx_t_16 = __pyx_t_15;
9186                               for (__pyx_t_17 = (__pyx_v_i + 1); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
9187                                 __pyx_v_j = __pyx_t_17;
9188 
9189                                 /* "urh/cythonext/path_creator.pyx":55
9190  *
9191  *             for j in range(i + 1, chunk_end):
9192  *                 sample = samples[j]             # <<<<<<<<<<<<<<
9193  *                 if sample < minimum:
9194  *                     minimum = sample
9195  */
9196                                 __pyx_t_18 = __pyx_v_j;
9197                                 __pyx_v_sample = (*((float *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )));
9198 
9199                                 /* "urh/cythonext/path_creator.pyx":56
9200  *             for j in range(i + 1, chunk_end):
9201  *                 sample = samples[j]
9202  *                 if sample < minimum:             # <<<<<<<<<<<<<<
9203  *                     minimum = sample
9204  *                 elif sample > maximum:
9205  */
9206                                 __pyx_t_4 = ((__pyx_v_sample < __pyx_v_minimum) != 0);
9207                                 if (__pyx_t_4) {
9208 
9209                                   /* "urh/cythonext/path_creator.pyx":57
9210  *                 sample = samples[j]
9211  *                 if sample < minimum:
9212  *                     minimum = sample             # <<<<<<<<<<<<<<
9213  *                 elif sample > maximum:
9214  *                     maximum = sample
9215  */
9216                                   __pyx_v_minimum = __pyx_v_sample;
9217 
9218                                   /* "urh/cythonext/path_creator.pyx":56
9219  *             for j in range(i + 1, chunk_end):
9220  *                 sample = samples[j]
9221  *                 if sample < minimum:             # <<<<<<<<<<<<<<
9222  *                     minimum = sample
9223  *                 elif sample > maximum:
9224  */
9225                                   goto __pyx_L15;
9226                                 }
9227 
9228                                 /* "urh/cythonext/path_creator.pyx":58
9229  *                 if sample < minimum:
9230  *                     minimum = sample
9231  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
9232  *                     maximum = sample
9233  *
9234  */
9235                                 __pyx_t_4 = ((__pyx_v_sample > __pyx_v_maximum) != 0);
9236                                 if (__pyx_t_4) {
9237 
9238                                   /* "urh/cythonext/path_creator.pyx":59
9239  *                     minimum = sample
9240  *                 elif sample > maximum:
9241  *                     maximum = sample             # <<<<<<<<<<<<<<
9242  *
9243  *             index = <long long>(2*(i-start)/samples_per_pixel)
9244  */
9245                                   __pyx_v_maximum = __pyx_v_sample;
9246 
9247                                   /* "urh/cythonext/path_creator.pyx":58
9248  *                 if sample < minimum:
9249  *                     minimum = sample
9250  *                 elif sample > maximum:             # <<<<<<<<<<<<<<
9251  *                     maximum = sample
9252  *
9253  */
9254                                 }
9255                                 __pyx_L15:;
9256                               }
9257 
9258                               /* "urh/cythonext/path_creator.pyx":61
9259  *                     maximum = sample
9260  *
9261  *             index = <long long>(2*(i-start)/samples_per_pixel)             # <<<<<<<<<<<<<<
9262  *             values[index] = minimum
9263  *             values[index + 1] = maximum
9264  */
9265                               __pyx_v_index = ((PY_LONG_LONG)((2 * (__pyx_v_i - __pyx_v_start)) / __pyx_v_samples_per_pixel));
9266 
9267                               /* "urh/cythonext/path_creator.pyx":62
9268  *
9269  *             index = <long long>(2*(i-start)/samples_per_pixel)
9270  *             values[index] = minimum             # <<<<<<<<<<<<<<
9271  *             values[index + 1] = maximum
9272  *
9273  */
9274                               __pyx_t_15 = __pyx_v_index;
9275                               *((float *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_minimum;
9276 
9277                               /* "urh/cythonext/path_creator.pyx":63
9278  *             index = <long long>(2*(i-start)/samples_per_pixel)
9279  *             values[index] = minimum
9280  *             values[index + 1] = maximum             # <<<<<<<<<<<<<<
9281  *
9282  *         x = np.repeat(sample_rng, 2)
9283  */
9284                               __pyx_t_15 = (__pyx_v_index + 1);
9285                               *((float *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) )) = __pyx_v_maximum;
9286                           }
9287                       }
9288                   }
9289               }
9290           }
9291           #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
9292               #undef likely
9293               #undef unlikely
9294               #define likely(x)   __builtin_expect(!!(x), 1)
9295               #define unlikely(x) __builtin_expect(!!(x), 0)
9296           #endif
9297         }
9298 
9299         /* "urh/cythonext/path_creator.pyx":45
9300  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
9301  *         scale_factor = num_samples / (2.0 * len(sample_rng))  # 2.0 is important to make it a float division!
9302  *         for i in prange(start, end, samples_per_pixel, nogil=True, schedule='static', num_threads=num_threads):             # <<<<<<<<<<<<<<
9303  *             chunk_end = i + samples_per_pixel
9304  *             if chunk_end >= end:
9305  */
9306         /*finally:*/ {
9307           /*normal exit:*/{
9308             #ifdef WITH_THREAD
9309             __Pyx_FastGIL_Forget();
9310             Py_BLOCK_THREADS
9311             #endif
9312             goto __pyx_L7;
9313           }
9314           __pyx_L7:;
9315         }
9316     }
9317 
9318     /* "urh/cythonext/path_creator.pyx":65
9319  *             values[index + 1] = maximum
9320  *
9321  *         x = np.repeat(sample_rng, 2)             # <<<<<<<<<<<<<<
9322  *     else:
9323  *         x = np.arange(start, end, dtype=np.int64)
9324  */
9325     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
9326     __Pyx_GOTREF(__pyx_t_3);
9327     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_repeat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
9328     __Pyx_GOTREF(__pyx_t_7);
9329     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9330     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sample_rng, 1, (PyObject *(*)(char *)) __pyx_memview_get_PY_LONG_LONG, (int (*)(char *, PyObject *)) __pyx_memview_set_PY_LONG_LONG, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
9331     __Pyx_GOTREF(__pyx_t_3);
9332     __pyx_t_2 = NULL;
9333     __pyx_t_19 = 0;
9334     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
9335       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
9336       if (likely(__pyx_t_2)) {
9337         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
9338         __Pyx_INCREF(__pyx_t_2);
9339         __Pyx_INCREF(function);
9340         __Pyx_DECREF_SET(__pyx_t_7, function);
9341         __pyx_t_19 = 1;
9342       }
9343     }
9344     #if CYTHON_FAST_PYCALL
9345     if (PyFunction_Check(__pyx_t_7)) {
9346       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
9347       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
9348       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9349       __Pyx_GOTREF(__pyx_t_1);
9350       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9351     } else
9352     #endif
9353     #if CYTHON_FAST_PYCCALL
9354     if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
9355       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
9356       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
9357       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9358       __Pyx_GOTREF(__pyx_t_1);
9359       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9360     } else
9361     #endif
9362     {
9363       __pyx_t_5 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
9364       __Pyx_GOTREF(__pyx_t_5);
9365       if (__pyx_t_2) {
9366         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
9367       }
9368       __Pyx_GIVEREF(__pyx_t_3);
9369       PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_19, __pyx_t_3);
9370       __Pyx_INCREF(__pyx_int_2);
9371       __Pyx_GIVEREF(__pyx_int_2);
9372       PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_19, __pyx_int_2);
9373       __pyx_t_3 = 0;
9374       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
9375       __Pyx_GOTREF(__pyx_t_1);
9376       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9377     }
9378     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9379     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 65, __pyx_L1_error)
9380     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9381     __pyx_v_x = __pyx_t_20;
9382     __pyx_t_20.memview = NULL;
9383     __pyx_t_20.data = NULL;
9384 
9385     /* "urh/cythonext/path_creator.pyx":41
9386  *         num_threads = 1
9387  *
9388  *     if samples_per_pixel > 1:             # <<<<<<<<<<<<<<
9389  *         sample_rng = np.arange(start, end, samples_per_pixel, dtype=np.int64)
9390  *         values = np.zeros(2 * len(sample_rng), dtype=type_lookup[cython.typeof(samples)], order="C")
9391  */
9392     goto __pyx_L4;
9393   }
9394 
9395   /* "urh/cythonext/path_creator.pyx":67
9396  *         x = np.repeat(sample_rng, 2)
9397  *     else:
9398  *         x = np.arange(start, end, dtype=np.int64)             # <<<<<<<<<<<<<<
9399  *         values = samples[start:end]
9400  *         scale_factor = 1.0
9401  */
9402   /*else*/ {
9403     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
9404     __Pyx_GOTREF(__pyx_t_1);
9405     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error)
9406     __Pyx_GOTREF(__pyx_t_7);
9407     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9408     __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
9409     __Pyx_GOTREF(__pyx_t_1);
9410     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
9411     __Pyx_GOTREF(__pyx_t_5);
9412     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
9413     __Pyx_GOTREF(__pyx_t_3);
9414     __Pyx_GIVEREF(__pyx_t_1);
9415     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
9416     __Pyx_GIVEREF(__pyx_t_5);
9417     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
9418     __pyx_t_1 = 0;
9419     __pyx_t_5 = 0;
9420     __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
9421     __Pyx_GOTREF(__pyx_t_5);
9422     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
9423     __Pyx_GOTREF(__pyx_t_1);
9424     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
9425     __Pyx_GOTREF(__pyx_t_2);
9426     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9427     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
9428     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9429     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
9430     __Pyx_GOTREF(__pyx_t_2);
9431     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9432     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9433     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9434     __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 67, __pyx_L1_error)
9435     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9436     __pyx_v_x = __pyx_t_20;
9437     __pyx_t_20.memview = NULL;
9438     __pyx_t_20.data = NULL;
9439 
9440     /* "urh/cythonext/path_creator.pyx":68
9441  *     else:
9442  *         x = np.arange(start, end, dtype=np.int64)
9443  *         values = samples[start:end]             # <<<<<<<<<<<<<<
9444  *         scale_factor = 1.0
9445  *
9446  */
9447     __pyx_t_10.data = __pyx_v_samples.data;
9448     __pyx_t_10.memview = __pyx_v_samples.memview;
9449     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
9450     __pyx_t_19 = -1;
9451     if (unlikely(__pyx_memoryview_slice_memviewslice(
9452     &__pyx_t_10,
9453     __pyx_v_samples.shape[0], __pyx_v_samples.strides[0], __pyx_v_samples.suboffsets[0],
9454     0,
9455     0,
9456     &__pyx_t_19,
9457     __pyx_v_start,
9458     __pyx_v_end,
9459     0,
9460     1,
9461     1,
9462     0,
9463     1) < 0))
9464 {
9465     __PYX_ERR(0, 68, __pyx_L1_error)
9466 }
9467 
9468 __pyx_v_values = __pyx_t_10;
9469     __pyx_t_10.memview = NULL;
9470     __pyx_t_10.data = NULL;
9471 
9472     /* "urh/cythonext/path_creator.pyx":69
9473  *         x = np.arange(start, end, dtype=np.int64)
9474  *         values = samples[start:end]
9475  *         scale_factor = 1.0             # <<<<<<<<<<<<<<
9476  *
9477  *     cdef list result = []
9478  */
9479     __pyx_v_scale_factor = 1.0;
9480   }
9481   __pyx_L4:;
9482 
9483   /* "urh/cythonext/path_creator.pyx":71
9484  *         scale_factor = 1.0
9485  *
9486  *     cdef list result = []             # <<<<<<<<<<<<<<
9487  *     if scale_factor == 0:
9488  *         scale_factor = 1  # prevent division by zero
9489  */
9490   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
9491   __Pyx_GOTREF(__pyx_t_2);
9492   __pyx_v_result = ((PyObject*)__pyx_t_2);
9493   __pyx_t_2 = 0;
9494 
9495   /* "urh/cythonext/path_creator.pyx":72
9496  *
9497  *     cdef list result = []
9498  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
9499  *         scale_factor = 1  # prevent division by zero
9500  *
9501  */
9502   __pyx_t_4 = ((__pyx_v_scale_factor == 0.0) != 0);
9503   if (__pyx_t_4) {
9504 
9505     /* "urh/cythonext/path_creator.pyx":73
9506  *     cdef list result = []
9507  *     if scale_factor == 0:
9508  *         scale_factor = 1  # prevent division by zero             # <<<<<<<<<<<<<<
9509  *
9510  *     for subpath_range in subpath_ranges:
9511  */
9512     __pyx_v_scale_factor = 1.0;
9513 
9514     /* "urh/cythonext/path_creator.pyx":72
9515  *
9516  *     cdef list result = []
9517  *     if scale_factor == 0:             # <<<<<<<<<<<<<<
9518  *         scale_factor = 1  # prevent division by zero
9519  *
9520  */
9521   }
9522 
9523   /* "urh/cythonext/path_creator.pyx":75
9524  *         scale_factor = 1  # prevent division by zero
9525  *
9526  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
9527  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
9528  *         sub_start =int(max(0, math.floor(sub_start)))
9529  */
9530   if (unlikely(__pyx_v_subpath_ranges == Py_None)) {
9531     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
9532     __PYX_ERR(0, 75, __pyx_L1_error)
9533   }
9534   __pyx_t_2 = __pyx_v_subpath_ranges; __Pyx_INCREF(__pyx_t_2); __pyx_t_21 = 0;
9535   for (;;) {
9536     if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_2)) break;
9537     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9538     __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_21); __Pyx_INCREF(__pyx_t_5); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error)
9539     #else
9540     __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
9541     __Pyx_GOTREF(__pyx_t_5);
9542     #endif
9543     __Pyx_XDECREF_SET(__pyx_v_subpath_range, __pyx_t_5);
9544     __pyx_t_5 = 0;
9545 
9546     /* "urh/cythonext/path_creator.pyx":76
9547  *
9548  *     for subpath_range in subpath_ranges:
9549  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
9550  *         sub_start =int(max(0, math.floor(sub_start)))
9551  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
9552  */
9553     __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_subpath_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
9554     __Pyx_GOTREF(__pyx_t_5);
9555     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
9556     __Pyx_GOTREF(__pyx_t_3);
9557     __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
9558     __Pyx_GOTREF(__pyx_t_7);
9559     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9560     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9561     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
9562     __Pyx_GOTREF(__pyx_t_3);
9563     __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
9564     __Pyx_GOTREF(__pyx_t_5);
9565     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9566     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9567     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
9568     __Pyx_GOTREF(__pyx_t_3);
9569     __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
9570     __Pyx_GOTREF(__pyx_t_7);
9571     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9572     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9573     __pyx_t_3 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
9574     __Pyx_GOTREF(__pyx_t_3);
9575     __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
9576     __Pyx_GOTREF(__pyx_t_5);
9577     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9578     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9579     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
9580     __Pyx_GOTREF(__pyx_t_3);
9581     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
9582     __Pyx_GOTREF(__pyx_t_7);
9583     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9584     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9585     __Pyx_XDECREF_SET(__pyx_v_sub_start, __pyx_t_7);
9586     __pyx_t_7 = 0;
9587 
9588     /* "urh/cythonext/path_creator.pyx":77
9589  *     for subpath_range in subpath_ranges:
9590  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
9591  *         sub_start =int(max(0, math.floor(sub_start)))             # <<<<<<<<<<<<<<
9592  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
9593  *         sub_end = int(max(0, math.ceil(sub_end)))
9594  */
9595     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
9596     __Pyx_GOTREF(__pyx_t_3);
9597     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
9598     __Pyx_GOTREF(__pyx_t_5);
9599     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9600     __pyx_t_3 = NULL;
9601     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9602       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
9603       if (likely(__pyx_t_3)) {
9604         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9605         __Pyx_INCREF(__pyx_t_3);
9606         __Pyx_INCREF(function);
9607         __Pyx_DECREF_SET(__pyx_t_5, function);
9608       }
9609     }
9610     __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_sub_start) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_sub_start);
9611     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9612     if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
9613     __Pyx_GOTREF(__pyx_t_7);
9614     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9615     __pyx_t_22 = 0;
9616     __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
9617     __Pyx_GOTREF(__pyx_t_3);
9618     __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
9619     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9620     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 77, __pyx_L1_error)
9621     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9622     if (__pyx_t_4) {
9623       __Pyx_INCREF(__pyx_t_7);
9624       __pyx_t_5 = __pyx_t_7;
9625     } else {
9626       __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
9627       __Pyx_GOTREF(__pyx_t_1);
9628       __pyx_t_5 = __pyx_t_1;
9629       __pyx_t_1 = 0;
9630     }
9631     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9632     __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
9633     __Pyx_GOTREF(__pyx_t_7);
9634     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9635     __Pyx_DECREF_SET(__pyx_v_sub_start, __pyx_t_7);
9636     __pyx_t_7 = 0;
9637 
9638     /* "urh/cythonext/path_creator.pyx":78
9639  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
9640  *         sub_start =int(max(0, math.floor(sub_start)))
9641  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor             # <<<<<<<<<<<<<<
9642  *         sub_end = int(max(0, math.ceil(sub_end)))
9643  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
9644  */
9645     __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_subpath_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
9646     __Pyx_GOTREF(__pyx_t_7);
9647     __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
9648     __Pyx_GOTREF(__pyx_t_5);
9649     __pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
9650     __Pyx_GOTREF(__pyx_t_1);
9651     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9652     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9653     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
9654     __Pyx_GOTREF(__pyx_t_5);
9655     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
9656     __Pyx_GOTREF(__pyx_t_7);
9657     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9658     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9659     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
9660     __Pyx_GOTREF(__pyx_t_5);
9661     __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
9662     __Pyx_GOTREF(__pyx_t_1);
9663     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9664     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9665     __pyx_t_5 = PyFloat_FromDouble((2.0 * __pyx_v_scale_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
9666     __Pyx_GOTREF(__pyx_t_5);
9667     __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
9668     __Pyx_GOTREF(__pyx_t_7);
9669     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9670     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9671     __pyx_t_5 = PyFloat_FromDouble(__pyx_v_scale_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
9672     __Pyx_GOTREF(__pyx_t_5);
9673     __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
9674     __Pyx_GOTREF(__pyx_t_1);
9675     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9676     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9677     __Pyx_XDECREF_SET(__pyx_v_sub_end, __pyx_t_1);
9678     __pyx_t_1 = 0;
9679 
9680     /* "urh/cythonext/path_creator.pyx":79
9681  *         sub_start =int(max(0, math.floor(sub_start)))
9682  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
9683  *         sub_end = int(max(0, math.ceil(sub_end)))             # <<<<<<<<<<<<<<
9684  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
9685  *
9686  */
9687     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
9688     __Pyx_GOTREF(__pyx_t_5);
9689     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ceil); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
9690     __Pyx_GOTREF(__pyx_t_7);
9691     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9692     __pyx_t_5 = NULL;
9693     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
9694       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
9695       if (likely(__pyx_t_5)) {
9696         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
9697         __Pyx_INCREF(__pyx_t_5);
9698         __Pyx_INCREF(function);
9699         __Pyx_DECREF_SET(__pyx_t_7, function);
9700       }
9701     }
9702     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_sub_end) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_sub_end);
9703     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9704     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
9705     __Pyx_GOTREF(__pyx_t_1);
9706     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9707     __pyx_t_22 = 0;
9708     __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
9709     __Pyx_GOTREF(__pyx_t_5);
9710     __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
9711     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9712     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
9713     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9714     if (__pyx_t_4) {
9715       __Pyx_INCREF(__pyx_t_1);
9716       __pyx_t_7 = __pyx_t_1;
9717     } else {
9718       __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
9719       __Pyx_GOTREF(__pyx_t_3);
9720       __pyx_t_7 = __pyx_t_3;
9721       __pyx_t_3 = 0;
9722     }
9723     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9724     __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
9725     __Pyx_GOTREF(__pyx_t_1);
9726     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9727     __Pyx_DECREF_SET(__pyx_v_sub_end, __pyx_t_1);
9728     __pyx_t_1 = 0;
9729 
9730     /* "urh/cythonext/path_creator.pyx":80
9731  *         sub_end = ((((subpath_range[1]-start)/scale_factor) * scale_factor) + 2*scale_factor) / scale_factor
9732  *         sub_end = int(max(0, math.ceil(sub_end)))
9733  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))             # <<<<<<<<<<<<<<
9734  *
9735  *     return result
9736  */
9737     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
9738     __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
9739     __pyx_t_20.data = __pyx_v_x.data;
9740     __pyx_t_20.memview = __pyx_v_x.memview;
9741     __PYX_INC_MEMVIEW(&__pyx_t_20, 0);
9742     __pyx_t_19 = -1;
9743     if (unlikely(__pyx_memoryview_slice_memviewslice(
9744     &__pyx_t_20,
9745     __pyx_v_x.shape[0], __pyx_v_x.strides[0], __pyx_v_x.suboffsets[0],
9746     0,
9747     0,
9748     &__pyx_t_19,
9749     __pyx_t_23,
9750     __pyx_t_24,
9751     0,
9752     1,
9753     1,
9754     0,
9755     1) < 0))
9756 {
9757     __PYX_ERR(0, 80, __pyx_L1_error)
9758 }
9759 
9760 __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_start); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
9761     __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_sub_end); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
9762     __pyx_t_10.data = __pyx_v_values.data;
9763     __pyx_t_10.memview = __pyx_v_values.memview;
9764     __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
9765     __pyx_t_19 = -1;
9766     if (unlikely(__pyx_memoryview_slice_memviewslice(
9767     &__pyx_t_10,
9768     __pyx_v_values.shape[0], __pyx_v_values.strides[0], __pyx_v_values.suboffsets[0],
9769     0,
9770     0,
9771     &__pyx_t_19,
9772     __pyx_t_24,
9773     __pyx_t_23,
9774     0,
9775     1,
9776     1,
9777     0,
9778     1) < 0))
9779 {
9780     __PYX_ERR(0, 80, __pyx_L1_error)
9781 }
9782 
9783 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_10, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
9784     __Pyx_GOTREF(__pyx_t_1);
9785     __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
9786     __pyx_t_10.memview = NULL;
9787     __pyx_t_10.data = NULL;
9788     __pyx_t_7 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_20, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
9789     __Pyx_GOTREF(__pyx_t_7);
9790     __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
9791     __pyx_t_20.memview = NULL;
9792     __pyx_t_20.data = NULL;
9793     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9794     __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error)
9795     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9796 
9797     /* "urh/cythonext/path_creator.pyx":75
9798  *         scale_factor = 1  # prevent division by zero
9799  *
9800  *     for subpath_range in subpath_ranges:             # <<<<<<<<<<<<<<
9801  *         sub_start = ((((subpath_range[0]-start)/scale_factor) * scale_factor) - 2*scale_factor) / scale_factor
9802  *         sub_start =int(max(0, math.floor(sub_start)))
9803  */
9804   }
9805   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9806 
9807   /* "urh/cythonext/path_creator.pyx":82
9808  *         result.append(array_to_QPath(x[sub_start:sub_end], values[sub_start:sub_end]))
9809  *
9810  *     return result             # <<<<<<<<<<<<<<
9811  *
9812  *
9813  */
9814   __Pyx_XDECREF(__pyx_r);
9815   __Pyx_INCREF(__pyx_v_result);
9816   __pyx_r = __pyx_v_result;
9817   goto __pyx_L0;
9818 
9819   /* "urh/cythonext/path_creator.pyx":19
9820  * import struct
9821  *
9822  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
9823  *     cdef iq[:] values
9824  *     cdef long long[::1] sample_rng
9825  */
9826 
9827   /* function exit code */
9828   __pyx_L1_error:;
9829   __Pyx_XDECREF(__pyx_t_1);
9830   __Pyx_XDECREF(__pyx_t_2);
9831   __Pyx_XDECREF(__pyx_t_3);
9832   __Pyx_XDECREF(__pyx_t_5);
9833   __Pyx_XDECREF(__pyx_t_7);
9834   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
9835   __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
9836   __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
9837   __Pyx_AddTraceback("urh.cythonext.path_creator.create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
9838   __pyx_r = 0;
9839   __pyx_L0:;
9840   __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
9841   __PYX_XDEC_MEMVIEW(&__pyx_v_sample_rng, 1);
9842   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
9843   __Pyx_XDECREF(__pyx_v_type_lookup);
9844   __Pyx_XDECREF(__pyx_v_result);
9845   __Pyx_XDECREF(__pyx_v_subpath_range);
9846   __Pyx_XDECREF(__pyx_v_sub_start);
9847   __Pyx_XDECREF(__pyx_v_sub_end);
9848   __Pyx_XDECREF(__pyx_v_subpath_ranges);
9849   __Pyx_XGIVEREF(__pyx_r);
9850   __Pyx_RefNannyFinishContext();
9851   return __pyx_r;
9852 }
9853 
9854 /* Python wrapper */
9855 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_15__pyx_fuse_4create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9856 static PyMethodDef __pyx_fuse_4__pyx_mdef_3urh_9cythonext_12path_creator_15__pyx_fuse_4create_path = {"__pyx_fuse_4create_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_15__pyx_fuse_4create_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_15__pyx_fuse_4create_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9857 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_15__pyx_fuse_4create_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9858   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
9859   PY_LONG_LONG __pyx_v_start;
9860   PY_LONG_LONG __pyx_v_end;
9861   PyObject *__pyx_v_subpath_ranges = 0;
9862   int __pyx_lineno = 0;
9863   const char *__pyx_filename = NULL;
9864   int __pyx_clineno = 0;
9865   PyObject *__pyx_r = 0;
9866   __Pyx_RefNannyDeclarations
9867   __Pyx_RefNannySetupContext("__pyx_fuse_4create_path (wrapper)", 0);
9868   {
9869     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_subpath_ranges,0};
9870     PyObject* values[4] = {0,0,0,0};
9871     values[3] = __pyx_k__10;
9872     if (unlikely(__pyx_kwds)) {
9873       Py_ssize_t kw_args;
9874       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9875       switch (pos_args) {
9876         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9877         CYTHON_FALLTHROUGH;
9878         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9879         CYTHON_FALLTHROUGH;
9880         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9881         CYTHON_FALLTHROUGH;
9882         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9883         CYTHON_FALLTHROUGH;
9884         case  0: break;
9885         default: goto __pyx_L5_argtuple_error;
9886       }
9887       kw_args = PyDict_Size(__pyx_kwds);
9888       switch (pos_args) {
9889         case  0:
9890         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
9891         else goto __pyx_L5_argtuple_error;
9892         CYTHON_FALLTHROUGH;
9893         case  1:
9894         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
9895         else {
9896           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4create_path", 0, 3, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
9897         }
9898         CYTHON_FALLTHROUGH;
9899         case  2:
9900         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
9901         else {
9902           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4create_path", 0, 3, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
9903         }
9904         CYTHON_FALLTHROUGH;
9905         case  3:
9906         if (kw_args > 0) {
9907           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subpath_ranges);
9908           if (value) { values[3] = value; kw_args--; }
9909         }
9910       }
9911       if (unlikely(kw_args > 0)) {
9912         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_4create_path") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
9913       }
9914     } else {
9915       switch (PyTuple_GET_SIZE(__pyx_args)) {
9916         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9917         CYTHON_FALLTHROUGH;
9918         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9919         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9920         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9921         break;
9922         default: goto __pyx_L5_argtuple_error;
9923       }
9924     }
9925     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 19, __pyx_L3_error)
9926     __pyx_v_start = __Pyx_PyInt_As_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_start == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
9927     __pyx_v_end = __Pyx_PyInt_As_PY_LONG_LONG(values[2]); if (unlikely((__pyx_v_end == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
9928     __pyx_v_subpath_ranges = ((PyObject*)values[3]);
9929   }
9930   goto __pyx_L4_argument_unpacking_done;
9931   __pyx_L5_argtuple_error:;
9932   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4create_path", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
9933   __pyx_L3_error:;
9934   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_4create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
9935   __Pyx_RefNannyFinishContext();
9936   return NULL;
9937   __pyx_L4_argument_unpacking_done:;
9938   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subpath_ranges), (&PyList_Type), 1, "subpath_ranges", 1))) __PYX_ERR(0, 19, __pyx_L1_error)
9939   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_14__pyx_fuse_4create_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end, __pyx_v_subpath_ranges);
9940 
9941   /* function exit code */
9942   goto __pyx_L0;
9943   __pyx_L1_error:;
9944   __pyx_r = NULL;
9945   __pyx_L0:;
9946   __Pyx_RefNannyFinishContext();
9947   return __pyx_r;
9948 }
9949 
__pyx_pf_3urh_9cythonext_12path_creator_14__pyx_fuse_4create_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,PY_LONG_LONG __pyx_v_start,PY_LONG_LONG __pyx_v_end,PyObject * __pyx_v_subpath_ranges)9950 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_14__pyx_fuse_4create_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, PY_LONG_LONG __pyx_v_start, PY_LONG_LONG __pyx_v_end, PyObject *__pyx_v_subpath_ranges) {
9951   PyObject *__pyx_r = NULL;
9952   __Pyx_RefNannyDeclarations
9953   PyObject *__pyx_t_1 = NULL;
9954   struct __pyx_fuse_4__pyx_opt_args_3urh_9cythonext_12path_creator_create_path __pyx_t_2;
9955   int __pyx_lineno = 0;
9956   const char *__pyx_filename = NULL;
9957   int __pyx_clineno = 0;
9958   __Pyx_RefNannySetupContext("__pyx_fuse_4create_path", 0);
9959   __Pyx_XDECREF(__pyx_r);
9960   __pyx_t_2.__pyx_n = 1;
9961   __pyx_t_2.subpath_ranges = __pyx_v_subpath_ranges;
9962   __pyx_t_1 = __pyx_fuse_4__pyx_f_3urh_9cythonext_12path_creator_create_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
9963   __Pyx_GOTREF(__pyx_t_1);
9964   __pyx_r = __pyx_t_1;
9965   __pyx_t_1 = 0;
9966   goto __pyx_L0;
9967 
9968   /* function exit code */
9969   __pyx_L1_error:;
9970   __Pyx_XDECREF(__pyx_t_1);
9971   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_4create_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
9972   __pyx_r = NULL;
9973   __pyx_L0:;
9974   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
9975   __Pyx_XGIVEREF(__pyx_r);
9976   __Pyx_RefNannyFinishContext();
9977   return __pyx_r;
9978 }
9979 
9980 /* "urh/cythonext/path_creator.pyx":85
9981  *
9982  *
9983  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):             # <<<<<<<<<<<<<<
9984  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
9985  *
9986  */
9987 
9988 /* Python wrapper */
9989 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9990 static PyMethodDef __pyx_mdef_3urh_9cythonext_12path_creator_3create_live_path = {"create_live_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9991 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9992   PyObject *__pyx_v_signatures = 0;
9993   PyObject *__pyx_v_args = 0;
9994   PyObject *__pyx_v_kwargs = 0;
9995   CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
9996   int __pyx_lineno = 0;
9997   const char *__pyx_filename = NULL;
9998   int __pyx_clineno = 0;
9999   PyObject *__pyx_r = 0;
10000   __Pyx_RefNannyDeclarations
10001   __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
10002   {
10003     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
10004     PyObject* values[4] = {0,0,0,0};
10005     if (unlikely(__pyx_kwds)) {
10006       Py_ssize_t kw_args;
10007       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10008       switch (pos_args) {
10009         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10010         CYTHON_FALLTHROUGH;
10011         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10012         CYTHON_FALLTHROUGH;
10013         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10014         CYTHON_FALLTHROUGH;
10015         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10016         CYTHON_FALLTHROUGH;
10017         case  0: break;
10018         default: goto __pyx_L5_argtuple_error;
10019       }
10020       kw_args = PyDict_Size(__pyx_kwds);
10021       switch (pos_args) {
10022         case  0:
10023         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
10024         else goto __pyx_L5_argtuple_error;
10025         CYTHON_FALLTHROUGH;
10026         case  1:
10027         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
10028         else {
10029           __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 85, __pyx_L3_error)
10030         }
10031         CYTHON_FALLTHROUGH;
10032         case  2:
10033         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
10034         else {
10035           __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 85, __pyx_L3_error)
10036         }
10037         CYTHON_FALLTHROUGH;
10038         case  3:
10039         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
10040         else {
10041           __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 85, __pyx_L3_error)
10042         }
10043       }
10044       if (unlikely(kw_args > 0)) {
10045         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
10046       }
10047     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
10048       goto __pyx_L5_argtuple_error;
10049     } else {
10050       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10051       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10052       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10053       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10054     }
10055     __pyx_v_signatures = values[0];
10056     __pyx_v_args = values[1];
10057     __pyx_v_kwargs = values[2];
10058     __pyx_v_defaults = values[3];
10059   }
10060   goto __pyx_L4_argument_unpacking_done;
10061   __pyx_L5_argtuple_error:;
10062   __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
10063   __pyx_L3_error:;
10064   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
10065   __Pyx_RefNannyFinishContext();
10066   return NULL;
10067   __pyx_L4_argument_unpacking_done:;
10068   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_2create_live_path(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);
10069 
10070   /* function exit code */
10071   __Pyx_RefNannyFinishContext();
10072   return __pyx_r;
10073 }
10074 
__pyx_pf_3urh_9cythonext_12path_creator_2create_live_path(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_signatures,PyObject * __pyx_v_args,PyObject * __pyx_v_kwargs,CYTHON_UNUSED PyObject * __pyx_v_defaults)10075 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_2create_live_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
10076   PyObject *__pyx_v_dest_sig = NULL;
10077   Py_ssize_t __pyx_v_i;
10078   PyTypeObject *__pyx_v_ndarray = 0;
10079   __Pyx_memviewslice __pyx_v_memslice;
10080   Py_ssize_t __pyx_v_itemsize;
10081   int __pyx_v_dtype_signed;
10082   char __pyx_v_kind;
10083   int __pyx_v_char_is_signed;
10084   int __pyx_v_unsigned_char_is_signed;
10085   int __pyx_v_short_is_signed;
10086   int __pyx_v_unsigned_short_is_signed;
10087   PyObject *__pyx_v_arg = NULL;
10088   PyObject *__pyx_v_dtype = NULL;
10089   PyObject *__pyx_v_arg_base = NULL;
10090   PyObject *__pyx_v_candidates = NULL;
10091   PyObject *__pyx_v_sig = NULL;
10092   int __pyx_v_match_found;
10093   PyObject *__pyx_v_src_sig = NULL;
10094   PyObject *__pyx_v_dst_type = NULL;
10095   PyObject *__pyx_r = NULL;
10096   __Pyx_RefNannyDeclarations
10097   PyObject *__pyx_t_1 = NULL;
10098   int __pyx_t_2;
10099   int __pyx_t_3;
10100   int __pyx_t_4;
10101   Py_ssize_t __pyx_t_5;
10102   PyObject *__pyx_t_6 = NULL;
10103   long __pyx_t_7;
10104   __Pyx_memviewslice __pyx_t_8;
10105   Py_ssize_t __pyx_t_9;
10106   int __pyx_t_10;
10107   int __pyx_t_11;
10108   PyObject *__pyx_t_12 = NULL;
10109   PyObject *__pyx_t_13 = NULL;
10110   PyObject *__pyx_t_14 = NULL;
10111   Py_ssize_t __pyx_t_15;
10112   Py_ssize_t __pyx_t_16;
10113   Py_ssize_t __pyx_t_17;
10114   int __pyx_t_18;
10115   int __pyx_lineno = 0;
10116   const char *__pyx_filename = NULL;
10117   int __pyx_clineno = 0;
10118   __Pyx_RefNannySetupContext("create_live_path", 0);
10119   __Pyx_INCREF(__pyx_v_kwargs);
10120   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10121   __Pyx_GOTREF(__pyx_t_1);
10122   __Pyx_INCREF(Py_None);
10123   __Pyx_GIVEREF(Py_None);
10124   PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
10125   __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
10126   __pyx_t_1 = 0;
10127   __pyx_t_3 = (__pyx_v_kwargs != Py_None);
10128   __pyx_t_4 = (__pyx_t_3 != 0);
10129   if (__pyx_t_4) {
10130   } else {
10131     __pyx_t_2 = __pyx_t_4;
10132     goto __pyx_L4_bool_binop_done;
10133   }
10134   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10135   __pyx_t_3 = ((!__pyx_t_4) != 0);
10136   __pyx_t_2 = __pyx_t_3;
10137   __pyx_L4_bool_binop_done:;
10138   if (__pyx_t_2) {
10139     __Pyx_INCREF(Py_None);
10140     __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None);
10141   }
10142   __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10143   __Pyx_GOTREF(__pyx_t_1);
10144   __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
10145   __pyx_t_1 = 0;
10146   __pyx_v_itemsize = -1L;
10147   __pyx_v_char_is_signed = (!((((char)-1L) > 0) != 0));
10148   __pyx_v_unsigned_char_is_signed = (!((((unsigned char)-1L) > 0) != 0));
10149   __pyx_v_short_is_signed = (!((((short)-1L) > 0) != 0));
10150   __pyx_v_unsigned_short_is_signed = (!((((unsigned short)-1L) > 0) != 0));
10151   if (unlikely(__pyx_v_args == Py_None)) {
10152     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
10153     __PYX_ERR(0, 85, __pyx_L1_error)
10154   }
10155   __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 85, __pyx_L1_error)
10156   __pyx_t_2 = ((0 < __pyx_t_5) != 0);
10157   if (__pyx_t_2) {
10158     if (unlikely(__pyx_v_args == Py_None)) {
10159       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10160       __PYX_ERR(0, 85, __pyx_L1_error)
10161     }
10162     __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
10163     __Pyx_INCREF(__pyx_t_1);
10164     __pyx_v_arg = __pyx_t_1;
10165     __pyx_t_1 = 0;
10166     goto __pyx_L6;
10167   }
10168   __pyx_t_3 = (__pyx_v_kwargs != Py_None);
10169   __pyx_t_4 = (__pyx_t_3 != 0);
10170   if (__pyx_t_4) {
10171   } else {
10172     __pyx_t_2 = __pyx_t_4;
10173     goto __pyx_L7_bool_binop_done;
10174   }
10175   if (unlikely(__pyx_v_kwargs == Py_None)) {
10176     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
10177     __PYX_ERR(0, 85, __pyx_L1_error)
10178   }
10179   __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_samples, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10180   __pyx_t_3 = (__pyx_t_4 != 0);
10181   __pyx_t_2 = __pyx_t_3;
10182   __pyx_L7_bool_binop_done:;
10183   if (__pyx_t_2) {
10184     if (unlikely(__pyx_v_kwargs == Py_None)) {
10185       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10186       __PYX_ERR(0, 85, __pyx_L1_error)
10187     }
10188     __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10189     __Pyx_GOTREF(__pyx_t_1);
10190     __pyx_v_arg = __pyx_t_1;
10191     __pyx_t_1 = 0;
10192     goto __pyx_L6;
10193   }
10194   /*else*/ {
10195     if (unlikely(__pyx_v_args == Py_None)) {
10196       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
10197       __PYX_ERR(0, 85, __pyx_L1_error)
10198     }
10199     __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 85, __pyx_L1_error)
10200     __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10201     __Pyx_GOTREF(__pyx_t_1);
10202     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10203     __Pyx_GOTREF(__pyx_t_6);
10204     __Pyx_INCREF(__pyx_int_3);
10205     __Pyx_GIVEREF(__pyx_int_3);
10206     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_3);
10207     __Pyx_INCREF(__pyx_n_s_s);
10208     __Pyx_GIVEREF(__pyx_n_s_s);
10209     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s);
10210     __Pyx_GIVEREF(__pyx_t_1);
10211     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
10212     __pyx_t_1 = 0;
10213     __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10214     __Pyx_GOTREF(__pyx_t_1);
10215     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10216     __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10217     __Pyx_GOTREF(__pyx_t_6);
10218     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10219     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10220     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10221     __PYX_ERR(0, 85, __pyx_L1_error)
10222   }
10223   __pyx_L6:;
10224   while (1) {
10225     __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
10226     __pyx_t_3 = (__pyx_t_2 != 0);
10227     if (__pyx_t_3) {
10228       __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
10229       __pyx_t_2 = (__pyx_t_3 != 0);
10230       if (__pyx_t_2) {
10231         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10232         __Pyx_GOTREF(__pyx_t_6);
10233         __pyx_v_dtype = __pyx_t_6;
10234         __pyx_t_6 = 0;
10235         goto __pyx_L12;
10236       }
10237       __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
10238       __pyx_t_3 = (__pyx_t_2 != 0);
10239       if (__pyx_t_3) {
10240         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10241         __Pyx_GOTREF(__pyx_t_6);
10242         __pyx_v_arg_base = __pyx_t_6;
10243         __pyx_t_6 = 0;
10244         __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
10245         __pyx_t_2 = (__pyx_t_3 != 0);
10246         if (__pyx_t_2) {
10247           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10248           __Pyx_GOTREF(__pyx_t_6);
10249           __pyx_v_dtype = __pyx_t_6;
10250           __pyx_t_6 = 0;
10251           goto __pyx_L13;
10252         }
10253         /*else*/ {
10254           __Pyx_INCREF(Py_None);
10255           __pyx_v_dtype = Py_None;
10256         }
10257         __pyx_L13:;
10258         goto __pyx_L12;
10259       }
10260       /*else*/ {
10261         __Pyx_INCREF(Py_None);
10262         __pyx_v_dtype = Py_None;
10263       }
10264       __pyx_L12:;
10265       __pyx_v_itemsize = -1L;
10266       __pyx_t_2 = (__pyx_v_dtype != Py_None);
10267       __pyx_t_3 = (__pyx_t_2 != 0);
10268       if (__pyx_t_3) {
10269         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10270         __Pyx_GOTREF(__pyx_t_6);
10271         __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
10272         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10273         __pyx_v_itemsize = __pyx_t_5;
10274         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10275         __Pyx_GOTREF(__pyx_t_6);
10276         __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 85, __pyx_L1_error)
10277         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10278         __pyx_v_kind = __pyx_t_7;
10279         __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
10280         switch (__pyx_v_kind) {
10281           case 'i':
10282           case 'u':
10283           __pyx_t_2 = (((sizeof(char)) == __pyx_v_itemsize) != 0);
10284           if (__pyx_t_2) {
10285           } else {
10286             __pyx_t_3 = __pyx_t_2;
10287             goto __pyx_L16_bool_binop_done;
10288           }
10289           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10290           __Pyx_GOTREF(__pyx_t_6);
10291           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
10292           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10293           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
10294           if (__pyx_t_2) {
10295           } else {
10296             __pyx_t_3 = __pyx_t_2;
10297             goto __pyx_L16_bool_binop_done;
10298           }
10299           __pyx_t_2 = ((!((__pyx_v_char_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
10300           __pyx_t_3 = __pyx_t_2;
10301           __pyx_L16_bool_binop_done:;
10302           if (__pyx_t_3) {
10303             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10304             goto __pyx_L10_break;
10305           }
10306           __pyx_t_2 = (((sizeof(unsigned char)) == __pyx_v_itemsize) != 0);
10307           if (__pyx_t_2) {
10308           } else {
10309             __pyx_t_3 = __pyx_t_2;
10310             goto __pyx_L20_bool_binop_done;
10311           }
10312           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10313           __Pyx_GOTREF(__pyx_t_6);
10314           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
10315           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10316           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
10317           if (__pyx_t_2) {
10318           } else {
10319             __pyx_t_3 = __pyx_t_2;
10320             goto __pyx_L20_bool_binop_done;
10321           }
10322           __pyx_t_2 = ((!((__pyx_v_unsigned_char_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
10323           __pyx_t_3 = __pyx_t_2;
10324           __pyx_L20_bool_binop_done:;
10325           if (__pyx_t_3) {
10326             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10327             goto __pyx_L10_break;
10328           }
10329           __pyx_t_2 = (((sizeof(short)) == __pyx_v_itemsize) != 0);
10330           if (__pyx_t_2) {
10331           } else {
10332             __pyx_t_3 = __pyx_t_2;
10333             goto __pyx_L24_bool_binop_done;
10334           }
10335           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10336           __Pyx_GOTREF(__pyx_t_6);
10337           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
10338           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10339           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
10340           if (__pyx_t_2) {
10341           } else {
10342             __pyx_t_3 = __pyx_t_2;
10343             goto __pyx_L24_bool_binop_done;
10344           }
10345           __pyx_t_2 = ((!((__pyx_v_short_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
10346           __pyx_t_3 = __pyx_t_2;
10347           __pyx_L24_bool_binop_done:;
10348           if (__pyx_t_3) {
10349             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10350             goto __pyx_L10_break;
10351           }
10352           __pyx_t_2 = (((sizeof(unsigned short)) == __pyx_v_itemsize) != 0);
10353           if (__pyx_t_2) {
10354           } else {
10355             __pyx_t_3 = __pyx_t_2;
10356             goto __pyx_L28_bool_binop_done;
10357           }
10358           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10359           __Pyx_GOTREF(__pyx_t_6);
10360           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
10361           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10362           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
10363           if (__pyx_t_2) {
10364           } else {
10365             __pyx_t_3 = __pyx_t_2;
10366             goto __pyx_L28_bool_binop_done;
10367           }
10368           __pyx_t_2 = ((!((__pyx_v_unsigned_short_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
10369           __pyx_t_3 = __pyx_t_2;
10370           __pyx_L28_bool_binop_done:;
10371           if (__pyx_t_3) {
10372             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10373             goto __pyx_L10_break;
10374           }
10375           break;
10376           case 'f':
10377           __pyx_t_2 = (((sizeof(float)) == __pyx_v_itemsize) != 0);
10378           if (__pyx_t_2) {
10379           } else {
10380             __pyx_t_3 = __pyx_t_2;
10381             goto __pyx_L32_bool_binop_done;
10382           }
10383           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10384           __Pyx_GOTREF(__pyx_t_6);
10385           __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
10386           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10387           __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0);
10388           __pyx_t_3 = __pyx_t_2;
10389           __pyx_L32_bool_binop_done:;
10390           if (__pyx_t_3) {
10391             if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10392             goto __pyx_L10_break;
10393           }
10394           break;
10395           case 'c':
10396           break;
10397           case 'O':
10398           break;
10399           default: break;
10400         }
10401       }
10402     }
10403     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
10404     if (!__pyx_t_2) {
10405     } else {
10406       __pyx_t_3 = __pyx_t_2;
10407       goto __pyx_L35_bool_binop_done;
10408     }
10409     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(char))) != 0);
10410     __pyx_t_3 = __pyx_t_2;
10411     __pyx_L35_bool_binop_done:;
10412     if (__pyx_t_3) {
10413       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_char(__pyx_v_arg, 0);
10414       __pyx_v_memslice = __pyx_t_8;
10415       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
10416       if (__pyx_t_3) {
10417         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
10418         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10419         goto __pyx_L10_break;
10420       }
10421       /*else*/ {
10422         PyErr_Clear();
10423       }
10424     }
10425     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
10426     if (!__pyx_t_2) {
10427     } else {
10428       __pyx_t_3 = __pyx_t_2;
10429       goto __pyx_L39_bool_binop_done;
10430     }
10431     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned char))) != 0);
10432     __pyx_t_3 = __pyx_t_2;
10433     __pyx_L39_bool_binop_done:;
10434     if (__pyx_t_3) {
10435       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_v_arg, 0);
10436       __pyx_v_memslice = __pyx_t_8;
10437       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
10438       if (__pyx_t_3) {
10439         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
10440         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10441         goto __pyx_L10_break;
10442       }
10443       /*else*/ {
10444         PyErr_Clear();
10445       }
10446     }
10447     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
10448     if (!__pyx_t_2) {
10449     } else {
10450       __pyx_t_3 = __pyx_t_2;
10451       goto __pyx_L43_bool_binop_done;
10452     }
10453     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(short))) != 0);
10454     __pyx_t_3 = __pyx_t_2;
10455     __pyx_L43_bool_binop_done:;
10456     if (__pyx_t_3) {
10457       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_short(__pyx_v_arg, 0);
10458       __pyx_v_memslice = __pyx_t_8;
10459       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
10460       if (__pyx_t_3) {
10461         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
10462         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10463         goto __pyx_L10_break;
10464       }
10465       /*else*/ {
10466         PyErr_Clear();
10467       }
10468     }
10469     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
10470     if (!__pyx_t_2) {
10471     } else {
10472       __pyx_t_3 = __pyx_t_2;
10473       goto __pyx_L47_bool_binop_done;
10474     }
10475     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned short))) != 0);
10476     __pyx_t_3 = __pyx_t_2;
10477     __pyx_L47_bool_binop_done:;
10478     if (__pyx_t_3) {
10479       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(__pyx_v_arg, 0);
10480       __pyx_v_memslice = __pyx_t_8;
10481       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
10482       if (__pyx_t_3) {
10483         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
10484         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10485         goto __pyx_L10_break;
10486       }
10487       /*else*/ {
10488         PyErr_Clear();
10489       }
10490     }
10491     __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
10492     if (!__pyx_t_2) {
10493     } else {
10494       __pyx_t_3 = __pyx_t_2;
10495       goto __pyx_L51_bool_binop_done;
10496     }
10497     __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(float))) != 0);
10498     __pyx_t_3 = __pyx_t_2;
10499     __pyx_L51_bool_binop_done:;
10500     if (__pyx_t_3) {
10501       __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0);
10502       __pyx_v_memslice = __pyx_t_8;
10503       __pyx_t_3 = (__pyx_v_memslice.memview != 0);
10504       if (__pyx_t_3) {
10505         __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
10506         if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10507         goto __pyx_L10_break;
10508       }
10509       /*else*/ {
10510         PyErr_Clear();
10511       }
10512     }
10513     if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10514     goto __pyx_L10_break;
10515   }
10516   __pyx_L10_break:;
10517   __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10518   __Pyx_GOTREF(__pyx_t_6);
10519   __pyx_v_candidates = ((PyObject*)__pyx_t_6);
10520   __pyx_t_6 = 0;
10521   __pyx_t_5 = 0;
10522   if (unlikely(__pyx_v_signatures == Py_None)) {
10523     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
10524     __PYX_ERR(0, 85, __pyx_L1_error)
10525   }
10526   __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10527   __Pyx_GOTREF(__pyx_t_1);
10528   __Pyx_XDECREF(__pyx_t_6);
10529   __pyx_t_6 = __pyx_t_1;
10530   __pyx_t_1 = 0;
10531   while (1) {
10532     __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10);
10533     if (unlikely(__pyx_t_11 == 0)) break;
10534     if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 85, __pyx_L1_error)
10535     __Pyx_GOTREF(__pyx_t_1);
10536     __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1);
10537     __pyx_t_1 = 0;
10538     __pyx_v_match_found = 0;
10539     __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 85, __pyx_L1_error)
10540     __Pyx_GOTREF(__pyx_t_13);
10541     __pyx_t_14 = NULL;
10542     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
10543       __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
10544       if (likely(__pyx_t_14)) {
10545         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
10546         __Pyx_INCREF(__pyx_t_14);
10547         __Pyx_INCREF(function);
10548         __Pyx_DECREF_SET(__pyx_t_13, function);
10549       }
10550     }
10551     __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2);
10552     __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
10553     if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 85, __pyx_L1_error)
10554     __Pyx_GOTREF(__pyx_t_12);
10555     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10556     __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 85, __pyx_L1_error)
10557     __Pyx_GOTREF(__pyx_t_13);
10558     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10559     __pyx_t_12 = NULL;
10560     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
10561       __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
10562       if (likely(__pyx_t_12)) {
10563         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
10564         __Pyx_INCREF(__pyx_t_12);
10565         __Pyx_INCREF(function);
10566         __Pyx_DECREF_SET(__pyx_t_13, function);
10567       }
10568     }
10569     __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3);
10570     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
10571     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10572     __Pyx_GOTREF(__pyx_t_1);
10573     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10574     __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1);
10575     __pyx_t_1 = 0;
10576     __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 85, __pyx_L1_error)
10577     __pyx_t_16 = __pyx_t_15;
10578     for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
10579       __pyx_v_i = __pyx_t_17;
10580       __pyx_t_1 = PyList_GET_ITEM(__pyx_v_dest_sig, __pyx_v_i);
10581       __Pyx_INCREF(__pyx_t_1);
10582       __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1);
10583       __pyx_t_1 = 0;
10584       __pyx_t_3 = (__pyx_v_dst_type != Py_None);
10585       __pyx_t_2 = (__pyx_t_3 != 0);
10586       if (__pyx_t_2) {
10587         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10588         __Pyx_GOTREF(__pyx_t_1);
10589         __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 85, __pyx_L1_error)
10590         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10591         __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
10592         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10593         if (__pyx_t_2) {
10594           __pyx_v_match_found = 1;
10595           goto __pyx_L59;
10596         }
10597         /*else*/ {
10598           __pyx_v_match_found = 0;
10599           goto __pyx_L57_break;
10600         }
10601         __pyx_L59:;
10602       }
10603     }
10604     __pyx_L57_break:;
10605     __pyx_t_2 = (__pyx_v_match_found != 0);
10606     if (__pyx_t_2) {
10607       __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 85, __pyx_L1_error)
10608     }
10609   }
10610   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10611   __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0);
10612   __pyx_t_3 = ((!__pyx_t_2) != 0);
10613   if (__pyx_t_3) {
10614     __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10615     __Pyx_GOTREF(__pyx_t_6);
10616     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10617     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10618     __PYX_ERR(0, 85, __pyx_L1_error)
10619   }
10620   __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 85, __pyx_L1_error)
10621   __pyx_t_3 = ((__pyx_t_9 > 1) != 0);
10622   if (__pyx_t_3) {
10623     __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10624     __Pyx_GOTREF(__pyx_t_6);
10625     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10626     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10627     __PYX_ERR(0, 85, __pyx_L1_error)
10628   }
10629   /*else*/ {
10630     __Pyx_XDECREF(__pyx_r);
10631     if (unlikely(__pyx_v_signatures == Py_None)) {
10632       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10633       __PYX_ERR(0, 85, __pyx_L1_error)
10634     }
10635     __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
10636     __Pyx_GOTREF(__pyx_t_6);
10637     __pyx_r = __pyx_t_6;
10638     __pyx_t_6 = 0;
10639     goto __pyx_L0;
10640   }
10641 
10642   /* function exit code */
10643   __pyx_L1_error:;
10644   __Pyx_XDECREF(__pyx_t_1);
10645   __Pyx_XDECREF(__pyx_t_6);
10646   __Pyx_XDECREF(__pyx_t_12);
10647   __Pyx_XDECREF(__pyx_t_13);
10648   __Pyx_XDECREF(__pyx_t_14);
10649   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
10650   __pyx_r = NULL;
10651   __pyx_L0:;
10652   __Pyx_XDECREF(__pyx_v_dest_sig);
10653   __Pyx_XDECREF(__pyx_v_ndarray);
10654   __Pyx_XDECREF(__pyx_v_arg);
10655   __Pyx_XDECREF(__pyx_v_dtype);
10656   __Pyx_XDECREF(__pyx_v_arg_base);
10657   __Pyx_XDECREF(__pyx_v_candidates);
10658   __Pyx_XDECREF(__pyx_v_sig);
10659   __Pyx_XDECREF(__pyx_v_src_sig);
10660   __Pyx_XDECREF(__pyx_v_dst_type);
10661   __Pyx_XDECREF(__pyx_v_kwargs);
10662   __Pyx_XGIVEREF(__pyx_r);
10663   __Pyx_RefNannyFinishContext();
10664   return __pyx_r;
10665 }
10666 
10667 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_19__pyx_fuse_0create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10668 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_0__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch)10669 static PyObject *__pyx_fuse_0__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch) {
10670   PyObject *__pyx_r = NULL;
10671   __Pyx_RefNannyDeclarations
10672   PyObject *__pyx_t_1 = NULL;
10673   PyObject *__pyx_t_2 = NULL;
10674   PyObject *__pyx_t_3 = NULL;
10675   PyObject *__pyx_t_4 = NULL;
10676   PyObject *__pyx_t_5 = NULL;
10677   PyObject *__pyx_t_6 = NULL;
10678   int __pyx_t_7;
10679   PyObject *__pyx_t_8 = NULL;
10680   __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
10681   int __pyx_lineno = 0;
10682   const char *__pyx_filename = NULL;
10683   int __pyx_clineno = 0;
10684   __Pyx_RefNannySetupContext("__pyx_fuse_0create_live_path", 0);
10685 
10686   /* "urh/cythonext/path_creator.pyx":86
10687  *
10688  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):
10689  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)             # <<<<<<<<<<<<<<
10690  *
10691  * cpdef array_to_QPath(np.int64_t[:] x, y):
10692  */
10693   __Pyx_XDECREF(__pyx_r);
10694   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
10695   __Pyx_GOTREF(__pyx_t_3);
10696   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
10697   __Pyx_GOTREF(__pyx_t_4);
10698   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10699   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
10700   __Pyx_GOTREF(__pyx_t_3);
10701   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
10702   __Pyx_GOTREF(__pyx_t_5);
10703   __pyx_t_6 = NULL;
10704   __pyx_t_7 = 0;
10705   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
10706     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
10707     if (likely(__pyx_t_6)) {
10708       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10709       __Pyx_INCREF(__pyx_t_6);
10710       __Pyx_INCREF(function);
10711       __Pyx_DECREF_SET(__pyx_t_4, function);
10712       __pyx_t_7 = 1;
10713     }
10714   }
10715   #if CYTHON_FAST_PYCALL
10716   if (PyFunction_Check(__pyx_t_4)) {
10717     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
10718     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
10719     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10720     __Pyx_GOTREF(__pyx_t_2);
10721     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10722     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10723   } else
10724   #endif
10725   #if CYTHON_FAST_PYCCALL
10726   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10727     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
10728     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
10729     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10730     __Pyx_GOTREF(__pyx_t_2);
10731     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10732     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10733   } else
10734   #endif
10735   {
10736     __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
10737     __Pyx_GOTREF(__pyx_t_8);
10738     if (__pyx_t_6) {
10739       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
10740     }
10741     __Pyx_GIVEREF(__pyx_t_3);
10742     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
10743     __Pyx_GIVEREF(__pyx_t_5);
10744     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
10745     __pyx_t_3 = 0;
10746     __pyx_t_5 = 0;
10747     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
10748     __Pyx_GOTREF(__pyx_t_2);
10749     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10750   }
10751   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10752   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
10753   __Pyx_GOTREF(__pyx_t_4);
10754   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10755   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
10756   __Pyx_GOTREF(__pyx_t_2);
10757   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
10758   __Pyx_GOTREF(__pyx_t_8);
10759   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10760   __pyx_t_2 = NULL;
10761   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10762     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
10763     if (likely(__pyx_t_2)) {
10764       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10765       __Pyx_INCREF(__pyx_t_2);
10766       __Pyx_INCREF(function);
10767       __Pyx_DECREF_SET(__pyx_t_4, function);
10768     }
10769   }
10770   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
10771   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10772   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10773   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
10774   __Pyx_GOTREF(__pyx_t_1);
10775   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10776   __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 86, __pyx_L1_error)
10777   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10778   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_samples, 1, (PyObject *(*)(char *)) __pyx_memview_get_char, (int (*)(char *, PyObject *)) __pyx_memview_set_char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
10779   __Pyx_GOTREF(__pyx_t_1);
10780   __pyx_t_4 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_9, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
10781   __Pyx_GOTREF(__pyx_t_4);
10782   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
10783   __pyx_t_9.memview = NULL;
10784   __pyx_t_9.data = NULL;
10785   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10786   __pyx_r = __pyx_t_4;
10787   __pyx_t_4 = 0;
10788   goto __pyx_L0;
10789 
10790   /* "urh/cythonext/path_creator.pyx":85
10791  *
10792  *
10793  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):             # <<<<<<<<<<<<<<
10794  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
10795  *
10796  */
10797 
10798   /* function exit code */
10799   __pyx_L1_error:;
10800   __Pyx_XDECREF(__pyx_t_1);
10801   __Pyx_XDECREF(__pyx_t_2);
10802   __Pyx_XDECREF(__pyx_t_3);
10803   __Pyx_XDECREF(__pyx_t_4);
10804   __Pyx_XDECREF(__pyx_t_5);
10805   __Pyx_XDECREF(__pyx_t_6);
10806   __Pyx_XDECREF(__pyx_t_8);
10807   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
10808   __Pyx_AddTraceback("urh.cythonext.path_creator.create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
10809   __pyx_r = 0;
10810   __pyx_L0:;
10811   __Pyx_XGIVEREF(__pyx_r);
10812   __Pyx_RefNannyFinishContext();
10813   return __pyx_r;
10814 }
10815 
10816 /* Python wrapper */
10817 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_19__pyx_fuse_0create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10818 static PyMethodDef __pyx_fuse_0__pyx_mdef_3urh_9cythonext_12path_creator_19__pyx_fuse_0create_live_path = {"__pyx_fuse_0create_live_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_19__pyx_fuse_0create_live_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_19__pyx_fuse_0create_live_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10819 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_19__pyx_fuse_0create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10820   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
10821   unsigned int __pyx_v_start;
10822   unsigned int __pyx_v_end;
10823   int __pyx_lineno = 0;
10824   const char *__pyx_filename = NULL;
10825   int __pyx_clineno = 0;
10826   PyObject *__pyx_r = 0;
10827   __Pyx_RefNannyDeclarations
10828   __Pyx_RefNannySetupContext("__pyx_fuse_0create_live_path (wrapper)", 0);
10829   {
10830     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,0};
10831     PyObject* values[3] = {0,0,0};
10832     if (unlikely(__pyx_kwds)) {
10833       Py_ssize_t kw_args;
10834       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10835       switch (pos_args) {
10836         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10837         CYTHON_FALLTHROUGH;
10838         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10839         CYTHON_FALLTHROUGH;
10840         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10841         CYTHON_FALLTHROUGH;
10842         case  0: break;
10843         default: goto __pyx_L5_argtuple_error;
10844       }
10845       kw_args = PyDict_Size(__pyx_kwds);
10846       switch (pos_args) {
10847         case  0:
10848         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
10849         else goto __pyx_L5_argtuple_error;
10850         CYTHON_FALLTHROUGH;
10851         case  1:
10852         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
10853         else {
10854           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0create_live_path", 1, 3, 3, 1); __PYX_ERR(0, 85, __pyx_L3_error)
10855         }
10856         CYTHON_FALLTHROUGH;
10857         case  2:
10858         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
10859         else {
10860           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0create_live_path", 1, 3, 3, 2); __PYX_ERR(0, 85, __pyx_L3_error)
10861         }
10862       }
10863       if (unlikely(kw_args > 0)) {
10864         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0create_live_path") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
10865       }
10866     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10867       goto __pyx_L5_argtuple_error;
10868     } else {
10869       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10870       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10871       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10872     }
10873     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_char(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 85, __pyx_L3_error)
10874     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
10875     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
10876   }
10877   goto __pyx_L4_argument_unpacking_done;
10878   __pyx_L5_argtuple_error:;
10879   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0create_live_path", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
10880   __pyx_L3_error:;
10881   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_0create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
10882   __Pyx_RefNannyFinishContext();
10883   return NULL;
10884   __pyx_L4_argument_unpacking_done:;
10885   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_18__pyx_fuse_0create_live_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end);
10886 
10887   /* function exit code */
10888   __Pyx_RefNannyFinishContext();
10889   return __pyx_r;
10890 }
10891 
__pyx_pf_3urh_9cythonext_12path_creator_18__pyx_fuse_0create_live_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end)10892 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_18__pyx_fuse_0create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end) {
10893   PyObject *__pyx_r = NULL;
10894   __Pyx_RefNannyDeclarations
10895   PyObject *__pyx_t_1 = NULL;
10896   int __pyx_lineno = 0;
10897   const char *__pyx_filename = NULL;
10898   int __pyx_clineno = 0;
10899   __Pyx_RefNannySetupContext("__pyx_fuse_0create_live_path", 0);
10900   __Pyx_XDECREF(__pyx_r);
10901   __pyx_t_1 = __pyx_fuse_0__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
10902   __Pyx_GOTREF(__pyx_t_1);
10903   __pyx_r = __pyx_t_1;
10904   __pyx_t_1 = 0;
10905   goto __pyx_L0;
10906 
10907   /* function exit code */
10908   __pyx_L1_error:;
10909   __Pyx_XDECREF(__pyx_t_1);
10910   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_0create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
10911   __pyx_r = NULL;
10912   __pyx_L0:;
10913   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
10914   __Pyx_XGIVEREF(__pyx_r);
10915   __Pyx_RefNannyFinishContext();
10916   return __pyx_r;
10917 }
10918 
10919 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_21__pyx_fuse_1create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10920 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_1__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch)10921 static PyObject *__pyx_fuse_1__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch) {
10922   PyObject *__pyx_r = NULL;
10923   __Pyx_RefNannyDeclarations
10924   PyObject *__pyx_t_1 = NULL;
10925   PyObject *__pyx_t_2 = NULL;
10926   PyObject *__pyx_t_3 = NULL;
10927   PyObject *__pyx_t_4 = NULL;
10928   PyObject *__pyx_t_5 = NULL;
10929   PyObject *__pyx_t_6 = NULL;
10930   int __pyx_t_7;
10931   PyObject *__pyx_t_8 = NULL;
10932   __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
10933   int __pyx_lineno = 0;
10934   const char *__pyx_filename = NULL;
10935   int __pyx_clineno = 0;
10936   __Pyx_RefNannySetupContext("__pyx_fuse_1create_live_path", 0);
10937 
10938   /* "urh/cythonext/path_creator.pyx":86
10939  *
10940  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):
10941  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)             # <<<<<<<<<<<<<<
10942  *
10943  * cpdef array_to_QPath(np.int64_t[:] x, y):
10944  */
10945   __Pyx_XDECREF(__pyx_r);
10946   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
10947   __Pyx_GOTREF(__pyx_t_3);
10948   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
10949   __Pyx_GOTREF(__pyx_t_4);
10950   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10951   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
10952   __Pyx_GOTREF(__pyx_t_3);
10953   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
10954   __Pyx_GOTREF(__pyx_t_5);
10955   __pyx_t_6 = NULL;
10956   __pyx_t_7 = 0;
10957   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
10958     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
10959     if (likely(__pyx_t_6)) {
10960       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10961       __Pyx_INCREF(__pyx_t_6);
10962       __Pyx_INCREF(function);
10963       __Pyx_DECREF_SET(__pyx_t_4, function);
10964       __pyx_t_7 = 1;
10965     }
10966   }
10967   #if CYTHON_FAST_PYCALL
10968   if (PyFunction_Check(__pyx_t_4)) {
10969     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
10970     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
10971     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10972     __Pyx_GOTREF(__pyx_t_2);
10973     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10974     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10975   } else
10976   #endif
10977   #if CYTHON_FAST_PYCCALL
10978   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10979     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
10980     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
10981     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10982     __Pyx_GOTREF(__pyx_t_2);
10983     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10984     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10985   } else
10986   #endif
10987   {
10988     __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
10989     __Pyx_GOTREF(__pyx_t_8);
10990     if (__pyx_t_6) {
10991       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
10992     }
10993     __Pyx_GIVEREF(__pyx_t_3);
10994     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
10995     __Pyx_GIVEREF(__pyx_t_5);
10996     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
10997     __pyx_t_3 = 0;
10998     __pyx_t_5 = 0;
10999     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11000     __Pyx_GOTREF(__pyx_t_2);
11001     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11002   }
11003   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11004   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11005   __Pyx_GOTREF(__pyx_t_4);
11006   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11007   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11008   __Pyx_GOTREF(__pyx_t_2);
11009   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
11010   __Pyx_GOTREF(__pyx_t_8);
11011   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11012   __pyx_t_2 = NULL;
11013   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11014     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
11015     if (likely(__pyx_t_2)) {
11016       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11017       __Pyx_INCREF(__pyx_t_2);
11018       __Pyx_INCREF(function);
11019       __Pyx_DECREF_SET(__pyx_t_4, function);
11020     }
11021   }
11022   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
11023   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11024   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11025   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
11026   __Pyx_GOTREF(__pyx_t_1);
11027   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11028   __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 86, __pyx_L1_error)
11029   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11030   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_samples, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
11031   __Pyx_GOTREF(__pyx_t_1);
11032   __pyx_t_4 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_9, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11033   __Pyx_GOTREF(__pyx_t_4);
11034   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
11035   __pyx_t_9.memview = NULL;
11036   __pyx_t_9.data = NULL;
11037   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11038   __pyx_r = __pyx_t_4;
11039   __pyx_t_4 = 0;
11040   goto __pyx_L0;
11041 
11042   /* "urh/cythonext/path_creator.pyx":85
11043  *
11044  *
11045  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):             # <<<<<<<<<<<<<<
11046  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
11047  *
11048  */
11049 
11050   /* function exit code */
11051   __pyx_L1_error:;
11052   __Pyx_XDECREF(__pyx_t_1);
11053   __Pyx_XDECREF(__pyx_t_2);
11054   __Pyx_XDECREF(__pyx_t_3);
11055   __Pyx_XDECREF(__pyx_t_4);
11056   __Pyx_XDECREF(__pyx_t_5);
11057   __Pyx_XDECREF(__pyx_t_6);
11058   __Pyx_XDECREF(__pyx_t_8);
11059   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
11060   __Pyx_AddTraceback("urh.cythonext.path_creator.create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11061   __pyx_r = 0;
11062   __pyx_L0:;
11063   __Pyx_XGIVEREF(__pyx_r);
11064   __Pyx_RefNannyFinishContext();
11065   return __pyx_r;
11066 }
11067 
11068 /* Python wrapper */
11069 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_21__pyx_fuse_1create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11070 static PyMethodDef __pyx_fuse_1__pyx_mdef_3urh_9cythonext_12path_creator_21__pyx_fuse_1create_live_path = {"__pyx_fuse_1create_live_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_21__pyx_fuse_1create_live_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_21__pyx_fuse_1create_live_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11071 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_21__pyx_fuse_1create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11072   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
11073   unsigned int __pyx_v_start;
11074   unsigned int __pyx_v_end;
11075   int __pyx_lineno = 0;
11076   const char *__pyx_filename = NULL;
11077   int __pyx_clineno = 0;
11078   PyObject *__pyx_r = 0;
11079   __Pyx_RefNannyDeclarations
11080   __Pyx_RefNannySetupContext("__pyx_fuse_1create_live_path (wrapper)", 0);
11081   {
11082     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,0};
11083     PyObject* values[3] = {0,0,0};
11084     if (unlikely(__pyx_kwds)) {
11085       Py_ssize_t kw_args;
11086       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11087       switch (pos_args) {
11088         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11089         CYTHON_FALLTHROUGH;
11090         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11091         CYTHON_FALLTHROUGH;
11092         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11093         CYTHON_FALLTHROUGH;
11094         case  0: break;
11095         default: goto __pyx_L5_argtuple_error;
11096       }
11097       kw_args = PyDict_Size(__pyx_kwds);
11098       switch (pos_args) {
11099         case  0:
11100         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
11101         else goto __pyx_L5_argtuple_error;
11102         CYTHON_FALLTHROUGH;
11103         case  1:
11104         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
11105         else {
11106           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1create_live_path", 1, 3, 3, 1); __PYX_ERR(0, 85, __pyx_L3_error)
11107         }
11108         CYTHON_FALLTHROUGH;
11109         case  2:
11110         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
11111         else {
11112           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1create_live_path", 1, 3, 3, 2); __PYX_ERR(0, 85, __pyx_L3_error)
11113         }
11114       }
11115       if (unlikely(kw_args > 0)) {
11116         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1create_live_path") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
11117       }
11118     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
11119       goto __pyx_L5_argtuple_error;
11120     } else {
11121       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11122       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11123       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11124     }
11125     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 85, __pyx_L3_error)
11126     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
11127     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
11128   }
11129   goto __pyx_L4_argument_unpacking_done;
11130   __pyx_L5_argtuple_error:;
11131   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1create_live_path", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
11132   __pyx_L3_error:;
11133   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_1create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11134   __Pyx_RefNannyFinishContext();
11135   return NULL;
11136   __pyx_L4_argument_unpacking_done:;
11137   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_20__pyx_fuse_1create_live_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end);
11138 
11139   /* function exit code */
11140   __Pyx_RefNannyFinishContext();
11141   return __pyx_r;
11142 }
11143 
__pyx_pf_3urh_9cythonext_12path_creator_20__pyx_fuse_1create_live_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end)11144 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_20__pyx_fuse_1create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end) {
11145   PyObject *__pyx_r = NULL;
11146   __Pyx_RefNannyDeclarations
11147   PyObject *__pyx_t_1 = NULL;
11148   int __pyx_lineno = 0;
11149   const char *__pyx_filename = NULL;
11150   int __pyx_clineno = 0;
11151   __Pyx_RefNannySetupContext("__pyx_fuse_1create_live_path", 0);
11152   __Pyx_XDECREF(__pyx_r);
11153   __pyx_t_1 = __pyx_fuse_1__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
11154   __Pyx_GOTREF(__pyx_t_1);
11155   __pyx_r = __pyx_t_1;
11156   __pyx_t_1 = 0;
11157   goto __pyx_L0;
11158 
11159   /* function exit code */
11160   __pyx_L1_error:;
11161   __Pyx_XDECREF(__pyx_t_1);
11162   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_1create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11163   __pyx_r = NULL;
11164   __pyx_L0:;
11165   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
11166   __Pyx_XGIVEREF(__pyx_r);
11167   __Pyx_RefNannyFinishContext();
11168   return __pyx_r;
11169 }
11170 
11171 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_23__pyx_fuse_2create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11172 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_2__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch)11173 static PyObject *__pyx_fuse_2__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch) {
11174   PyObject *__pyx_r = NULL;
11175   __Pyx_RefNannyDeclarations
11176   PyObject *__pyx_t_1 = NULL;
11177   PyObject *__pyx_t_2 = NULL;
11178   PyObject *__pyx_t_3 = NULL;
11179   PyObject *__pyx_t_4 = NULL;
11180   PyObject *__pyx_t_5 = NULL;
11181   PyObject *__pyx_t_6 = NULL;
11182   int __pyx_t_7;
11183   PyObject *__pyx_t_8 = NULL;
11184   __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
11185   int __pyx_lineno = 0;
11186   const char *__pyx_filename = NULL;
11187   int __pyx_clineno = 0;
11188   __Pyx_RefNannySetupContext("__pyx_fuse_2create_live_path", 0);
11189 
11190   /* "urh/cythonext/path_creator.pyx":86
11191  *
11192  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):
11193  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)             # <<<<<<<<<<<<<<
11194  *
11195  * cpdef array_to_QPath(np.int64_t[:] x, y):
11196  */
11197   __Pyx_XDECREF(__pyx_r);
11198   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
11199   __Pyx_GOTREF(__pyx_t_3);
11200   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11201   __Pyx_GOTREF(__pyx_t_4);
11202   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11203   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
11204   __Pyx_GOTREF(__pyx_t_3);
11205   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
11206   __Pyx_GOTREF(__pyx_t_5);
11207   __pyx_t_6 = NULL;
11208   __pyx_t_7 = 0;
11209   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11210     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
11211     if (likely(__pyx_t_6)) {
11212       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11213       __Pyx_INCREF(__pyx_t_6);
11214       __Pyx_INCREF(function);
11215       __Pyx_DECREF_SET(__pyx_t_4, function);
11216       __pyx_t_7 = 1;
11217     }
11218   }
11219   #if CYTHON_FAST_PYCALL
11220   if (PyFunction_Check(__pyx_t_4)) {
11221     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
11222     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11223     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11224     __Pyx_GOTREF(__pyx_t_2);
11225     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11226     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11227   } else
11228   #endif
11229   #if CYTHON_FAST_PYCCALL
11230   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11231     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
11232     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11233     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11234     __Pyx_GOTREF(__pyx_t_2);
11235     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11236     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11237   } else
11238   #endif
11239   {
11240     __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
11241     __Pyx_GOTREF(__pyx_t_8);
11242     if (__pyx_t_6) {
11243       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
11244     }
11245     __Pyx_GIVEREF(__pyx_t_3);
11246     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
11247     __Pyx_GIVEREF(__pyx_t_5);
11248     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
11249     __pyx_t_3 = 0;
11250     __pyx_t_5 = 0;
11251     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11252     __Pyx_GOTREF(__pyx_t_2);
11253     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11254   }
11255   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11256   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11257   __Pyx_GOTREF(__pyx_t_4);
11258   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11259   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11260   __Pyx_GOTREF(__pyx_t_2);
11261   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
11262   __Pyx_GOTREF(__pyx_t_8);
11263   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11264   __pyx_t_2 = NULL;
11265   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11266     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
11267     if (likely(__pyx_t_2)) {
11268       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11269       __Pyx_INCREF(__pyx_t_2);
11270       __Pyx_INCREF(function);
11271       __Pyx_DECREF_SET(__pyx_t_4, function);
11272     }
11273   }
11274   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
11275   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11276   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11277   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
11278   __Pyx_GOTREF(__pyx_t_1);
11279   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11280   __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 86, __pyx_L1_error)
11281   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11282   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_samples, 1, (PyObject *(*)(char *)) __pyx_memview_get_short, (int (*)(char *, PyObject *)) __pyx_memview_set_short, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
11283   __Pyx_GOTREF(__pyx_t_1);
11284   __pyx_t_4 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_9, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11285   __Pyx_GOTREF(__pyx_t_4);
11286   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
11287   __pyx_t_9.memview = NULL;
11288   __pyx_t_9.data = NULL;
11289   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11290   __pyx_r = __pyx_t_4;
11291   __pyx_t_4 = 0;
11292   goto __pyx_L0;
11293 
11294   /* "urh/cythonext/path_creator.pyx":85
11295  *
11296  *
11297  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):             # <<<<<<<<<<<<<<
11298  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
11299  *
11300  */
11301 
11302   /* function exit code */
11303   __pyx_L1_error:;
11304   __Pyx_XDECREF(__pyx_t_1);
11305   __Pyx_XDECREF(__pyx_t_2);
11306   __Pyx_XDECREF(__pyx_t_3);
11307   __Pyx_XDECREF(__pyx_t_4);
11308   __Pyx_XDECREF(__pyx_t_5);
11309   __Pyx_XDECREF(__pyx_t_6);
11310   __Pyx_XDECREF(__pyx_t_8);
11311   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
11312   __Pyx_AddTraceback("urh.cythonext.path_creator.create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11313   __pyx_r = 0;
11314   __pyx_L0:;
11315   __Pyx_XGIVEREF(__pyx_r);
11316   __Pyx_RefNannyFinishContext();
11317   return __pyx_r;
11318 }
11319 
11320 /* Python wrapper */
11321 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_23__pyx_fuse_2create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11322 static PyMethodDef __pyx_fuse_2__pyx_mdef_3urh_9cythonext_12path_creator_23__pyx_fuse_2create_live_path = {"__pyx_fuse_2create_live_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_23__pyx_fuse_2create_live_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_23__pyx_fuse_2create_live_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11323 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_23__pyx_fuse_2create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11324   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
11325   unsigned int __pyx_v_start;
11326   unsigned int __pyx_v_end;
11327   int __pyx_lineno = 0;
11328   const char *__pyx_filename = NULL;
11329   int __pyx_clineno = 0;
11330   PyObject *__pyx_r = 0;
11331   __Pyx_RefNannyDeclarations
11332   __Pyx_RefNannySetupContext("__pyx_fuse_2create_live_path (wrapper)", 0);
11333   {
11334     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,0};
11335     PyObject* values[3] = {0,0,0};
11336     if (unlikely(__pyx_kwds)) {
11337       Py_ssize_t kw_args;
11338       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11339       switch (pos_args) {
11340         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11341         CYTHON_FALLTHROUGH;
11342         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11343         CYTHON_FALLTHROUGH;
11344         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11345         CYTHON_FALLTHROUGH;
11346         case  0: break;
11347         default: goto __pyx_L5_argtuple_error;
11348       }
11349       kw_args = PyDict_Size(__pyx_kwds);
11350       switch (pos_args) {
11351         case  0:
11352         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
11353         else goto __pyx_L5_argtuple_error;
11354         CYTHON_FALLTHROUGH;
11355         case  1:
11356         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
11357         else {
11358           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2create_live_path", 1, 3, 3, 1); __PYX_ERR(0, 85, __pyx_L3_error)
11359         }
11360         CYTHON_FALLTHROUGH;
11361         case  2:
11362         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
11363         else {
11364           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2create_live_path", 1, 3, 3, 2); __PYX_ERR(0, 85, __pyx_L3_error)
11365         }
11366       }
11367       if (unlikely(kw_args > 0)) {
11368         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2create_live_path") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
11369       }
11370     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
11371       goto __pyx_L5_argtuple_error;
11372     } else {
11373       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11374       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11375       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11376     }
11377     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 85, __pyx_L3_error)
11378     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
11379     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
11380   }
11381   goto __pyx_L4_argument_unpacking_done;
11382   __pyx_L5_argtuple_error:;
11383   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2create_live_path", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
11384   __pyx_L3_error:;
11385   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_2create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11386   __Pyx_RefNannyFinishContext();
11387   return NULL;
11388   __pyx_L4_argument_unpacking_done:;
11389   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_22__pyx_fuse_2create_live_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end);
11390 
11391   /* function exit code */
11392   __Pyx_RefNannyFinishContext();
11393   return __pyx_r;
11394 }
11395 
__pyx_pf_3urh_9cythonext_12path_creator_22__pyx_fuse_2create_live_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end)11396 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_22__pyx_fuse_2create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end) {
11397   PyObject *__pyx_r = NULL;
11398   __Pyx_RefNannyDeclarations
11399   PyObject *__pyx_t_1 = NULL;
11400   int __pyx_lineno = 0;
11401   const char *__pyx_filename = NULL;
11402   int __pyx_clineno = 0;
11403   __Pyx_RefNannySetupContext("__pyx_fuse_2create_live_path", 0);
11404   __Pyx_XDECREF(__pyx_r);
11405   __pyx_t_1 = __pyx_fuse_2__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
11406   __Pyx_GOTREF(__pyx_t_1);
11407   __pyx_r = __pyx_t_1;
11408   __pyx_t_1 = 0;
11409   goto __pyx_L0;
11410 
11411   /* function exit code */
11412   __pyx_L1_error:;
11413   __Pyx_XDECREF(__pyx_t_1);
11414   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_2create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11415   __pyx_r = NULL;
11416   __pyx_L0:;
11417   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
11418   __Pyx_XGIVEREF(__pyx_r);
11419   __Pyx_RefNannyFinishContext();
11420   return __pyx_r;
11421 }
11422 
11423 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_25__pyx_fuse_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11424 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_3__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch)11425 static PyObject *__pyx_fuse_3__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch) {
11426   PyObject *__pyx_r = NULL;
11427   __Pyx_RefNannyDeclarations
11428   PyObject *__pyx_t_1 = NULL;
11429   PyObject *__pyx_t_2 = NULL;
11430   PyObject *__pyx_t_3 = NULL;
11431   PyObject *__pyx_t_4 = NULL;
11432   PyObject *__pyx_t_5 = NULL;
11433   PyObject *__pyx_t_6 = NULL;
11434   int __pyx_t_7;
11435   PyObject *__pyx_t_8 = NULL;
11436   __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
11437   int __pyx_lineno = 0;
11438   const char *__pyx_filename = NULL;
11439   int __pyx_clineno = 0;
11440   __Pyx_RefNannySetupContext("__pyx_fuse_3create_live_path", 0);
11441 
11442   /* "urh/cythonext/path_creator.pyx":86
11443  *
11444  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):
11445  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)             # <<<<<<<<<<<<<<
11446  *
11447  * cpdef array_to_QPath(np.int64_t[:] x, y):
11448  */
11449   __Pyx_XDECREF(__pyx_r);
11450   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
11451   __Pyx_GOTREF(__pyx_t_3);
11452   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11453   __Pyx_GOTREF(__pyx_t_4);
11454   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11455   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
11456   __Pyx_GOTREF(__pyx_t_3);
11457   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
11458   __Pyx_GOTREF(__pyx_t_5);
11459   __pyx_t_6 = NULL;
11460   __pyx_t_7 = 0;
11461   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11462     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
11463     if (likely(__pyx_t_6)) {
11464       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11465       __Pyx_INCREF(__pyx_t_6);
11466       __Pyx_INCREF(function);
11467       __Pyx_DECREF_SET(__pyx_t_4, function);
11468       __pyx_t_7 = 1;
11469     }
11470   }
11471   #if CYTHON_FAST_PYCALL
11472   if (PyFunction_Check(__pyx_t_4)) {
11473     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
11474     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11475     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11476     __Pyx_GOTREF(__pyx_t_2);
11477     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11478     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11479   } else
11480   #endif
11481   #if CYTHON_FAST_PYCCALL
11482   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11483     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
11484     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11485     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11486     __Pyx_GOTREF(__pyx_t_2);
11487     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11488     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11489   } else
11490   #endif
11491   {
11492     __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
11493     __Pyx_GOTREF(__pyx_t_8);
11494     if (__pyx_t_6) {
11495       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
11496     }
11497     __Pyx_GIVEREF(__pyx_t_3);
11498     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
11499     __Pyx_GIVEREF(__pyx_t_5);
11500     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
11501     __pyx_t_3 = 0;
11502     __pyx_t_5 = 0;
11503     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11504     __Pyx_GOTREF(__pyx_t_2);
11505     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11506   }
11507   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11508   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11509   __Pyx_GOTREF(__pyx_t_4);
11510   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11511   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11512   __Pyx_GOTREF(__pyx_t_2);
11513   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
11514   __Pyx_GOTREF(__pyx_t_8);
11515   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11516   __pyx_t_2 = NULL;
11517   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11518     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
11519     if (likely(__pyx_t_2)) {
11520       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11521       __Pyx_INCREF(__pyx_t_2);
11522       __Pyx_INCREF(function);
11523       __Pyx_DECREF_SET(__pyx_t_4, function);
11524     }
11525   }
11526   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
11527   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11528   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11529   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
11530   __Pyx_GOTREF(__pyx_t_1);
11531   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11532   __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 86, __pyx_L1_error)
11533   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11534   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_samples, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_short, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_short, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
11535   __Pyx_GOTREF(__pyx_t_1);
11536   __pyx_t_4 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_9, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11537   __Pyx_GOTREF(__pyx_t_4);
11538   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
11539   __pyx_t_9.memview = NULL;
11540   __pyx_t_9.data = NULL;
11541   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11542   __pyx_r = __pyx_t_4;
11543   __pyx_t_4 = 0;
11544   goto __pyx_L0;
11545 
11546   /* "urh/cythonext/path_creator.pyx":85
11547  *
11548  *
11549  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):             # <<<<<<<<<<<<<<
11550  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
11551  *
11552  */
11553 
11554   /* function exit code */
11555   __pyx_L1_error:;
11556   __Pyx_XDECREF(__pyx_t_1);
11557   __Pyx_XDECREF(__pyx_t_2);
11558   __Pyx_XDECREF(__pyx_t_3);
11559   __Pyx_XDECREF(__pyx_t_4);
11560   __Pyx_XDECREF(__pyx_t_5);
11561   __Pyx_XDECREF(__pyx_t_6);
11562   __Pyx_XDECREF(__pyx_t_8);
11563   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
11564   __Pyx_AddTraceback("urh.cythonext.path_creator.create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11565   __pyx_r = 0;
11566   __pyx_L0:;
11567   __Pyx_XGIVEREF(__pyx_r);
11568   __Pyx_RefNannyFinishContext();
11569   return __pyx_r;
11570 }
11571 
11572 /* Python wrapper */
11573 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_25__pyx_fuse_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11574 static PyMethodDef __pyx_fuse_3__pyx_mdef_3urh_9cythonext_12path_creator_25__pyx_fuse_3create_live_path = {"__pyx_fuse_3create_live_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_25__pyx_fuse_3create_live_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_25__pyx_fuse_3create_live_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11575 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_25__pyx_fuse_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11576   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
11577   unsigned int __pyx_v_start;
11578   unsigned int __pyx_v_end;
11579   int __pyx_lineno = 0;
11580   const char *__pyx_filename = NULL;
11581   int __pyx_clineno = 0;
11582   PyObject *__pyx_r = 0;
11583   __Pyx_RefNannyDeclarations
11584   __Pyx_RefNannySetupContext("__pyx_fuse_3create_live_path (wrapper)", 0);
11585   {
11586     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,0};
11587     PyObject* values[3] = {0,0,0};
11588     if (unlikely(__pyx_kwds)) {
11589       Py_ssize_t kw_args;
11590       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11591       switch (pos_args) {
11592         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11593         CYTHON_FALLTHROUGH;
11594         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11595         CYTHON_FALLTHROUGH;
11596         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11597         CYTHON_FALLTHROUGH;
11598         case  0: break;
11599         default: goto __pyx_L5_argtuple_error;
11600       }
11601       kw_args = PyDict_Size(__pyx_kwds);
11602       switch (pos_args) {
11603         case  0:
11604         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
11605         else goto __pyx_L5_argtuple_error;
11606         CYTHON_FALLTHROUGH;
11607         case  1:
11608         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
11609         else {
11610           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3create_live_path", 1, 3, 3, 1); __PYX_ERR(0, 85, __pyx_L3_error)
11611         }
11612         CYTHON_FALLTHROUGH;
11613         case  2:
11614         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
11615         else {
11616           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3create_live_path", 1, 3, 3, 2); __PYX_ERR(0, 85, __pyx_L3_error)
11617         }
11618       }
11619       if (unlikely(kw_args > 0)) {
11620         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3create_live_path") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
11621       }
11622     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
11623       goto __pyx_L5_argtuple_error;
11624     } else {
11625       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11626       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11627       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11628     }
11629     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 85, __pyx_L3_error)
11630     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
11631     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
11632   }
11633   goto __pyx_L4_argument_unpacking_done;
11634   __pyx_L5_argtuple_error:;
11635   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3create_live_path", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
11636   __pyx_L3_error:;
11637   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_3create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11638   __Pyx_RefNannyFinishContext();
11639   return NULL;
11640   __pyx_L4_argument_unpacking_done:;
11641   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_24__pyx_fuse_3create_live_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end);
11642 
11643   /* function exit code */
11644   __Pyx_RefNannyFinishContext();
11645   return __pyx_r;
11646 }
11647 
__pyx_pf_3urh_9cythonext_12path_creator_24__pyx_fuse_3create_live_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end)11648 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_24__pyx_fuse_3create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end) {
11649   PyObject *__pyx_r = NULL;
11650   __Pyx_RefNannyDeclarations
11651   PyObject *__pyx_t_1 = NULL;
11652   int __pyx_lineno = 0;
11653   const char *__pyx_filename = NULL;
11654   int __pyx_clineno = 0;
11655   __Pyx_RefNannySetupContext("__pyx_fuse_3create_live_path", 0);
11656   __Pyx_XDECREF(__pyx_r);
11657   __pyx_t_1 = __pyx_fuse_3__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
11658   __Pyx_GOTREF(__pyx_t_1);
11659   __pyx_r = __pyx_t_1;
11660   __pyx_t_1 = 0;
11661   goto __pyx_L0;
11662 
11663   /* function exit code */
11664   __pyx_L1_error:;
11665   __Pyx_XDECREF(__pyx_t_1);
11666   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_3create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11667   __pyx_r = NULL;
11668   __pyx_L0:;
11669   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
11670   __Pyx_XGIVEREF(__pyx_r);
11671   __Pyx_RefNannyFinishContext();
11672   return __pyx_r;
11673 }
11674 
11675 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_27__pyx_fuse_4create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11676 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_3create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_fuse_4__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end,CYTHON_UNUSED int __pyx_skip_dispatch)11677 static PyObject *__pyx_fuse_4__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch) {
11678   PyObject *__pyx_r = NULL;
11679   __Pyx_RefNannyDeclarations
11680   PyObject *__pyx_t_1 = NULL;
11681   PyObject *__pyx_t_2 = NULL;
11682   PyObject *__pyx_t_3 = NULL;
11683   PyObject *__pyx_t_4 = NULL;
11684   PyObject *__pyx_t_5 = NULL;
11685   PyObject *__pyx_t_6 = NULL;
11686   int __pyx_t_7;
11687   PyObject *__pyx_t_8 = NULL;
11688   __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
11689   int __pyx_lineno = 0;
11690   const char *__pyx_filename = NULL;
11691   int __pyx_clineno = 0;
11692   __Pyx_RefNannySetupContext("__pyx_fuse_4create_live_path", 0);
11693 
11694   /* "urh/cythonext/path_creator.pyx":86
11695  *
11696  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):
11697  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)             # <<<<<<<<<<<<<<
11698  *
11699  * cpdef array_to_QPath(np.int64_t[:] x, y):
11700  */
11701   __Pyx_XDECREF(__pyx_r);
11702   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
11703   __Pyx_GOTREF(__pyx_t_3);
11704   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11705   __Pyx_GOTREF(__pyx_t_4);
11706   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11707   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
11708   __Pyx_GOTREF(__pyx_t_3);
11709   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
11710   __Pyx_GOTREF(__pyx_t_5);
11711   __pyx_t_6 = NULL;
11712   __pyx_t_7 = 0;
11713   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11714     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
11715     if (likely(__pyx_t_6)) {
11716       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11717       __Pyx_INCREF(__pyx_t_6);
11718       __Pyx_INCREF(function);
11719       __Pyx_DECREF_SET(__pyx_t_4, function);
11720       __pyx_t_7 = 1;
11721     }
11722   }
11723   #if CYTHON_FAST_PYCALL
11724   if (PyFunction_Check(__pyx_t_4)) {
11725     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
11726     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11727     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11728     __Pyx_GOTREF(__pyx_t_2);
11729     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11730     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11731   } else
11732   #endif
11733   #if CYTHON_FAST_PYCCALL
11734   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11735     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
11736     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11737     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11738     __Pyx_GOTREF(__pyx_t_2);
11739     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11740     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11741   } else
11742   #endif
11743   {
11744     __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
11745     __Pyx_GOTREF(__pyx_t_8);
11746     if (__pyx_t_6) {
11747       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
11748     }
11749     __Pyx_GIVEREF(__pyx_t_3);
11750     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
11751     __Pyx_GIVEREF(__pyx_t_5);
11752     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
11753     __pyx_t_3 = 0;
11754     __pyx_t_5 = 0;
11755     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11756     __Pyx_GOTREF(__pyx_t_2);
11757     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11758   }
11759   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11760   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11761   __Pyx_GOTREF(__pyx_t_4);
11762   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11763   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
11764   __Pyx_GOTREF(__pyx_t_2);
11765   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
11766   __Pyx_GOTREF(__pyx_t_8);
11767   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11768   __pyx_t_2 = NULL;
11769   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11770     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
11771     if (likely(__pyx_t_2)) {
11772       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11773       __Pyx_INCREF(__pyx_t_2);
11774       __Pyx_INCREF(function);
11775       __Pyx_DECREF_SET(__pyx_t_4, function);
11776     }
11777   }
11778   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
11779   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11780   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11781   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
11782   __Pyx_GOTREF(__pyx_t_1);
11783   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11784   __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 86, __pyx_L1_error)
11785   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11786   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_samples, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
11787   __Pyx_GOTREF(__pyx_t_1);
11788   __pyx_t_4 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_t_9, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11789   __Pyx_GOTREF(__pyx_t_4);
11790   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
11791   __pyx_t_9.memview = NULL;
11792   __pyx_t_9.data = NULL;
11793   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11794   __pyx_r = __pyx_t_4;
11795   __pyx_t_4 = 0;
11796   goto __pyx_L0;
11797 
11798   /* "urh/cythonext/path_creator.pyx":85
11799  *
11800  *
11801  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):             # <<<<<<<<<<<<<<
11802  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
11803  *
11804  */
11805 
11806   /* function exit code */
11807   __pyx_L1_error:;
11808   __Pyx_XDECREF(__pyx_t_1);
11809   __Pyx_XDECREF(__pyx_t_2);
11810   __Pyx_XDECREF(__pyx_t_3);
11811   __Pyx_XDECREF(__pyx_t_4);
11812   __Pyx_XDECREF(__pyx_t_5);
11813   __Pyx_XDECREF(__pyx_t_6);
11814   __Pyx_XDECREF(__pyx_t_8);
11815   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
11816   __Pyx_AddTraceback("urh.cythonext.path_creator.create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11817   __pyx_r = 0;
11818   __pyx_L0:;
11819   __Pyx_XGIVEREF(__pyx_r);
11820   __Pyx_RefNannyFinishContext();
11821   return __pyx_r;
11822 }
11823 
11824 /* Python wrapper */
11825 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_27__pyx_fuse_4create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11826 static PyMethodDef __pyx_fuse_4__pyx_mdef_3urh_9cythonext_12path_creator_27__pyx_fuse_4create_live_path = {"__pyx_fuse_4create_live_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_27__pyx_fuse_4create_live_path, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3urh_9cythonext_12path_creator_27__pyx_fuse_4create_live_path(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11827 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_27__pyx_fuse_4create_live_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11828   __Pyx_memviewslice __pyx_v_samples = { 0, 0, { 0 }, { 0 }, { 0 } };
11829   unsigned int __pyx_v_start;
11830   unsigned int __pyx_v_end;
11831   int __pyx_lineno = 0;
11832   const char *__pyx_filename = NULL;
11833   int __pyx_clineno = 0;
11834   PyObject *__pyx_r = 0;
11835   __Pyx_RefNannyDeclarations
11836   __Pyx_RefNannySetupContext("__pyx_fuse_4create_live_path (wrapper)", 0);
11837   {
11838     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_start,&__pyx_n_s_end,0};
11839     PyObject* values[3] = {0,0,0};
11840     if (unlikely(__pyx_kwds)) {
11841       Py_ssize_t kw_args;
11842       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11843       switch (pos_args) {
11844         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11845         CYTHON_FALLTHROUGH;
11846         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11847         CYTHON_FALLTHROUGH;
11848         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11849         CYTHON_FALLTHROUGH;
11850         case  0: break;
11851         default: goto __pyx_L5_argtuple_error;
11852       }
11853       kw_args = PyDict_Size(__pyx_kwds);
11854       switch (pos_args) {
11855         case  0:
11856         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
11857         else goto __pyx_L5_argtuple_error;
11858         CYTHON_FALLTHROUGH;
11859         case  1:
11860         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
11861         else {
11862           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4create_live_path", 1, 3, 3, 1); __PYX_ERR(0, 85, __pyx_L3_error)
11863         }
11864         CYTHON_FALLTHROUGH;
11865         case  2:
11866         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
11867         else {
11868           __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4create_live_path", 1, 3, 3, 2); __PYX_ERR(0, 85, __pyx_L3_error)
11869         }
11870       }
11871       if (unlikely(kw_args > 0)) {
11872         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_4create_live_path") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
11873       }
11874     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
11875       goto __pyx_L5_argtuple_error;
11876     } else {
11877       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11878       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11879       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11880     }
11881     __pyx_v_samples = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_samples.memview)) __PYX_ERR(0, 85, __pyx_L3_error)
11882     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
11883     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
11884   }
11885   goto __pyx_L4_argument_unpacking_done;
11886   __pyx_L5_argtuple_error:;
11887   __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4create_live_path", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
11888   __pyx_L3_error:;
11889   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_4create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11890   __Pyx_RefNannyFinishContext();
11891   return NULL;
11892   __pyx_L4_argument_unpacking_done:;
11893   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_26__pyx_fuse_4create_live_path(__pyx_self, __pyx_v_samples, __pyx_v_start, __pyx_v_end);
11894 
11895   /* function exit code */
11896   __Pyx_RefNannyFinishContext();
11897   return __pyx_r;
11898 }
11899 
__pyx_pf_3urh_9cythonext_12path_creator_26__pyx_fuse_4create_live_path(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_samples,unsigned int __pyx_v_start,unsigned int __pyx_v_end)11900 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_26__pyx_fuse_4create_live_path(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_samples, unsigned int __pyx_v_start, unsigned int __pyx_v_end) {
11901   PyObject *__pyx_r = NULL;
11902   __Pyx_RefNannyDeclarations
11903   PyObject *__pyx_t_1 = NULL;
11904   int __pyx_lineno = 0;
11905   const char *__pyx_filename = NULL;
11906   int __pyx_clineno = 0;
11907   __Pyx_RefNannySetupContext("__pyx_fuse_4create_live_path", 0);
11908   __Pyx_XDECREF(__pyx_r);
11909   __pyx_t_1 = __pyx_fuse_4__pyx_f_3urh_9cythonext_12path_creator_create_live_path(__pyx_v_samples, __pyx_v_start, __pyx_v_end, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
11910   __Pyx_GOTREF(__pyx_t_1);
11911   __pyx_r = __pyx_t_1;
11912   __pyx_t_1 = 0;
11913   goto __pyx_L0;
11914 
11915   /* function exit code */
11916   __pyx_L1_error:;
11917   __Pyx_XDECREF(__pyx_t_1);
11918   __Pyx_AddTraceback("urh.cythonext.path_creator.__pyx_fuse_4create_live_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
11919   __pyx_r = NULL;
11920   __pyx_L0:;
11921   __PYX_XDEC_MEMVIEW(&__pyx_v_samples, 1);
11922   __Pyx_XGIVEREF(__pyx_r);
11923   __Pyx_RefNannyFinishContext();
11924   return __pyx_r;
11925 }
11926 
11927 /* "urh/cythonext/path_creator.pyx":88
11928  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
11929  *
11930  * cpdef array_to_QPath(np.int64_t[:] x, y):             # <<<<<<<<<<<<<<
11931  *     """
11932  *     Convert an array of x,y coordinates to QPainterPath as efficiently as possible.
11933  */
11934 
11935 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_5array_to_QPath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__Pyx_memviewslice __pyx_v_x,PyObject * __pyx_v_y,CYTHON_UNUSED int __pyx_skip_dispatch)11936 static PyObject *__pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_y, CYTHON_UNUSED int __pyx_skip_dispatch) {
11937   PY_LONG_LONG __pyx_v_n;
11938   PyObject *__pyx_v_arr = NULL;
11939   PyObject *__pyx_v_byte_view = NULL;
11940   PY_LONG_LONG __pyx_v_last_index;
11941   PyObject *__pyx_v_buf = NULL;
11942   PyObject *__pyx_v_path = NULL;
11943   PyObject *__pyx_v_ds = NULL;
11944   PyObject *__pyx_r = NULL;
11945   __Pyx_RefNannyDeclarations
11946   PyObject *__pyx_t_1 = NULL;
11947   PyObject *__pyx_t_2 = NULL;
11948   PyObject *__pyx_t_3 = NULL;
11949   PyObject *__pyx_t_4 = NULL;
11950   int __pyx_t_5;
11951   PyObject *__pyx_t_6 = NULL;
11952   PyObject *__pyx_t_7 = NULL;
11953   PyObject *__pyx_t_8 = NULL;
11954   PyObject *__pyx_t_9 = NULL;
11955   PyObject *__pyx_t_10 = NULL;
11956   PyObject *__pyx_t_11 = NULL;
11957   int __pyx_lineno = 0;
11958   const char *__pyx_filename = NULL;
11959   int __pyx_clineno = 0;
11960   __Pyx_RefNannySetupContext("array_to_QPath", 0);
11961 
11962   /* "urh/cythonext/path_creator.pyx":102
11963  *      All values are big endian--pack using struct.pack('>d') or struct.pack('>i')
11964  *     """
11965  *     cdef long long n = x.shape[0]             # <<<<<<<<<<<<<<
11966  *     arr = np.zeros(n + 2, dtype=[('x', '>f8'), ('y', '>f8'), ('c', '>i4')])
11967  *
11968  */
11969   __pyx_v_n = (__pyx_v_x.shape[0]);
11970 
11971   /* "urh/cythonext/path_creator.pyx":103
11972  *     """
11973  *     cdef long long n = x.shape[0]
11974  *     arr = np.zeros(n + 2, dtype=[('x', '>f8'), ('y', '>f8'), ('c', '>i4')])             # <<<<<<<<<<<<<<
11975  *
11976  *     byte_view = arr.view(dtype=np.uint8)
11977  */
11978   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
11979   __Pyx_GOTREF(__pyx_t_1);
11980   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
11981   __Pyx_GOTREF(__pyx_t_2);
11982   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11983   __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG((__pyx_v_n + 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
11984   __Pyx_GOTREF(__pyx_t_1);
11985   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
11986   __Pyx_GOTREF(__pyx_t_3);
11987   __Pyx_GIVEREF(__pyx_t_1);
11988   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
11989   __pyx_t_1 = 0;
11990   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
11991   __Pyx_GOTREF(__pyx_t_1);
11992   __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
11993   __Pyx_GOTREF(__pyx_t_4);
11994   __Pyx_INCREF(__pyx_tuple__11);
11995   __Pyx_GIVEREF(__pyx_tuple__11);
11996   PyList_SET_ITEM(__pyx_t_4, 0, __pyx_tuple__11);
11997   __Pyx_INCREF(__pyx_tuple__12);
11998   __Pyx_GIVEREF(__pyx_tuple__12);
11999   PyList_SET_ITEM(__pyx_t_4, 1, __pyx_tuple__12);
12000   __Pyx_INCREF(__pyx_tuple__13);
12001   __Pyx_GIVEREF(__pyx_tuple__13);
12002   PyList_SET_ITEM(__pyx_t_4, 2, __pyx_tuple__13);
12003   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
12004   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12005   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
12006   __Pyx_GOTREF(__pyx_t_4);
12007   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12008   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12009   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12010   __pyx_v_arr = __pyx_t_4;
12011   __pyx_t_4 = 0;
12012 
12013   /* "urh/cythonext/path_creator.pyx":105
12014  *     arr = np.zeros(n + 2, dtype=[('x', '>f8'), ('y', '>f8'), ('c', '>i4')])
12015  *
12016  *     byte_view = arr.view(dtype=np.uint8)             # <<<<<<<<<<<<<<
12017  *     byte_view[:12] = 0
12018  *     byte_view.data[12:20] = struct.pack('>ii', n, 0)
12019  */
12020   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
12021   __Pyx_GOTREF(__pyx_t_4);
12022   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
12023   __Pyx_GOTREF(__pyx_t_1);
12024   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
12025   __Pyx_GOTREF(__pyx_t_3);
12026   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
12027   __Pyx_GOTREF(__pyx_t_2);
12028   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12029   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
12030   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12031   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
12032   __Pyx_GOTREF(__pyx_t_2);
12033   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12034   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12035   __pyx_v_byte_view = __pyx_t_2;
12036   __pyx_t_2 = 0;
12037 
12038   /* "urh/cythonext/path_creator.pyx":106
12039  *
12040  *     byte_view = arr.view(dtype=np.uint8)
12041  *     byte_view[:12] = 0             # <<<<<<<<<<<<<<
12042  *     byte_view.data[12:20] = struct.pack('>ii', n, 0)
12043  *
12044  */
12045   if (__Pyx_PyObject_SetSlice(__pyx_v_byte_view, __pyx_int_0, 0, 12, NULL, NULL, &__pyx_slice__14, 0, 1, 0) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
12046 
12047   /* "urh/cythonext/path_creator.pyx":107
12048  *     byte_view = arr.view(dtype=np.uint8)
12049  *     byte_view[:12] = 0
12050  *     byte_view.data[12:20] = struct.pack('>ii', n, 0)             # <<<<<<<<<<<<<<
12051  *
12052  *     arr[1:n+1]['x'] = x
12053  */
12054   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_struct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
12055   __Pyx_GOTREF(__pyx_t_1);
12056   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
12057   __Pyx_GOTREF(__pyx_t_4);
12058   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12059   __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
12060   __Pyx_GOTREF(__pyx_t_1);
12061   __pyx_t_3 = NULL;
12062   __pyx_t_5 = 0;
12063   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12064     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
12065     if (likely(__pyx_t_3)) {
12066       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12067       __Pyx_INCREF(__pyx_t_3);
12068       __Pyx_INCREF(function);
12069       __Pyx_DECREF_SET(__pyx_t_4, function);
12070       __pyx_t_5 = 1;
12071     }
12072   }
12073   #if CYTHON_FAST_PYCALL
12074   if (PyFunction_Check(__pyx_t_4)) {
12075     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_kp_u_ii, __pyx_t_1, __pyx_int_0};
12076     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
12077     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12078     __Pyx_GOTREF(__pyx_t_2);
12079     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12080   } else
12081   #endif
12082   #if CYTHON_FAST_PYCCALL
12083   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
12084     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_kp_u_ii, __pyx_t_1, __pyx_int_0};
12085     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
12086     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12087     __Pyx_GOTREF(__pyx_t_2);
12088     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12089   } else
12090   #endif
12091   {
12092     __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
12093     __Pyx_GOTREF(__pyx_t_6);
12094     if (__pyx_t_3) {
12095       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
12096     }
12097     __Pyx_INCREF(__pyx_kp_u_ii);
12098     __Pyx_GIVEREF(__pyx_kp_u_ii);
12099     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_u_ii);
12100     __Pyx_GIVEREF(__pyx_t_1);
12101     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_1);
12102     __Pyx_INCREF(__pyx_int_0);
12103     __Pyx_GIVEREF(__pyx_int_0);
12104     PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_int_0);
12105     __pyx_t_1 = 0;
12106     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
12107     __Pyx_GOTREF(__pyx_t_2);
12108     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12109   }
12110   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12111   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_byte_view, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
12112   __Pyx_GOTREF(__pyx_t_4);
12113   if (__Pyx_PyObject_SetSlice(__pyx_t_4, __pyx_t_2, 12, 20, NULL, NULL, &__pyx_slice__15, 1, 1, 0) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
12114   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12115   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12116 
12117   /* "urh/cythonext/path_creator.pyx":109
12118  *     byte_view.data[12:20] = struct.pack('>ii', n, 0)
12119  *
12120  *     arr[1:n+1]['x'] = x             # <<<<<<<<<<<<<<
12121  *     arr[1:n+1]['y'] = np.negative(y)  # negate y since coordinate system is inverted
12122  *     arr[1:n+1]['c'] = 1
12123  */
12124   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
12125   __Pyx_GOTREF(__pyx_t_2);
12126   __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_arr, 1, (__pyx_v_n + 1), NULL, NULL, NULL, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
12127   __Pyx_GOTREF(__pyx_t_4);
12128   if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_x, __pyx_t_2) < 0)) __PYX_ERR(0, 109, __pyx_L1_error)
12129   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12130   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12131 
12132   /* "urh/cythonext/path_creator.pyx":110
12133  *
12134  *     arr[1:n+1]['x'] = x
12135  *     arr[1:n+1]['y'] = np.negative(y)  # negate y since coordinate system is inverted             # <<<<<<<<<<<<<<
12136  *     arr[1:n+1]['c'] = 1
12137  *
12138  */
12139   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
12140   __Pyx_GOTREF(__pyx_t_4);
12141   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_negative); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error)
12142   __Pyx_GOTREF(__pyx_t_6);
12143   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12144   __pyx_t_4 = NULL;
12145   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12146     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
12147     if (likely(__pyx_t_4)) {
12148       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12149       __Pyx_INCREF(__pyx_t_4);
12150       __Pyx_INCREF(function);
12151       __Pyx_DECREF_SET(__pyx_t_6, function);
12152     }
12153   }
12154   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_y) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_y);
12155   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12156   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
12157   __Pyx_GOTREF(__pyx_t_2);
12158   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12159   __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_arr, 1, (__pyx_v_n + 1), NULL, NULL, NULL, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error)
12160   __Pyx_GOTREF(__pyx_t_6);
12161   if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_y, __pyx_t_2) < 0)) __PYX_ERR(0, 110, __pyx_L1_error)
12162   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12163   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12164 
12165   /* "urh/cythonext/path_creator.pyx":111
12166  *     arr[1:n+1]['x'] = x
12167  *     arr[1:n+1]['y'] = np.negative(y)  # negate y since coordinate system is inverted
12168  *     arr[1:n+1]['c'] = 1             # <<<<<<<<<<<<<<
12169  *
12170  *     cdef long long last_index = 20 * (n + 1)
12171  */
12172   __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_arr, 1, (__pyx_v_n + 1), NULL, NULL, NULL, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
12173   __Pyx_GOTREF(__pyx_t_2);
12174   if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_u_c, __pyx_int_1) < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
12175   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12176 
12177   /* "urh/cythonext/path_creator.pyx":113
12178  *     arr[1:n+1]['c'] = 1
12179  *
12180  *     cdef long long last_index = 20 * (n + 1)             # <<<<<<<<<<<<<<
12181  *     byte_view.data[last_index:last_index + 4] = struct.pack('>i', 0)
12182  *
12183  */
12184   __pyx_v_last_index = (20 * (__pyx_v_n + 1));
12185 
12186   /* "urh/cythonext/path_creator.pyx":114
12187  *
12188  *     cdef long long last_index = 20 * (n + 1)
12189  *     byte_view.data[last_index:last_index + 4] = struct.pack('>i', 0)             # <<<<<<<<<<<<<<
12190  *
12191  *     try:
12192  */
12193   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
12194   __Pyx_GOTREF(__pyx_t_2);
12195   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error)
12196   __Pyx_GOTREF(__pyx_t_6);
12197   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12198   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
12199   __Pyx_GOTREF(__pyx_t_2);
12200   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12201   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_byte_view, __pyx_n_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error)
12202   __Pyx_GOTREF(__pyx_t_6);
12203   if (__Pyx_PyObject_SetSlice(__pyx_t_6, __pyx_t_2, __pyx_v_last_index, (__pyx_v_last_index + 4), NULL, NULL, NULL, 1, 1, 0) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
12204   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12205   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12206 
12207   /* "urh/cythonext/path_creator.pyx":116
12208  *     byte_view.data[last_index:last_index + 4] = struct.pack('>i', 0)
12209  *
12210  *     try:             # <<<<<<<<<<<<<<
12211  *         buf = QByteArray.fromRawData(byte_view.data[12:last_index + 4])
12212  *     except TypeError:
12213  */
12214   {
12215     __Pyx_PyThreadState_declare
12216     __Pyx_PyThreadState_assign
12217     __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12218     __Pyx_XGOTREF(__pyx_t_7);
12219     __Pyx_XGOTREF(__pyx_t_8);
12220     __Pyx_XGOTREF(__pyx_t_9);
12221     /*try:*/ {
12222 
12223       /* "urh/cythonext/path_creator.pyx":117
12224  *
12225  *     try:
12226  *         buf = QByteArray.fromRawData(byte_view.data[12:last_index + 4])             # <<<<<<<<<<<<<<
12227  *     except TypeError:
12228  *         buf = QByteArray(byte_view.data[12:last_index + 4])
12229  */
12230       __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_QByteArray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L3_error)
12231       __Pyx_GOTREF(__pyx_t_6);
12232       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_fromRawData); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L3_error)
12233       __Pyx_GOTREF(__pyx_t_4);
12234       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12235       __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_byte_view, __pyx_n_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L3_error)
12236       __Pyx_GOTREF(__pyx_t_6);
12237       __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_6, 12, (__pyx_v_last_index + 4), NULL, NULL, NULL, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L3_error)
12238       __Pyx_GOTREF(__pyx_t_1);
12239       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12240       __pyx_t_6 = NULL;
12241       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12242         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
12243         if (likely(__pyx_t_6)) {
12244           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12245           __Pyx_INCREF(__pyx_t_6);
12246           __Pyx_INCREF(function);
12247           __Pyx_DECREF_SET(__pyx_t_4, function);
12248         }
12249       }
12250       __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1);
12251       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12252       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12253       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L3_error)
12254       __Pyx_GOTREF(__pyx_t_2);
12255       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12256       __pyx_v_buf = __pyx_t_2;
12257       __pyx_t_2 = 0;
12258 
12259       /* "urh/cythonext/path_creator.pyx":116
12260  *     byte_view.data[last_index:last_index + 4] = struct.pack('>i', 0)
12261  *
12262  *     try:             # <<<<<<<<<<<<<<
12263  *         buf = QByteArray.fromRawData(byte_view.data[12:last_index + 4])
12264  *     except TypeError:
12265  */
12266     }
12267     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12268     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12269     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12270     goto __pyx_L8_try_end;
12271     __pyx_L3_error:;
12272     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12273     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12274     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12275     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12276     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12277 
12278     /* "urh/cythonext/path_creator.pyx":118
12279  *     try:
12280  *         buf = QByteArray.fromRawData(byte_view.data[12:last_index + 4])
12281  *     except TypeError:             # <<<<<<<<<<<<<<
12282  *         buf = QByteArray(byte_view.data[12:last_index + 4])
12283  *
12284  */
12285     __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12286     if (__pyx_t_5) {
12287       __Pyx_AddTraceback("urh.cythonext.path_creator.array_to_QPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
12288       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L5_except_error)
12289       __Pyx_GOTREF(__pyx_t_2);
12290       __Pyx_GOTREF(__pyx_t_4);
12291       __Pyx_GOTREF(__pyx_t_1);
12292 
12293       /* "urh/cythonext/path_creator.pyx":119
12294  *         buf = QByteArray.fromRawData(byte_view.data[12:last_index + 4])
12295  *     except TypeError:
12296  *         buf = QByteArray(byte_view.data[12:last_index + 4])             # <<<<<<<<<<<<<<
12297  *
12298  *     path = QPainterPath()
12299  */
12300       __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QByteArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L5_except_error)
12301       __Pyx_GOTREF(__pyx_t_3);
12302       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_byte_view, __pyx_n_s_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L5_except_error)
12303       __Pyx_GOTREF(__pyx_t_10);
12304       __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_t_10, 12, (__pyx_v_last_index + 4), NULL, NULL, NULL, 1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L5_except_error)
12305       __Pyx_GOTREF(__pyx_t_11);
12306       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12307       __pyx_t_10 = NULL;
12308       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
12309         __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
12310         if (likely(__pyx_t_10)) {
12311           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
12312           __Pyx_INCREF(__pyx_t_10);
12313           __Pyx_INCREF(function);
12314           __Pyx_DECREF_SET(__pyx_t_3, function);
12315         }
12316       }
12317       __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_11);
12318       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12319       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12320       if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L5_except_error)
12321       __Pyx_GOTREF(__pyx_t_6);
12322       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12323       __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_6);
12324       __pyx_t_6 = 0;
12325       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12326       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12327       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12328       goto __pyx_L4_exception_handled;
12329     }
12330     goto __pyx_L5_except_error;
12331     __pyx_L5_except_error:;
12332 
12333     /* "urh/cythonext/path_creator.pyx":116
12334  *     byte_view.data[last_index:last_index + 4] = struct.pack('>i', 0)
12335  *
12336  *     try:             # <<<<<<<<<<<<<<
12337  *         buf = QByteArray.fromRawData(byte_view.data[12:last_index + 4])
12338  *     except TypeError:
12339  */
12340     __Pyx_XGIVEREF(__pyx_t_7);
12341     __Pyx_XGIVEREF(__pyx_t_8);
12342     __Pyx_XGIVEREF(__pyx_t_9);
12343     __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12344     goto __pyx_L1_error;
12345     __pyx_L4_exception_handled:;
12346     __Pyx_XGIVEREF(__pyx_t_7);
12347     __Pyx_XGIVEREF(__pyx_t_8);
12348     __Pyx_XGIVEREF(__pyx_t_9);
12349     __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12350     __pyx_L8_try_end:;
12351   }
12352 
12353   /* "urh/cythonext/path_creator.pyx":121
12354  *         buf = QByteArray(byte_view.data[12:last_index + 4])
12355  *
12356  *     path = QPainterPath()             # <<<<<<<<<<<<<<
12357  *     ds = QDataStream(buf)
12358  *     ds >> path
12359  */
12360   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QPainterPath); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
12361   __Pyx_GOTREF(__pyx_t_4);
12362   __pyx_t_2 = NULL;
12363   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12364     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
12365     if (likely(__pyx_t_2)) {
12366       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12367       __Pyx_INCREF(__pyx_t_2);
12368       __Pyx_INCREF(function);
12369       __Pyx_DECREF_SET(__pyx_t_4, function);
12370     }
12371   }
12372   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
12373   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12374   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
12375   __Pyx_GOTREF(__pyx_t_1);
12376   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12377   __pyx_v_path = __pyx_t_1;
12378   __pyx_t_1 = 0;
12379 
12380   /* "urh/cythonext/path_creator.pyx":122
12381  *
12382  *     path = QPainterPath()
12383  *     ds = QDataStream(buf)             # <<<<<<<<<<<<<<
12384  *     ds >> path
12385  *
12386  */
12387   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QDataStream); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
12388   __Pyx_GOTREF(__pyx_t_4);
12389   __pyx_t_2 = NULL;
12390   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12391     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
12392     if (likely(__pyx_t_2)) {
12393       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12394       __Pyx_INCREF(__pyx_t_2);
12395       __Pyx_INCREF(function);
12396       __Pyx_DECREF_SET(__pyx_t_4, function);
12397     }
12398   }
12399   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_buf);
12400   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12401   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
12402   __Pyx_GOTREF(__pyx_t_1);
12403   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12404   __pyx_v_ds = __pyx_t_1;
12405   __pyx_t_1 = 0;
12406 
12407   /* "urh/cythonext/path_creator.pyx":123
12408  *     path = QPainterPath()
12409  *     ds = QDataStream(buf)
12410  *     ds >> path             # <<<<<<<<<<<<<<
12411  *
12412  *     return path
12413  */
12414   __pyx_t_1 = PyNumber_Rshift(__pyx_v_ds, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
12415   __Pyx_GOTREF(__pyx_t_1);
12416   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12417 
12418   /* "urh/cythonext/path_creator.pyx":125
12419  *     ds >> path
12420  *
12421  *     return path             # <<<<<<<<<<<<<<
12422  */
12423   __Pyx_XDECREF(__pyx_r);
12424   __Pyx_INCREF(__pyx_v_path);
12425   __pyx_r = __pyx_v_path;
12426   goto __pyx_L0;
12427 
12428   /* "urh/cythonext/path_creator.pyx":88
12429  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
12430  *
12431  * cpdef array_to_QPath(np.int64_t[:] x, y):             # <<<<<<<<<<<<<<
12432  *     """
12433  *     Convert an array of x,y coordinates to QPainterPath as efficiently as possible.
12434  */
12435 
12436   /* function exit code */
12437   __pyx_L1_error:;
12438   __Pyx_XDECREF(__pyx_t_1);
12439   __Pyx_XDECREF(__pyx_t_2);
12440   __Pyx_XDECREF(__pyx_t_3);
12441   __Pyx_XDECREF(__pyx_t_4);
12442   __Pyx_XDECREF(__pyx_t_6);
12443   __Pyx_XDECREF(__pyx_t_10);
12444   __Pyx_XDECREF(__pyx_t_11);
12445   __Pyx_AddTraceback("urh.cythonext.path_creator.array_to_QPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
12446   __pyx_r = 0;
12447   __pyx_L0:;
12448   __Pyx_XDECREF(__pyx_v_arr);
12449   __Pyx_XDECREF(__pyx_v_byte_view);
12450   __Pyx_XDECREF(__pyx_v_buf);
12451   __Pyx_XDECREF(__pyx_v_path);
12452   __Pyx_XDECREF(__pyx_v_ds);
12453   __Pyx_XGIVEREF(__pyx_r);
12454   __Pyx_RefNannyFinishContext();
12455   return __pyx_r;
12456 }
12457 
12458 /* Python wrapper */
12459 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_5array_to_QPath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12460 static char __pyx_doc_3urh_9cythonext_12path_creator_4array_to_QPath[] = "\n    Convert an array of x,y coordinates to QPainterPath as efficiently as possible.\n\n    Speed this up using >> operator\n    Format is:\n        numVerts(i4)   0(i4)\n        x(f8)   y(f8)   0(i4)    <-- 0 means this vertex does not connect\n        x(f8)   y(f8)   1(i4)    <-- 1 means this vertex connects to the previous vertex\n        ...\n        0(i4)\n\n     All values are big endian--pack using struct.pack('>d') or struct.pack('>i')\n    ";
__pyx_pw_3urh_9cythonext_12path_creator_5array_to_QPath(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)12461 static PyObject *__pyx_pw_3urh_9cythonext_12path_creator_5array_to_QPath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12462   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
12463   PyObject *__pyx_v_y = 0;
12464   int __pyx_lineno = 0;
12465   const char *__pyx_filename = NULL;
12466   int __pyx_clineno = 0;
12467   PyObject *__pyx_r = 0;
12468   __Pyx_RefNannyDeclarations
12469   __Pyx_RefNannySetupContext("array_to_QPath (wrapper)", 0);
12470   {
12471     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
12472     PyObject* values[2] = {0,0};
12473     if (unlikely(__pyx_kwds)) {
12474       Py_ssize_t kw_args;
12475       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12476       switch (pos_args) {
12477         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12478         CYTHON_FALLTHROUGH;
12479         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12480         CYTHON_FALLTHROUGH;
12481         case  0: break;
12482         default: goto __pyx_L5_argtuple_error;
12483       }
12484       kw_args = PyDict_Size(__pyx_kwds);
12485       switch (pos_args) {
12486         case  0:
12487         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
12488         else goto __pyx_L5_argtuple_error;
12489         CYTHON_FALLTHROUGH;
12490         case  1:
12491         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
12492         else {
12493           __Pyx_RaiseArgtupleInvalid("array_to_QPath", 1, 2, 2, 1); __PYX_ERR(0, 88, __pyx_L3_error)
12494         }
12495       }
12496       if (unlikely(kw_args > 0)) {
12497         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array_to_QPath") < 0)) __PYX_ERR(0, 88, __pyx_L3_error)
12498       }
12499     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12500       goto __pyx_L5_argtuple_error;
12501     } else {
12502       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12503       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12504     }
12505     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 88, __pyx_L3_error)
12506     __pyx_v_y = values[1];
12507   }
12508   goto __pyx_L4_argument_unpacking_done;
12509   __pyx_L5_argtuple_error:;
12510   __Pyx_RaiseArgtupleInvalid("array_to_QPath", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 88, __pyx_L3_error)
12511   __pyx_L3_error:;
12512   __Pyx_AddTraceback("urh.cythonext.path_creator.array_to_QPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
12513   __Pyx_RefNannyFinishContext();
12514   return NULL;
12515   __pyx_L4_argument_unpacking_done:;
12516   __pyx_r = __pyx_pf_3urh_9cythonext_12path_creator_4array_to_QPath(__pyx_self, __pyx_v_x, __pyx_v_y);
12517 
12518   /* function exit code */
12519   __Pyx_RefNannyFinishContext();
12520   return __pyx_r;
12521 }
12522 
__pyx_pf_3urh_9cythonext_12path_creator_4array_to_QPath(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,PyObject * __pyx_v_y)12523 static PyObject *__pyx_pf_3urh_9cythonext_12path_creator_4array_to_QPath(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_y) {
12524   PyObject *__pyx_r = NULL;
12525   __Pyx_RefNannyDeclarations
12526   PyObject *__pyx_t_1 = NULL;
12527   int __pyx_lineno = 0;
12528   const char *__pyx_filename = NULL;
12529   int __pyx_clineno = 0;
12530   __Pyx_RefNannySetupContext("array_to_QPath", 0);
12531   __Pyx_XDECREF(__pyx_r);
12532   __pyx_t_1 = __pyx_f_3urh_9cythonext_12path_creator_array_to_QPath(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
12533   __Pyx_GOTREF(__pyx_t_1);
12534   __pyx_r = __pyx_t_1;
12535   __pyx_t_1 = 0;
12536   goto __pyx_L0;
12537 
12538   /* function exit code */
12539   __pyx_L1_error:;
12540   __Pyx_XDECREF(__pyx_t_1);
12541   __Pyx_AddTraceback("urh.cythonext.path_creator.array_to_QPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
12542   __pyx_r = NULL;
12543   __pyx_L0:;
12544   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
12545   __Pyx_XGIVEREF(__pyx_r);
12546   __Pyx_RefNannyFinishContext();
12547   return __pyx_r;
12548 }
12549 
12550 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":735
12551  * ctypedef npy_cdouble     complex_t
12552  *
12553  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
12554  *     return PyArray_MultiIterNew(1, <void*>a)
12555  *
12556  */
12557 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)12558 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
12559   PyObject *__pyx_r = NULL;
12560   __Pyx_RefNannyDeclarations
12561   PyObject *__pyx_t_1 = NULL;
12562   int __pyx_lineno = 0;
12563   const char *__pyx_filename = NULL;
12564   int __pyx_clineno = 0;
12565   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
12566 
12567   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":736
12568  *
12569  * cdef inline object PyArray_MultiIterNew1(a):
12570  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
12571  *
12572  * cdef inline object PyArray_MultiIterNew2(a, b):
12573  */
12574   __Pyx_XDECREF(__pyx_r);
12575   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
12576   __Pyx_GOTREF(__pyx_t_1);
12577   __pyx_r = __pyx_t_1;
12578   __pyx_t_1 = 0;
12579   goto __pyx_L0;
12580 
12581   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":735
12582  * ctypedef npy_cdouble     complex_t
12583  *
12584  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
12585  *     return PyArray_MultiIterNew(1, <void*>a)
12586  *
12587  */
12588 
12589   /* function exit code */
12590   __pyx_L1_error:;
12591   __Pyx_XDECREF(__pyx_t_1);
12592   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
12593   __pyx_r = 0;
12594   __pyx_L0:;
12595   __Pyx_XGIVEREF(__pyx_r);
12596   __Pyx_RefNannyFinishContext();
12597   return __pyx_r;
12598 }
12599 
12600 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":738
12601  *     return PyArray_MultiIterNew(1, <void*>a)
12602  *
12603  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
12604  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
12605  *
12606  */
12607 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)12608 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
12609   PyObject *__pyx_r = NULL;
12610   __Pyx_RefNannyDeclarations
12611   PyObject *__pyx_t_1 = NULL;
12612   int __pyx_lineno = 0;
12613   const char *__pyx_filename = NULL;
12614   int __pyx_clineno = 0;
12615   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
12616 
12617   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":739
12618  *
12619  * cdef inline object PyArray_MultiIterNew2(a, b):
12620  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
12621  *
12622  * cdef inline object PyArray_MultiIterNew3(a, b, c):
12623  */
12624   __Pyx_XDECREF(__pyx_r);
12625   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
12626   __Pyx_GOTREF(__pyx_t_1);
12627   __pyx_r = __pyx_t_1;
12628   __pyx_t_1 = 0;
12629   goto __pyx_L0;
12630 
12631   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":738
12632  *     return PyArray_MultiIterNew(1, <void*>a)
12633  *
12634  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
12635  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
12636  *
12637  */
12638 
12639   /* function exit code */
12640   __pyx_L1_error:;
12641   __Pyx_XDECREF(__pyx_t_1);
12642   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
12643   __pyx_r = 0;
12644   __pyx_L0:;
12645   __Pyx_XGIVEREF(__pyx_r);
12646   __Pyx_RefNannyFinishContext();
12647   return __pyx_r;
12648 }
12649 
12650 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":741
12651  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
12652  *
12653  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
12654  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
12655  *
12656  */
12657 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)12658 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
12659   PyObject *__pyx_r = NULL;
12660   __Pyx_RefNannyDeclarations
12661   PyObject *__pyx_t_1 = NULL;
12662   int __pyx_lineno = 0;
12663   const char *__pyx_filename = NULL;
12664   int __pyx_clineno = 0;
12665   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
12666 
12667   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":742
12668  *
12669  * cdef inline object PyArray_MultiIterNew3(a, b, c):
12670  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
12671  *
12672  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
12673  */
12674   __Pyx_XDECREF(__pyx_r);
12675   __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, 742, __pyx_L1_error)
12676   __Pyx_GOTREF(__pyx_t_1);
12677   __pyx_r = __pyx_t_1;
12678   __pyx_t_1 = 0;
12679   goto __pyx_L0;
12680 
12681   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":741
12682  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
12683  *
12684  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
12685  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
12686  *
12687  */
12688 
12689   /* function exit code */
12690   __pyx_L1_error:;
12691   __Pyx_XDECREF(__pyx_t_1);
12692   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
12693   __pyx_r = 0;
12694   __pyx_L0:;
12695   __Pyx_XGIVEREF(__pyx_r);
12696   __Pyx_RefNannyFinishContext();
12697   return __pyx_r;
12698 }
12699 
12700 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":744
12701  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
12702  *
12703  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
12704  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
12705  *
12706  */
12707 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)12708 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) {
12709   PyObject *__pyx_r = NULL;
12710   __Pyx_RefNannyDeclarations
12711   PyObject *__pyx_t_1 = NULL;
12712   int __pyx_lineno = 0;
12713   const char *__pyx_filename = NULL;
12714   int __pyx_clineno = 0;
12715   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
12716 
12717   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":745
12718  *
12719  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
12720  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
12721  *
12722  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
12723  */
12724   __Pyx_XDECREF(__pyx_r);
12725   __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, 745, __pyx_L1_error)
12726   __Pyx_GOTREF(__pyx_t_1);
12727   __pyx_r = __pyx_t_1;
12728   __pyx_t_1 = 0;
12729   goto __pyx_L0;
12730 
12731   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":744
12732  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
12733  *
12734  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
12735  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
12736  *
12737  */
12738 
12739   /* function exit code */
12740   __pyx_L1_error:;
12741   __Pyx_XDECREF(__pyx_t_1);
12742   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
12743   __pyx_r = 0;
12744   __pyx_L0:;
12745   __Pyx_XGIVEREF(__pyx_r);
12746   __Pyx_RefNannyFinishContext();
12747   return __pyx_r;
12748 }
12749 
12750 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":747
12751  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
12752  *
12753  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
12754  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
12755  *
12756  */
12757 
__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)12758 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) {
12759   PyObject *__pyx_r = NULL;
12760   __Pyx_RefNannyDeclarations
12761   PyObject *__pyx_t_1 = NULL;
12762   int __pyx_lineno = 0;
12763   const char *__pyx_filename = NULL;
12764   int __pyx_clineno = 0;
12765   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
12766 
12767   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":748
12768  *
12769  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
12770  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
12771  *
12772  * cdef inline tuple PyDataType_SHAPE(dtype d):
12773  */
12774   __Pyx_XDECREF(__pyx_r);
12775   __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, 748, __pyx_L1_error)
12776   __Pyx_GOTREF(__pyx_t_1);
12777   __pyx_r = __pyx_t_1;
12778   __pyx_t_1 = 0;
12779   goto __pyx_L0;
12780 
12781   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":747
12782  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
12783  *
12784  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
12785  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
12786  *
12787  */
12788 
12789   /* function exit code */
12790   __pyx_L1_error:;
12791   __Pyx_XDECREF(__pyx_t_1);
12792   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
12793   __pyx_r = 0;
12794   __pyx_L0:;
12795   __Pyx_XGIVEREF(__pyx_r);
12796   __Pyx_RefNannyFinishContext();
12797   return __pyx_r;
12798 }
12799 
12800 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":750
12801  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
12802  *
12803  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
12804  *     if PyDataType_HASSUBARRAY(d):
12805  *         return <tuple>d.subarray.shape
12806  */
12807 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)12808 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
12809   PyObject *__pyx_r = NULL;
12810   __Pyx_RefNannyDeclarations
12811   int __pyx_t_1;
12812   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
12813 
12814   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":751
12815  *
12816  * cdef inline tuple PyDataType_SHAPE(dtype d):
12817  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
12818  *         return <tuple>d.subarray.shape
12819  *     else:
12820  */
12821   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
12822   if (__pyx_t_1) {
12823 
12824     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":752
12825  * cdef inline tuple PyDataType_SHAPE(dtype d):
12826  *     if PyDataType_HASSUBARRAY(d):
12827  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
12828  *     else:
12829  *         return ()
12830  */
12831     __Pyx_XDECREF(__pyx_r);
12832     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
12833     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
12834     goto __pyx_L0;
12835 
12836     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":751
12837  *
12838  * cdef inline tuple PyDataType_SHAPE(dtype d):
12839  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
12840  *         return <tuple>d.subarray.shape
12841  *     else:
12842  */
12843   }
12844 
12845   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":754
12846  *         return <tuple>d.subarray.shape
12847  *     else:
12848  *         return ()             # <<<<<<<<<<<<<<
12849  *
12850  *
12851  */
12852   /*else*/ {
12853     __Pyx_XDECREF(__pyx_r);
12854     __Pyx_INCREF(__pyx_empty_tuple);
12855     __pyx_r = __pyx_empty_tuple;
12856     goto __pyx_L0;
12857   }
12858 
12859   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":750
12860  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
12861  *
12862  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
12863  *     if PyDataType_HASSUBARRAY(d):
12864  *         return <tuple>d.subarray.shape
12865  */
12866 
12867   /* function exit code */
12868   __pyx_L0:;
12869   __Pyx_XGIVEREF(__pyx_r);
12870   __Pyx_RefNannyFinishContext();
12871   return __pyx_r;
12872 }
12873 
12874 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":931
12875  *     int _import_umath() except -1
12876  *
12877  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
12878  *     Py_INCREF(base) # important to do this before stealing the reference below!
12879  *     PyArray_SetBaseObject(arr, base)
12880  */
12881 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)12882 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
12883   __Pyx_RefNannyDeclarations
12884   __Pyx_RefNannySetupContext("set_array_base", 0);
12885 
12886   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":932
12887  *
12888  * cdef inline void set_array_base(ndarray arr, object base):
12889  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
12890  *     PyArray_SetBaseObject(arr, base)
12891  *
12892  */
12893   Py_INCREF(__pyx_v_base);
12894 
12895   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":933
12896  * cdef inline void set_array_base(ndarray arr, object base):
12897  *     Py_INCREF(base) # important to do this before stealing the reference below!
12898  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
12899  *
12900  * cdef inline object get_array_base(ndarray arr):
12901  */
12902   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
12903 
12904   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":931
12905  *     int _import_umath() except -1
12906  *
12907  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
12908  *     Py_INCREF(base) # important to do this before stealing the reference below!
12909  *     PyArray_SetBaseObject(arr, base)
12910  */
12911 
12912   /* function exit code */
12913   __Pyx_RefNannyFinishContext();
12914 }
12915 
12916 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":935
12917  *     PyArray_SetBaseObject(arr, base)
12918  *
12919  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
12920  *     base = PyArray_BASE(arr)
12921  *     if base is NULL:
12922  */
12923 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)12924 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
12925   PyObject *__pyx_v_base;
12926   PyObject *__pyx_r = NULL;
12927   __Pyx_RefNannyDeclarations
12928   int __pyx_t_1;
12929   __Pyx_RefNannySetupContext("get_array_base", 0);
12930 
12931   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":936
12932  *
12933  * cdef inline object get_array_base(ndarray arr):
12934  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
12935  *     if base is NULL:
12936  *         return None
12937  */
12938   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
12939 
12940   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":937
12941  * cdef inline object get_array_base(ndarray arr):
12942  *     base = PyArray_BASE(arr)
12943  *     if base is NULL:             # <<<<<<<<<<<<<<
12944  *         return None
12945  *     return <object>base
12946  */
12947   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
12948   if (__pyx_t_1) {
12949 
12950     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":938
12951  *     base = PyArray_BASE(arr)
12952  *     if base is NULL:
12953  *         return None             # <<<<<<<<<<<<<<
12954  *     return <object>base
12955  *
12956  */
12957     __Pyx_XDECREF(__pyx_r);
12958     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12959     goto __pyx_L0;
12960 
12961     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":937
12962  * cdef inline object get_array_base(ndarray arr):
12963  *     base = PyArray_BASE(arr)
12964  *     if base is NULL:             # <<<<<<<<<<<<<<
12965  *         return None
12966  *     return <object>base
12967  */
12968   }
12969 
12970   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":939
12971  *     if base is NULL:
12972  *         return None
12973  *     return <object>base             # <<<<<<<<<<<<<<
12974  *
12975  * # Versions of the import_* functions which are more suitable for
12976  */
12977   __Pyx_XDECREF(__pyx_r);
12978   __Pyx_INCREF(((PyObject *)__pyx_v_base));
12979   __pyx_r = ((PyObject *)__pyx_v_base);
12980   goto __pyx_L0;
12981 
12982   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":935
12983  *     PyArray_SetBaseObject(arr, base)
12984  *
12985  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
12986  *     base = PyArray_BASE(arr)
12987  *     if base is NULL:
12988  */
12989 
12990   /* function exit code */
12991   __pyx_L0:;
12992   __Pyx_XGIVEREF(__pyx_r);
12993   __Pyx_RefNannyFinishContext();
12994   return __pyx_r;
12995 }
12996 
12997 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":943
12998  * # Versions of the import_* functions which are more suitable for
12999  * # Cython code.
13000  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
13001  *     try:
13002  *         __pyx_import_array()
13003  */
13004 
__pyx_f_5numpy_import_array(void)13005 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
13006   int __pyx_r;
13007   __Pyx_RefNannyDeclarations
13008   PyObject *__pyx_t_1 = NULL;
13009   PyObject *__pyx_t_2 = NULL;
13010   PyObject *__pyx_t_3 = NULL;
13011   int __pyx_t_4;
13012   PyObject *__pyx_t_5 = NULL;
13013   PyObject *__pyx_t_6 = NULL;
13014   PyObject *__pyx_t_7 = NULL;
13015   PyObject *__pyx_t_8 = NULL;
13016   int __pyx_lineno = 0;
13017   const char *__pyx_filename = NULL;
13018   int __pyx_clineno = 0;
13019   __Pyx_RefNannySetupContext("import_array", 0);
13020 
13021   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":944
13022  * # Cython code.
13023  * cdef inline int import_array() except -1:
13024  *     try:             # <<<<<<<<<<<<<<
13025  *         __pyx_import_array()
13026  *     except Exception:
13027  */
13028   {
13029     __Pyx_PyThreadState_declare
13030     __Pyx_PyThreadState_assign
13031     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13032     __Pyx_XGOTREF(__pyx_t_1);
13033     __Pyx_XGOTREF(__pyx_t_2);
13034     __Pyx_XGOTREF(__pyx_t_3);
13035     /*try:*/ {
13036 
13037       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":945
13038  * cdef inline int import_array() except -1:
13039  *     try:
13040  *         __pyx_import_array()             # <<<<<<<<<<<<<<
13041  *     except Exception:
13042  *         raise ImportError("numpy.core.multiarray failed to import")
13043  */
13044       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 945, __pyx_L3_error)
13045 
13046       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":944
13047  * # Cython code.
13048  * cdef inline int import_array() except -1:
13049  *     try:             # <<<<<<<<<<<<<<
13050  *         __pyx_import_array()
13051  *     except Exception:
13052  */
13053     }
13054     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13055     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13056     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13057     goto __pyx_L8_try_end;
13058     __pyx_L3_error:;
13059 
13060     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":946
13061  *     try:
13062  *         __pyx_import_array()
13063  *     except Exception:             # <<<<<<<<<<<<<<
13064  *         raise ImportError("numpy.core.multiarray failed to import")
13065  *
13066  */
13067     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
13068     if (__pyx_t_4) {
13069       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
13070       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 946, __pyx_L5_except_error)
13071       __Pyx_GOTREF(__pyx_t_5);
13072       __Pyx_GOTREF(__pyx_t_6);
13073       __Pyx_GOTREF(__pyx_t_7);
13074 
13075       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":947
13076  *         __pyx_import_array()
13077  *     except Exception:
13078  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
13079  *
13080  * cdef inline int import_umath() except -1:
13081  */
13082       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 947, __pyx_L5_except_error)
13083       __Pyx_GOTREF(__pyx_t_8);
13084       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
13085       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13086       __PYX_ERR(1, 947, __pyx_L5_except_error)
13087     }
13088     goto __pyx_L5_except_error;
13089     __pyx_L5_except_error:;
13090 
13091     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":944
13092  * # Cython code.
13093  * cdef inline int import_array() except -1:
13094  *     try:             # <<<<<<<<<<<<<<
13095  *         __pyx_import_array()
13096  *     except Exception:
13097  */
13098     __Pyx_XGIVEREF(__pyx_t_1);
13099     __Pyx_XGIVEREF(__pyx_t_2);
13100     __Pyx_XGIVEREF(__pyx_t_3);
13101     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13102     goto __pyx_L1_error;
13103     __pyx_L8_try_end:;
13104   }
13105 
13106   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":943
13107  * # Versions of the import_* functions which are more suitable for
13108  * # Cython code.
13109  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
13110  *     try:
13111  *         __pyx_import_array()
13112  */
13113 
13114   /* function exit code */
13115   __pyx_r = 0;
13116   goto __pyx_L0;
13117   __pyx_L1_error:;
13118   __Pyx_XDECREF(__pyx_t_5);
13119   __Pyx_XDECREF(__pyx_t_6);
13120   __Pyx_XDECREF(__pyx_t_7);
13121   __Pyx_XDECREF(__pyx_t_8);
13122   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
13123   __pyx_r = -1;
13124   __pyx_L0:;
13125   __Pyx_RefNannyFinishContext();
13126   return __pyx_r;
13127 }
13128 
13129 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":949
13130  *         raise ImportError("numpy.core.multiarray failed to import")
13131  *
13132  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
13133  *     try:
13134  *         _import_umath()
13135  */
13136 
__pyx_f_5numpy_import_umath(void)13137 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
13138   int __pyx_r;
13139   __Pyx_RefNannyDeclarations
13140   PyObject *__pyx_t_1 = NULL;
13141   PyObject *__pyx_t_2 = NULL;
13142   PyObject *__pyx_t_3 = NULL;
13143   int __pyx_t_4;
13144   PyObject *__pyx_t_5 = NULL;
13145   PyObject *__pyx_t_6 = NULL;
13146   PyObject *__pyx_t_7 = NULL;
13147   PyObject *__pyx_t_8 = NULL;
13148   int __pyx_lineno = 0;
13149   const char *__pyx_filename = NULL;
13150   int __pyx_clineno = 0;
13151   __Pyx_RefNannySetupContext("import_umath", 0);
13152 
13153   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":950
13154  *
13155  * cdef inline int import_umath() except -1:
13156  *     try:             # <<<<<<<<<<<<<<
13157  *         _import_umath()
13158  *     except Exception:
13159  */
13160   {
13161     __Pyx_PyThreadState_declare
13162     __Pyx_PyThreadState_assign
13163     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13164     __Pyx_XGOTREF(__pyx_t_1);
13165     __Pyx_XGOTREF(__pyx_t_2);
13166     __Pyx_XGOTREF(__pyx_t_3);
13167     /*try:*/ {
13168 
13169       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":951
13170  * cdef inline int import_umath() except -1:
13171  *     try:
13172  *         _import_umath()             # <<<<<<<<<<<<<<
13173  *     except Exception:
13174  *         raise ImportError("numpy.core.umath failed to import")
13175  */
13176       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 951, __pyx_L3_error)
13177 
13178       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":950
13179  *
13180  * cdef inline int import_umath() except -1:
13181  *     try:             # <<<<<<<<<<<<<<
13182  *         _import_umath()
13183  *     except Exception:
13184  */
13185     }
13186     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13187     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13188     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13189     goto __pyx_L8_try_end;
13190     __pyx_L3_error:;
13191 
13192     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":952
13193  *     try:
13194  *         _import_umath()
13195  *     except Exception:             # <<<<<<<<<<<<<<
13196  *         raise ImportError("numpy.core.umath failed to import")
13197  *
13198  */
13199     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
13200     if (__pyx_t_4) {
13201       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
13202       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 952, __pyx_L5_except_error)
13203       __Pyx_GOTREF(__pyx_t_5);
13204       __Pyx_GOTREF(__pyx_t_6);
13205       __Pyx_GOTREF(__pyx_t_7);
13206 
13207       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":953
13208  *         _import_umath()
13209  *     except Exception:
13210  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
13211  *
13212  * cdef inline int import_ufunc() except -1:
13213  */
13214       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 953, __pyx_L5_except_error)
13215       __Pyx_GOTREF(__pyx_t_8);
13216       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
13217       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13218       __PYX_ERR(1, 953, __pyx_L5_except_error)
13219     }
13220     goto __pyx_L5_except_error;
13221     __pyx_L5_except_error:;
13222 
13223     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":950
13224  *
13225  * cdef inline int import_umath() except -1:
13226  *     try:             # <<<<<<<<<<<<<<
13227  *         _import_umath()
13228  *     except Exception:
13229  */
13230     __Pyx_XGIVEREF(__pyx_t_1);
13231     __Pyx_XGIVEREF(__pyx_t_2);
13232     __Pyx_XGIVEREF(__pyx_t_3);
13233     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13234     goto __pyx_L1_error;
13235     __pyx_L8_try_end:;
13236   }
13237 
13238   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":949
13239  *         raise ImportError("numpy.core.multiarray failed to import")
13240  *
13241  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
13242  *     try:
13243  *         _import_umath()
13244  */
13245 
13246   /* function exit code */
13247   __pyx_r = 0;
13248   goto __pyx_L0;
13249   __pyx_L1_error:;
13250   __Pyx_XDECREF(__pyx_t_5);
13251   __Pyx_XDECREF(__pyx_t_6);
13252   __Pyx_XDECREF(__pyx_t_7);
13253   __Pyx_XDECREF(__pyx_t_8);
13254   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
13255   __pyx_r = -1;
13256   __pyx_L0:;
13257   __Pyx_RefNannyFinishContext();
13258   return __pyx_r;
13259 }
13260 
13261 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":955
13262  *         raise ImportError("numpy.core.umath failed to import")
13263  *
13264  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
13265  *     try:
13266  *         _import_umath()
13267  */
13268 
__pyx_f_5numpy_import_ufunc(void)13269 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
13270   int __pyx_r;
13271   __Pyx_RefNannyDeclarations
13272   PyObject *__pyx_t_1 = NULL;
13273   PyObject *__pyx_t_2 = NULL;
13274   PyObject *__pyx_t_3 = NULL;
13275   int __pyx_t_4;
13276   PyObject *__pyx_t_5 = NULL;
13277   PyObject *__pyx_t_6 = NULL;
13278   PyObject *__pyx_t_7 = NULL;
13279   PyObject *__pyx_t_8 = NULL;
13280   int __pyx_lineno = 0;
13281   const char *__pyx_filename = NULL;
13282   int __pyx_clineno = 0;
13283   __Pyx_RefNannySetupContext("import_ufunc", 0);
13284 
13285   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":956
13286  *
13287  * cdef inline int import_ufunc() except -1:
13288  *     try:             # <<<<<<<<<<<<<<
13289  *         _import_umath()
13290  *     except Exception:
13291  */
13292   {
13293     __Pyx_PyThreadState_declare
13294     __Pyx_PyThreadState_assign
13295     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13296     __Pyx_XGOTREF(__pyx_t_1);
13297     __Pyx_XGOTREF(__pyx_t_2);
13298     __Pyx_XGOTREF(__pyx_t_3);
13299     /*try:*/ {
13300 
13301       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":957
13302  * cdef inline int import_ufunc() except -1:
13303  *     try:
13304  *         _import_umath()             # <<<<<<<<<<<<<<
13305  *     except Exception:
13306  *         raise ImportError("numpy.core.umath failed to import")
13307  */
13308       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L3_error)
13309 
13310       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":956
13311  *
13312  * cdef inline int import_ufunc() except -1:
13313  *     try:             # <<<<<<<<<<<<<<
13314  *         _import_umath()
13315  *     except Exception:
13316  */
13317     }
13318     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13319     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13320     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13321     goto __pyx_L8_try_end;
13322     __pyx_L3_error:;
13323 
13324     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":958
13325  *     try:
13326  *         _import_umath()
13327  *     except Exception:             # <<<<<<<<<<<<<<
13328  *         raise ImportError("numpy.core.umath failed to import")
13329  *
13330  */
13331     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
13332     if (__pyx_t_4) {
13333       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
13334       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 958, __pyx_L5_except_error)
13335       __Pyx_GOTREF(__pyx_t_5);
13336       __Pyx_GOTREF(__pyx_t_6);
13337       __Pyx_GOTREF(__pyx_t_7);
13338 
13339       /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":959
13340  *         _import_umath()
13341  *     except Exception:
13342  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
13343  *
13344  * cdef extern from *:
13345  */
13346       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 959, __pyx_L5_except_error)
13347       __Pyx_GOTREF(__pyx_t_8);
13348       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
13349       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13350       __PYX_ERR(1, 959, __pyx_L5_except_error)
13351     }
13352     goto __pyx_L5_except_error;
13353     __pyx_L5_except_error:;
13354 
13355     /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":956
13356  *
13357  * cdef inline int import_ufunc() except -1:
13358  *     try:             # <<<<<<<<<<<<<<
13359  *         _import_umath()
13360  *     except Exception:
13361  */
13362     __Pyx_XGIVEREF(__pyx_t_1);
13363     __Pyx_XGIVEREF(__pyx_t_2);
13364     __Pyx_XGIVEREF(__pyx_t_3);
13365     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13366     goto __pyx_L1_error;
13367     __pyx_L8_try_end:;
13368   }
13369 
13370   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":955
13371  *         raise ImportError("numpy.core.umath failed to import")
13372  *
13373  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
13374  *     try:
13375  *         _import_umath()
13376  */
13377 
13378   /* function exit code */
13379   __pyx_r = 0;
13380   goto __pyx_L0;
13381   __pyx_L1_error:;
13382   __Pyx_XDECREF(__pyx_t_5);
13383   __Pyx_XDECREF(__pyx_t_6);
13384   __Pyx_XDECREF(__pyx_t_7);
13385   __Pyx_XDECREF(__pyx_t_8);
13386   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
13387   __pyx_r = -1;
13388   __pyx_L0:;
13389   __Pyx_RefNannyFinishContext();
13390   return __pyx_r;
13391 }
13392 
13393 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":969
13394  *
13395  *
13396  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
13397  *     """
13398  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
13399  */
13400 
__pyx_f_5numpy_is_timedelta64_object(PyObject * __pyx_v_obj)13401 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
13402   int __pyx_r;
13403   __Pyx_RefNannyDeclarations
13404   __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
13405 
13406   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":981
13407  *     bool
13408  *     """
13409  *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
13410  *
13411  *
13412  */
13413   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
13414   goto __pyx_L0;
13415 
13416   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":969
13417  *
13418  *
13419  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
13420  *     """
13421  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
13422  */
13423 
13424   /* function exit code */
13425   __pyx_L0:;
13426   __Pyx_RefNannyFinishContext();
13427   return __pyx_r;
13428 }
13429 
13430 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":984
13431  *
13432  *
13433  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
13434  *     """
13435  *     Cython equivalent of `isinstance(obj, np.datetime64)`
13436  */
13437 
__pyx_f_5numpy_is_datetime64_object(PyObject * __pyx_v_obj)13438 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
13439   int __pyx_r;
13440   __Pyx_RefNannyDeclarations
13441   __Pyx_RefNannySetupContext("is_datetime64_object", 0);
13442 
13443   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":996
13444  *     bool
13445  *     """
13446  *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
13447  *
13448  *
13449  */
13450   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
13451   goto __pyx_L0;
13452 
13453   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":984
13454  *
13455  *
13456  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
13457  *     """
13458  *     Cython equivalent of `isinstance(obj, np.datetime64)`
13459  */
13460 
13461   /* function exit code */
13462   __pyx_L0:;
13463   __Pyx_RefNannyFinishContext();
13464   return __pyx_r;
13465 }
13466 
13467 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":999
13468  *
13469  *
13470  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
13471  *     """
13472  *     returns the int64 value underlying scalar numpy datetime64 object
13473  */
13474 
__pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_v_obj)13475 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
13476   npy_datetime __pyx_r;
13477 
13478   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":1006
13479  *     also needed.  That can be found using `get_datetime64_unit`.
13480  *     """
13481  *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
13482  *
13483  *
13484  */
13485   __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
13486   goto __pyx_L0;
13487 
13488   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":999
13489  *
13490  *
13491  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
13492  *     """
13493  *     returns the int64 value underlying scalar numpy datetime64 object
13494  */
13495 
13496   /* function exit code */
13497   __pyx_L0:;
13498   return __pyx_r;
13499 }
13500 
13501 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":1009
13502  *
13503  *
13504  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
13505  *     """
13506  *     returns the int64 value underlying scalar numpy timedelta64 object
13507  */
13508 
__pyx_f_5numpy_get_timedelta64_value(PyObject * __pyx_v_obj)13509 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
13510   npy_timedelta __pyx_r;
13511 
13512   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":1013
13513  *     returns the int64 value underlying scalar numpy timedelta64 object
13514  *     """
13515  *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
13516  *
13517  *
13518  */
13519   __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
13520   goto __pyx_L0;
13521 
13522   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":1009
13523  *
13524  *
13525  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
13526  *     """
13527  *     returns the int64 value underlying scalar numpy timedelta64 object
13528  */
13529 
13530   /* function exit code */
13531   __pyx_L0:;
13532   return __pyx_r;
13533 }
13534 
13535 /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":1016
13536  *
13537  *
13538  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
13539  *     """
13540  *     returns the unit part of the dtype for a numpy datetime64 object.
13541  */
13542 
__pyx_f_5numpy_get_datetime64_unit(PyObject * __pyx_v_obj)13543 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
13544   NPY_DATETIMEUNIT __pyx_r;
13545 
13546   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":1020
13547  *     returns the unit part of the dtype for a numpy datetime64 object.
13548  *     """
13549  *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
13550  */
13551   __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
13552   goto __pyx_L0;
13553 
13554   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":1016
13555  *
13556  *
13557  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
13558  *     """
13559  *     returns the unit part of the dtype for a numpy datetime64 object.
13560  */
13561 
13562   /* function exit code */
13563   __pyx_L0:;
13564   return __pyx_r;
13565 }
13566 
13567 /* "View.MemoryView":122
13568  *         cdef bint dtype_is_object
13569  *
13570  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
13571  *                   mode="c", bint allocate_buffer=True):
13572  *
13573  */
13574 
13575 /* Python wrapper */
13576 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_array___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13577 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13578   PyObject *__pyx_v_shape = 0;
13579   Py_ssize_t __pyx_v_itemsize;
13580   PyObject *__pyx_v_format = 0;
13581   PyObject *__pyx_v_mode = 0;
13582   int __pyx_v_allocate_buffer;
13583   int __pyx_lineno = 0;
13584   const char *__pyx_filename = NULL;
13585   int __pyx_clineno = 0;
13586   int __pyx_r;
13587   __Pyx_RefNannyDeclarations
13588   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
13589   {
13590     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
13591     PyObject* values[5] = {0,0,0,0,0};
13592     values[3] = ((PyObject *)__pyx_n_s_c);
13593     if (unlikely(__pyx_kwds)) {
13594       Py_ssize_t kw_args;
13595       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13596       switch (pos_args) {
13597         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13598         CYTHON_FALLTHROUGH;
13599         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13600         CYTHON_FALLTHROUGH;
13601         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13602         CYTHON_FALLTHROUGH;
13603         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13604         CYTHON_FALLTHROUGH;
13605         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13606         CYTHON_FALLTHROUGH;
13607         case  0: break;
13608         default: goto __pyx_L5_argtuple_error;
13609       }
13610       kw_args = PyDict_Size(__pyx_kwds);
13611       switch (pos_args) {
13612         case  0:
13613         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
13614         else goto __pyx_L5_argtuple_error;
13615         CYTHON_FALLTHROUGH;
13616         case  1:
13617         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
13618         else {
13619           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
13620         }
13621         CYTHON_FALLTHROUGH;
13622         case  2:
13623         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
13624         else {
13625           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
13626         }
13627         CYTHON_FALLTHROUGH;
13628         case  3:
13629         if (kw_args > 0) {
13630           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
13631           if (value) { values[3] = value; kw_args--; }
13632         }
13633         CYTHON_FALLTHROUGH;
13634         case  4:
13635         if (kw_args > 0) {
13636           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
13637           if (value) { values[4] = value; kw_args--; }
13638         }
13639       }
13640       if (unlikely(kw_args > 0)) {
13641         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
13642       }
13643     } else {
13644       switch (PyTuple_GET_SIZE(__pyx_args)) {
13645         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13646         CYTHON_FALLTHROUGH;
13647         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13648         CYTHON_FALLTHROUGH;
13649         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13650         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13651         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13652         break;
13653         default: goto __pyx_L5_argtuple_error;
13654       }
13655     }
13656     __pyx_v_shape = ((PyObject*)values[0]);
13657     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
13658     __pyx_v_format = values[2];
13659     __pyx_v_mode = values[3];
13660     if (values[4]) {
13661       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
13662     } else {
13663 
13664       /* "View.MemoryView":123
13665  *
13666  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
13667  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
13668  *
13669  *         cdef int idx
13670  */
13671       __pyx_v_allocate_buffer = ((int)1);
13672     }
13673   }
13674   goto __pyx_L4_argument_unpacking_done;
13675   __pyx_L5_argtuple_error:;
13676   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
13677   __pyx_L3_error:;
13678   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13679   __Pyx_RefNannyFinishContext();
13680   return -1;
13681   __pyx_L4_argument_unpacking_done:;
13682   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
13683   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
13684     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
13685   }
13686   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
13687 
13688   /* "View.MemoryView":122
13689  *         cdef bint dtype_is_object
13690  *
13691  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
13692  *                   mode="c", bint allocate_buffer=True):
13693  *
13694  */
13695 
13696   /* function exit code */
13697   goto __pyx_L0;
13698   __pyx_L1_error:;
13699   __pyx_r = -1;
13700   __pyx_L0:;
13701   __Pyx_RefNannyFinishContext();
13702   return __pyx_r;
13703 }
13704 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,PyObject * __pyx_v_format,PyObject * __pyx_v_mode,int __pyx_v_allocate_buffer)13705 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
13706   int __pyx_v_idx;
13707   Py_ssize_t __pyx_v_i;
13708   Py_ssize_t __pyx_v_dim;
13709   PyObject **__pyx_v_p;
13710   char __pyx_v_order;
13711   int __pyx_r;
13712   __Pyx_RefNannyDeclarations
13713   Py_ssize_t __pyx_t_1;
13714   int __pyx_t_2;
13715   PyObject *__pyx_t_3 = NULL;
13716   int __pyx_t_4;
13717   PyObject *__pyx_t_5 = NULL;
13718   PyObject *__pyx_t_6 = NULL;
13719   char *__pyx_t_7;
13720   int __pyx_t_8;
13721   Py_ssize_t __pyx_t_9;
13722   PyObject *__pyx_t_10 = NULL;
13723   Py_ssize_t __pyx_t_11;
13724   int __pyx_lineno = 0;
13725   const char *__pyx_filename = NULL;
13726   int __pyx_clineno = 0;
13727   __Pyx_RefNannySetupContext("__cinit__", 0);
13728   __Pyx_INCREF(__pyx_v_format);
13729 
13730   /* "View.MemoryView":129
13731  *         cdef PyObject **p
13732  *
13733  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
13734  *         self.itemsize = itemsize
13735  *
13736  */
13737   if (unlikely(__pyx_v_shape == Py_None)) {
13738     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13739     __PYX_ERR(2, 129, __pyx_L1_error)
13740   }
13741   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
13742   __pyx_v_self->ndim = ((int)__pyx_t_1);
13743 
13744   /* "View.MemoryView":130
13745  *
13746  *         self.ndim = <int> len(shape)
13747  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
13748  *
13749  *         if not self.ndim:
13750  */
13751   __pyx_v_self->itemsize = __pyx_v_itemsize;
13752 
13753   /* "View.MemoryView":132
13754  *         self.itemsize = itemsize
13755  *
13756  *         if not self.ndim:             # <<<<<<<<<<<<<<
13757  *             raise ValueError("Empty shape tuple for cython.array")
13758  *
13759  */
13760   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
13761   if (unlikely(__pyx_t_2)) {
13762 
13763     /* "View.MemoryView":133
13764  *
13765  *         if not self.ndim:
13766  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
13767  *
13768  *         if itemsize <= 0:
13769  */
13770     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
13771     __Pyx_GOTREF(__pyx_t_3);
13772     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13773     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13774     __PYX_ERR(2, 133, __pyx_L1_error)
13775 
13776     /* "View.MemoryView":132
13777  *         self.itemsize = itemsize
13778  *
13779  *         if not self.ndim:             # <<<<<<<<<<<<<<
13780  *             raise ValueError("Empty shape tuple for cython.array")
13781  *
13782  */
13783   }
13784 
13785   /* "View.MemoryView":135
13786  *             raise ValueError("Empty shape tuple for cython.array")
13787  *
13788  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
13789  *             raise ValueError("itemsize <= 0 for cython.array")
13790  *
13791  */
13792   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
13793   if (unlikely(__pyx_t_2)) {
13794 
13795     /* "View.MemoryView":136
13796  *
13797  *         if itemsize <= 0:
13798  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
13799  *
13800  *         if not isinstance(format, bytes):
13801  */
13802     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
13803     __Pyx_GOTREF(__pyx_t_3);
13804     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13805     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13806     __PYX_ERR(2, 136, __pyx_L1_error)
13807 
13808     /* "View.MemoryView":135
13809  *             raise ValueError("Empty shape tuple for cython.array")
13810  *
13811  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
13812  *             raise ValueError("itemsize <= 0 for cython.array")
13813  *
13814  */
13815   }
13816 
13817   /* "View.MemoryView":138
13818  *             raise ValueError("itemsize <= 0 for cython.array")
13819  *
13820  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
13821  *             format = format.encode('ASCII')
13822  *         self._format = format  # keep a reference to the byte string
13823  */
13824   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
13825   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
13826   if (__pyx_t_4) {
13827 
13828     /* "View.MemoryView":139
13829  *
13830  *         if not isinstance(format, bytes):
13831  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
13832  *         self._format = format  # keep a reference to the byte string
13833  *         self.format = self._format
13834  */
13835     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
13836     __Pyx_GOTREF(__pyx_t_5);
13837     __pyx_t_6 = NULL;
13838     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13839       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
13840       if (likely(__pyx_t_6)) {
13841         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13842         __Pyx_INCREF(__pyx_t_6);
13843         __Pyx_INCREF(function);
13844         __Pyx_DECREF_SET(__pyx_t_5, function);
13845       }
13846     }
13847     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
13848     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13849     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
13850     __Pyx_GOTREF(__pyx_t_3);
13851     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13852     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
13853     __pyx_t_3 = 0;
13854 
13855     /* "View.MemoryView":138
13856  *             raise ValueError("itemsize <= 0 for cython.array")
13857  *
13858  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
13859  *             format = format.encode('ASCII')
13860  *         self._format = format  # keep a reference to the byte string
13861  */
13862   }
13863 
13864   /* "View.MemoryView":140
13865  *         if not isinstance(format, bytes):
13866  *             format = format.encode('ASCII')
13867  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
13868  *         self.format = self._format
13869  *
13870  */
13871   if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error)
13872   __pyx_t_3 = __pyx_v_format;
13873   __Pyx_INCREF(__pyx_t_3);
13874   __Pyx_GIVEREF(__pyx_t_3);
13875   __Pyx_GOTREF(__pyx_v_self->_format);
13876   __Pyx_DECREF(__pyx_v_self->_format);
13877   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
13878   __pyx_t_3 = 0;
13879 
13880   /* "View.MemoryView":141
13881  *             format = format.encode('ASCII')
13882  *         self._format = format  # keep a reference to the byte string
13883  *         self.format = self._format             # <<<<<<<<<<<<<<
13884  *
13885  *
13886  */
13887   if (unlikely(__pyx_v_self->_format == Py_None)) {
13888     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
13889     __PYX_ERR(2, 141, __pyx_L1_error)
13890   }
13891   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
13892   __pyx_v_self->format = __pyx_t_7;
13893 
13894   /* "View.MemoryView":144
13895  *
13896  *
13897  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
13898  *         self._strides = self._shape + self.ndim
13899  *
13900  */
13901   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
13902 
13903   /* "View.MemoryView":145
13904  *
13905  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
13906  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
13907  *
13908  *         if not self._shape:
13909  */
13910   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
13911 
13912   /* "View.MemoryView":147
13913  *         self._strides = self._shape + self.ndim
13914  *
13915  *         if not self._shape:             # <<<<<<<<<<<<<<
13916  *             raise MemoryError("unable to allocate shape and strides.")
13917  *
13918  */
13919   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
13920   if (unlikely(__pyx_t_4)) {
13921 
13922     /* "View.MemoryView":148
13923  *
13924  *         if not self._shape:
13925  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
13926  *
13927  *
13928  */
13929     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
13930     __Pyx_GOTREF(__pyx_t_3);
13931     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13932     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13933     __PYX_ERR(2, 148, __pyx_L1_error)
13934 
13935     /* "View.MemoryView":147
13936  *         self._strides = self._shape + self.ndim
13937  *
13938  *         if not self._shape:             # <<<<<<<<<<<<<<
13939  *             raise MemoryError("unable to allocate shape and strides.")
13940  *
13941  */
13942   }
13943 
13944   /* "View.MemoryView":151
13945  *
13946  *
13947  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
13948  *             if dim <= 0:
13949  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
13950  */
13951   __pyx_t_8 = 0;
13952   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
13953   for (;;) {
13954     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
13955     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13956     __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error)
13957     #else
13958     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
13959     __Pyx_GOTREF(__pyx_t_5);
13960     #endif
13961     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
13962     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13963     __pyx_v_dim = __pyx_t_9;
13964     __pyx_v_idx = __pyx_t_8;
13965     __pyx_t_8 = (__pyx_t_8 + 1);
13966 
13967     /* "View.MemoryView":152
13968  *
13969  *         for idx, dim in enumerate(shape):
13970  *             if dim <= 0:             # <<<<<<<<<<<<<<
13971  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
13972  *             self._shape[idx] = dim
13973  */
13974     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
13975     if (unlikely(__pyx_t_4)) {
13976 
13977       /* "View.MemoryView":153
13978  *         for idx, dim in enumerate(shape):
13979  *             if dim <= 0:
13980  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
13981  *             self._shape[idx] = dim
13982  *
13983  */
13984       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
13985       __Pyx_GOTREF(__pyx_t_5);
13986       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
13987       __Pyx_GOTREF(__pyx_t_6);
13988       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
13989       __Pyx_GOTREF(__pyx_t_10);
13990       __Pyx_GIVEREF(__pyx_t_5);
13991       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
13992       __Pyx_GIVEREF(__pyx_t_6);
13993       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
13994       __pyx_t_5 = 0;
13995       __pyx_t_6 = 0;
13996       __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
13997       __Pyx_GOTREF(__pyx_t_6);
13998       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13999       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
14000       __Pyx_GOTREF(__pyx_t_10);
14001       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14002       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
14003       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14004       __PYX_ERR(2, 153, __pyx_L1_error)
14005 
14006       /* "View.MemoryView":152
14007  *
14008  *         for idx, dim in enumerate(shape):
14009  *             if dim <= 0:             # <<<<<<<<<<<<<<
14010  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
14011  *             self._shape[idx] = dim
14012  */
14013     }
14014 
14015     /* "View.MemoryView":154
14016  *             if dim <= 0:
14017  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
14018  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
14019  *
14020  *         cdef char order
14021  */
14022     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
14023 
14024     /* "View.MemoryView":151
14025  *
14026  *
14027  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
14028  *             if dim <= 0:
14029  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
14030  */
14031   }
14032   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14033 
14034   /* "View.MemoryView":157
14035  *
14036  *         cdef char order
14037  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
14038  *             order = b'F'
14039  *             self.mode = u'fortran'
14040  */
14041   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
14042   if (__pyx_t_4) {
14043 
14044     /* "View.MemoryView":158
14045  *         cdef char order
14046  *         if mode == 'fortran':
14047  *             order = b'F'             # <<<<<<<<<<<<<<
14048  *             self.mode = u'fortran'
14049  *         elif mode == 'c':
14050  */
14051     __pyx_v_order = 'F';
14052 
14053     /* "View.MemoryView":159
14054  *         if mode == 'fortran':
14055  *             order = b'F'
14056  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
14057  *         elif mode == 'c':
14058  *             order = b'C'
14059  */
14060     __Pyx_INCREF(__pyx_n_u_fortran);
14061     __Pyx_GIVEREF(__pyx_n_u_fortran);
14062     __Pyx_GOTREF(__pyx_v_self->mode);
14063     __Pyx_DECREF(__pyx_v_self->mode);
14064     __pyx_v_self->mode = __pyx_n_u_fortran;
14065 
14066     /* "View.MemoryView":157
14067  *
14068  *         cdef char order
14069  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
14070  *             order = b'F'
14071  *             self.mode = u'fortran'
14072  */
14073     goto __pyx_L10;
14074   }
14075 
14076   /* "View.MemoryView":160
14077  *             order = b'F'
14078  *             self.mode = u'fortran'
14079  *         elif mode == 'c':             # <<<<<<<<<<<<<<
14080  *             order = b'C'
14081  *             self.mode = u'c'
14082  */
14083   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
14084   if (likely(__pyx_t_4)) {
14085 
14086     /* "View.MemoryView":161
14087  *             self.mode = u'fortran'
14088  *         elif mode == 'c':
14089  *             order = b'C'             # <<<<<<<<<<<<<<
14090  *             self.mode = u'c'
14091  *         else:
14092  */
14093     __pyx_v_order = 'C';
14094 
14095     /* "View.MemoryView":162
14096  *         elif mode == 'c':
14097  *             order = b'C'
14098  *             self.mode = u'c'             # <<<<<<<<<<<<<<
14099  *         else:
14100  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
14101  */
14102     __Pyx_INCREF(__pyx_n_u_c);
14103     __Pyx_GIVEREF(__pyx_n_u_c);
14104     __Pyx_GOTREF(__pyx_v_self->mode);
14105     __Pyx_DECREF(__pyx_v_self->mode);
14106     __pyx_v_self->mode = __pyx_n_u_c;
14107 
14108     /* "View.MemoryView":160
14109  *             order = b'F'
14110  *             self.mode = u'fortran'
14111  *         elif mode == 'c':             # <<<<<<<<<<<<<<
14112  *             order = b'C'
14113  *             self.mode = u'c'
14114  */
14115     goto __pyx_L10;
14116   }
14117 
14118   /* "View.MemoryView":164
14119  *             self.mode = u'c'
14120  *         else:
14121  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
14122  *
14123  *         self.len = fill_contig_strides_array(self._shape, self._strides,
14124  */
14125   /*else*/ {
14126     __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error)
14127     __Pyx_GOTREF(__pyx_t_3);
14128     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
14129     __Pyx_GOTREF(__pyx_t_10);
14130     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14131     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
14132     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14133     __PYX_ERR(2, 164, __pyx_L1_error)
14134   }
14135   __pyx_L10:;
14136 
14137   /* "View.MemoryView":166
14138  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
14139  *
14140  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
14141  *                                              itemsize, self.ndim, order)
14142  *
14143  */
14144   __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
14145 
14146   /* "View.MemoryView":169
14147  *                                              itemsize, self.ndim, order)
14148  *
14149  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
14150  *         self.dtype_is_object = format == b'O'
14151  *         if allocate_buffer:
14152  */
14153   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
14154 
14155   /* "View.MemoryView":170
14156  *
14157  *         self.free_data = allocate_buffer
14158  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
14159  *         if allocate_buffer:
14160  *
14161  */
14162   __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error)
14163   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
14164   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14165   __pyx_v_self->dtype_is_object = __pyx_t_4;
14166 
14167   /* "View.MemoryView":171
14168  *         self.free_data = allocate_buffer
14169  *         self.dtype_is_object = format == b'O'
14170  *         if allocate_buffer:             # <<<<<<<<<<<<<<
14171  *
14172  *
14173  */
14174   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
14175   if (__pyx_t_4) {
14176 
14177     /* "View.MemoryView":174
14178  *
14179  *
14180  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
14181  *             if not self.data:
14182  *                 raise MemoryError("unable to allocate array data.")
14183  */
14184     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
14185 
14186     /* "View.MemoryView":175
14187  *
14188  *             self.data = <char *>malloc(self.len)
14189  *             if not self.data:             # <<<<<<<<<<<<<<
14190  *                 raise MemoryError("unable to allocate array data.")
14191  *
14192  */
14193     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
14194     if (unlikely(__pyx_t_4)) {
14195 
14196       /* "View.MemoryView":176
14197  *             self.data = <char *>malloc(self.len)
14198  *             if not self.data:
14199  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
14200  *
14201  *             if self.dtype_is_object:
14202  */
14203       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
14204       __Pyx_GOTREF(__pyx_t_10);
14205       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
14206       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14207       __PYX_ERR(2, 176, __pyx_L1_error)
14208 
14209       /* "View.MemoryView":175
14210  *
14211  *             self.data = <char *>malloc(self.len)
14212  *             if not self.data:             # <<<<<<<<<<<<<<
14213  *                 raise MemoryError("unable to allocate array data.")
14214  *
14215  */
14216     }
14217 
14218     /* "View.MemoryView":178
14219  *                 raise MemoryError("unable to allocate array data.")
14220  *
14221  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
14222  *                 p = <PyObject **> self.data
14223  *                 for i in range(self.len / itemsize):
14224  */
14225     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
14226     if (__pyx_t_4) {
14227 
14228       /* "View.MemoryView":179
14229  *
14230  *             if self.dtype_is_object:
14231  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
14232  *                 for i in range(self.len / itemsize):
14233  *                     p[i] = Py_None
14234  */
14235       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
14236 
14237       /* "View.MemoryView":180
14238  *             if self.dtype_is_object:
14239  *                 p = <PyObject **> self.data
14240  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
14241  *                     p[i] = Py_None
14242  *                     Py_INCREF(Py_None)
14243  */
14244       if (unlikely(__pyx_v_itemsize == 0)) {
14245         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14246         __PYX_ERR(2, 180, __pyx_L1_error)
14247       }
14248       else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
14249         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14250         __PYX_ERR(2, 180, __pyx_L1_error)
14251       }
14252       __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
14253       __pyx_t_9 = __pyx_t_1;
14254       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
14255         __pyx_v_i = __pyx_t_11;
14256 
14257         /* "View.MemoryView":181
14258  *                 p = <PyObject **> self.data
14259  *                 for i in range(self.len / itemsize):
14260  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
14261  *                     Py_INCREF(Py_None)
14262  *
14263  */
14264         (__pyx_v_p[__pyx_v_i]) = Py_None;
14265 
14266         /* "View.MemoryView":182
14267  *                 for i in range(self.len / itemsize):
14268  *                     p[i] = Py_None
14269  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
14270  *
14271  *     @cname('getbuffer')
14272  */
14273         Py_INCREF(Py_None);
14274       }
14275 
14276       /* "View.MemoryView":178
14277  *                 raise MemoryError("unable to allocate array data.")
14278  *
14279  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
14280  *                 p = <PyObject **> self.data
14281  *                 for i in range(self.len / itemsize):
14282  */
14283     }
14284 
14285     /* "View.MemoryView":171
14286  *         self.free_data = allocate_buffer
14287  *         self.dtype_is_object = format == b'O'
14288  *         if allocate_buffer:             # <<<<<<<<<<<<<<
14289  *
14290  *
14291  */
14292   }
14293 
14294   /* "View.MemoryView":122
14295  *         cdef bint dtype_is_object
14296  *
14297  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
14298  *                   mode="c", bint allocate_buffer=True):
14299  *
14300  */
14301 
14302   /* function exit code */
14303   __pyx_r = 0;
14304   goto __pyx_L0;
14305   __pyx_L1_error:;
14306   __Pyx_XDECREF(__pyx_t_3);
14307   __Pyx_XDECREF(__pyx_t_5);
14308   __Pyx_XDECREF(__pyx_t_6);
14309   __Pyx_XDECREF(__pyx_t_10);
14310   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14311   __pyx_r = -1;
14312   __pyx_L0:;
14313   __Pyx_XDECREF(__pyx_v_format);
14314   __Pyx_RefNannyFinishContext();
14315   return __pyx_r;
14316 }
14317 
14318 /* "View.MemoryView":185
14319  *
14320  *     @cname('getbuffer')
14321  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
14322  *         cdef int bufmode = -1
14323  *         if self.mode == u"c":
14324  */
14325 
14326 /* Python wrapper */
14327 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_array_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)14328 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
14329   int __pyx_r;
14330   __Pyx_RefNannyDeclarations
14331   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
14332   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
14333 
14334   /* function exit code */
14335   __Pyx_RefNannyFinishContext();
14336   return __pyx_r;
14337 }
14338 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)14339 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
14340   int __pyx_v_bufmode;
14341   int __pyx_r;
14342   __Pyx_RefNannyDeclarations
14343   int __pyx_t_1;
14344   int __pyx_t_2;
14345   PyObject *__pyx_t_3 = NULL;
14346   char *__pyx_t_4;
14347   Py_ssize_t __pyx_t_5;
14348   int __pyx_t_6;
14349   Py_ssize_t *__pyx_t_7;
14350   int __pyx_lineno = 0;
14351   const char *__pyx_filename = NULL;
14352   int __pyx_clineno = 0;
14353   if (__pyx_v_info == NULL) {
14354     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
14355     return -1;
14356   }
14357   __Pyx_RefNannySetupContext("__getbuffer__", 0);
14358   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
14359   __Pyx_GIVEREF(__pyx_v_info->obj);
14360 
14361   /* "View.MemoryView":186
14362  *     @cname('getbuffer')
14363  *     def __getbuffer__(self, Py_buffer *info, int flags):
14364  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
14365  *         if self.mode == u"c":
14366  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14367  */
14368   __pyx_v_bufmode = -1;
14369 
14370   /* "View.MemoryView":187
14371  *     def __getbuffer__(self, Py_buffer *info, int flags):
14372  *         cdef int bufmode = -1
14373  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
14374  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14375  *         elif self.mode == u"fortran":
14376  */
14377   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
14378   __pyx_t_2 = (__pyx_t_1 != 0);
14379   if (__pyx_t_2) {
14380 
14381     /* "View.MemoryView":188
14382  *         cdef int bufmode = -1
14383  *         if self.mode == u"c":
14384  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
14385  *         elif self.mode == u"fortran":
14386  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14387  */
14388     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
14389 
14390     /* "View.MemoryView":187
14391  *     def __getbuffer__(self, Py_buffer *info, int flags):
14392  *         cdef int bufmode = -1
14393  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
14394  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14395  *         elif self.mode == u"fortran":
14396  */
14397     goto __pyx_L3;
14398   }
14399 
14400   /* "View.MemoryView":189
14401  *         if self.mode == u"c":
14402  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14403  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
14404  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14405  *         if not (flags & bufmode):
14406  */
14407   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
14408   __pyx_t_1 = (__pyx_t_2 != 0);
14409   if (__pyx_t_1) {
14410 
14411     /* "View.MemoryView":190
14412  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14413  *         elif self.mode == u"fortran":
14414  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
14415  *         if not (flags & bufmode):
14416  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
14417  */
14418     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
14419 
14420     /* "View.MemoryView":189
14421  *         if self.mode == u"c":
14422  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14423  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
14424  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14425  *         if not (flags & bufmode):
14426  */
14427   }
14428   __pyx_L3:;
14429 
14430   /* "View.MemoryView":191
14431  *         elif self.mode == u"fortran":
14432  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14433  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
14434  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
14435  *         info.buf = self.data
14436  */
14437   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
14438   if (unlikely(__pyx_t_1)) {
14439 
14440     /* "View.MemoryView":192
14441  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14442  *         if not (flags & bufmode):
14443  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
14444  *         info.buf = self.data
14445  *         info.len = self.len
14446  */
14447     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
14448     __Pyx_GOTREF(__pyx_t_3);
14449     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14450     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14451     __PYX_ERR(2, 192, __pyx_L1_error)
14452 
14453     /* "View.MemoryView":191
14454  *         elif self.mode == u"fortran":
14455  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
14456  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
14457  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
14458  *         info.buf = self.data
14459  */
14460   }
14461 
14462   /* "View.MemoryView":193
14463  *         if not (flags & bufmode):
14464  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
14465  *         info.buf = self.data             # <<<<<<<<<<<<<<
14466  *         info.len = self.len
14467  *         info.ndim = self.ndim
14468  */
14469   __pyx_t_4 = __pyx_v_self->data;
14470   __pyx_v_info->buf = __pyx_t_4;
14471 
14472   /* "View.MemoryView":194
14473  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
14474  *         info.buf = self.data
14475  *         info.len = self.len             # <<<<<<<<<<<<<<
14476  *         info.ndim = self.ndim
14477  *         info.shape = self._shape
14478  */
14479   __pyx_t_5 = __pyx_v_self->len;
14480   __pyx_v_info->len = __pyx_t_5;
14481 
14482   /* "View.MemoryView":195
14483  *         info.buf = self.data
14484  *         info.len = self.len
14485  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
14486  *         info.shape = self._shape
14487  *         info.strides = self._strides
14488  */
14489   __pyx_t_6 = __pyx_v_self->ndim;
14490   __pyx_v_info->ndim = __pyx_t_6;
14491 
14492   /* "View.MemoryView":196
14493  *         info.len = self.len
14494  *         info.ndim = self.ndim
14495  *         info.shape = self._shape             # <<<<<<<<<<<<<<
14496  *         info.strides = self._strides
14497  *         info.suboffsets = NULL
14498  */
14499   __pyx_t_7 = __pyx_v_self->_shape;
14500   __pyx_v_info->shape = __pyx_t_7;
14501 
14502   /* "View.MemoryView":197
14503  *         info.ndim = self.ndim
14504  *         info.shape = self._shape
14505  *         info.strides = self._strides             # <<<<<<<<<<<<<<
14506  *         info.suboffsets = NULL
14507  *         info.itemsize = self.itemsize
14508  */
14509   __pyx_t_7 = __pyx_v_self->_strides;
14510   __pyx_v_info->strides = __pyx_t_7;
14511 
14512   /* "View.MemoryView":198
14513  *         info.shape = self._shape
14514  *         info.strides = self._strides
14515  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
14516  *         info.itemsize = self.itemsize
14517  *         info.readonly = 0
14518  */
14519   __pyx_v_info->suboffsets = NULL;
14520 
14521   /* "View.MemoryView":199
14522  *         info.strides = self._strides
14523  *         info.suboffsets = NULL
14524  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
14525  *         info.readonly = 0
14526  *
14527  */
14528   __pyx_t_5 = __pyx_v_self->itemsize;
14529   __pyx_v_info->itemsize = __pyx_t_5;
14530 
14531   /* "View.MemoryView":200
14532  *         info.suboffsets = NULL
14533  *         info.itemsize = self.itemsize
14534  *         info.readonly = 0             # <<<<<<<<<<<<<<
14535  *
14536  *         if flags & PyBUF_FORMAT:
14537  */
14538   __pyx_v_info->readonly = 0;
14539 
14540   /* "View.MemoryView":202
14541  *         info.readonly = 0
14542  *
14543  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
14544  *             info.format = self.format
14545  *         else:
14546  */
14547   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14548   if (__pyx_t_1) {
14549 
14550     /* "View.MemoryView":203
14551  *
14552  *         if flags & PyBUF_FORMAT:
14553  *             info.format = self.format             # <<<<<<<<<<<<<<
14554  *         else:
14555  *             info.format = NULL
14556  */
14557     __pyx_t_4 = __pyx_v_self->format;
14558     __pyx_v_info->format = __pyx_t_4;
14559 
14560     /* "View.MemoryView":202
14561  *         info.readonly = 0
14562  *
14563  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
14564  *             info.format = self.format
14565  *         else:
14566  */
14567     goto __pyx_L5;
14568   }
14569 
14570   /* "View.MemoryView":205
14571  *             info.format = self.format
14572  *         else:
14573  *             info.format = NULL             # <<<<<<<<<<<<<<
14574  *
14575  *         info.obj = self
14576  */
14577   /*else*/ {
14578     __pyx_v_info->format = NULL;
14579   }
14580   __pyx_L5:;
14581 
14582   /* "View.MemoryView":207
14583  *             info.format = NULL
14584  *
14585  *         info.obj = self             # <<<<<<<<<<<<<<
14586  *
14587  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
14588  */
14589   __Pyx_INCREF(((PyObject *)__pyx_v_self));
14590   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14591   __Pyx_GOTREF(__pyx_v_info->obj);
14592   __Pyx_DECREF(__pyx_v_info->obj);
14593   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
14594 
14595   /* "View.MemoryView":185
14596  *
14597  *     @cname('getbuffer')
14598  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
14599  *         cdef int bufmode = -1
14600  *         if self.mode == u"c":
14601  */
14602 
14603   /* function exit code */
14604   __pyx_r = 0;
14605   goto __pyx_L0;
14606   __pyx_L1_error:;
14607   __Pyx_XDECREF(__pyx_t_3);
14608   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14609   __pyx_r = -1;
14610   if (__pyx_v_info->obj != NULL) {
14611     __Pyx_GOTREF(__pyx_v_info->obj);
14612     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14613   }
14614   goto __pyx_L2;
14615   __pyx_L0:;
14616   if (__pyx_v_info->obj == Py_None) {
14617     __Pyx_GOTREF(__pyx_v_info->obj);
14618     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14619   }
14620   __pyx_L2:;
14621   __Pyx_RefNannyFinishContext();
14622   return __pyx_r;
14623 }
14624 
14625 /* "View.MemoryView":211
14626  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
14627  *
14628  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
14629  *         if self.callback_free_data != NULL:
14630  *             self.callback_free_data(self.data)
14631  */
14632 
14633 /* Python wrapper */
14634 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)14635 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
14636   __Pyx_RefNannyDeclarations
14637   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14638   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
14639 
14640   /* function exit code */
14641   __Pyx_RefNannyFinishContext();
14642 }
14643 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)14644 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
14645   __Pyx_RefNannyDeclarations
14646   int __pyx_t_1;
14647   __Pyx_RefNannySetupContext("__dealloc__", 0);
14648 
14649   /* "View.MemoryView":212
14650  *
14651  *     def __dealloc__(array self):
14652  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
14653  *             self.callback_free_data(self.data)
14654  *         elif self.free_data:
14655  */
14656   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
14657   if (__pyx_t_1) {
14658 
14659     /* "View.MemoryView":213
14660  *     def __dealloc__(array self):
14661  *         if self.callback_free_data != NULL:
14662  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
14663  *         elif self.free_data:
14664  *             if self.dtype_is_object:
14665  */
14666     __pyx_v_self->callback_free_data(__pyx_v_self->data);
14667 
14668     /* "View.MemoryView":212
14669  *
14670  *     def __dealloc__(array self):
14671  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
14672  *             self.callback_free_data(self.data)
14673  *         elif self.free_data:
14674  */
14675     goto __pyx_L3;
14676   }
14677 
14678   /* "View.MemoryView":214
14679  *         if self.callback_free_data != NULL:
14680  *             self.callback_free_data(self.data)
14681  *         elif self.free_data:             # <<<<<<<<<<<<<<
14682  *             if self.dtype_is_object:
14683  *                 refcount_objects_in_slice(self.data, self._shape,
14684  */
14685   __pyx_t_1 = (__pyx_v_self->free_data != 0);
14686   if (__pyx_t_1) {
14687 
14688     /* "View.MemoryView":215
14689  *             self.callback_free_data(self.data)
14690  *         elif self.free_data:
14691  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
14692  *                 refcount_objects_in_slice(self.data, self._shape,
14693  *                                           self._strides, self.ndim, False)
14694  */
14695     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
14696     if (__pyx_t_1) {
14697 
14698       /* "View.MemoryView":216
14699  *         elif self.free_data:
14700  *             if self.dtype_is_object:
14701  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
14702  *                                           self._strides, self.ndim, False)
14703  *             free(self.data)
14704  */
14705       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
14706 
14707       /* "View.MemoryView":215
14708  *             self.callback_free_data(self.data)
14709  *         elif self.free_data:
14710  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
14711  *                 refcount_objects_in_slice(self.data, self._shape,
14712  *                                           self._strides, self.ndim, False)
14713  */
14714     }
14715 
14716     /* "View.MemoryView":218
14717  *                 refcount_objects_in_slice(self.data, self._shape,
14718  *                                           self._strides, self.ndim, False)
14719  *             free(self.data)             # <<<<<<<<<<<<<<
14720  *         PyObject_Free(self._shape)
14721  *
14722  */
14723     free(__pyx_v_self->data);
14724 
14725     /* "View.MemoryView":214
14726  *         if self.callback_free_data != NULL:
14727  *             self.callback_free_data(self.data)
14728  *         elif self.free_data:             # <<<<<<<<<<<<<<
14729  *             if self.dtype_is_object:
14730  *                 refcount_objects_in_slice(self.data, self._shape,
14731  */
14732   }
14733   __pyx_L3:;
14734 
14735   /* "View.MemoryView":219
14736  *                                           self._strides, self.ndim, False)
14737  *             free(self.data)
14738  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
14739  *
14740  *     @property
14741  */
14742   PyObject_Free(__pyx_v_self->_shape);
14743 
14744   /* "View.MemoryView":211
14745  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
14746  *
14747  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
14748  *         if self.callback_free_data != NULL:
14749  *             self.callback_free_data(self.data)
14750  */
14751 
14752   /* function exit code */
14753   __Pyx_RefNannyFinishContext();
14754 }
14755 
14756 /* "View.MemoryView":222
14757  *
14758  *     @property
14759  *     def memview(self):             # <<<<<<<<<<<<<<
14760  *         return self.get_memview()
14761  *
14762  */
14763 
14764 /* Python wrapper */
14765 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject * __pyx_v_self)14766 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
14767   PyObject *__pyx_r = 0;
14768   __Pyx_RefNannyDeclarations
14769   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14770   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
14771 
14772   /* function exit code */
14773   __Pyx_RefNannyFinishContext();
14774   return __pyx_r;
14775 }
14776 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)14777 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
14778   PyObject *__pyx_r = NULL;
14779   __Pyx_RefNannyDeclarations
14780   PyObject *__pyx_t_1 = NULL;
14781   int __pyx_lineno = 0;
14782   const char *__pyx_filename = NULL;
14783   int __pyx_clineno = 0;
14784   __Pyx_RefNannySetupContext("__get__", 0);
14785 
14786   /* "View.MemoryView":223
14787  *     @property
14788  *     def memview(self):
14789  *         return self.get_memview()             # <<<<<<<<<<<<<<
14790  *
14791  *     @cname('get_memview')
14792  */
14793   __Pyx_XDECREF(__pyx_r);
14794   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
14795   __Pyx_GOTREF(__pyx_t_1);
14796   __pyx_r = __pyx_t_1;
14797   __pyx_t_1 = 0;
14798   goto __pyx_L0;
14799 
14800   /* "View.MemoryView":222
14801  *
14802  *     @property
14803  *     def memview(self):             # <<<<<<<<<<<<<<
14804  *         return self.get_memview()
14805  *
14806  */
14807 
14808   /* function exit code */
14809   __pyx_L1_error:;
14810   __Pyx_XDECREF(__pyx_t_1);
14811   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14812   __pyx_r = NULL;
14813   __pyx_L0:;
14814   __Pyx_XGIVEREF(__pyx_r);
14815   __Pyx_RefNannyFinishContext();
14816   return __pyx_r;
14817 }
14818 
14819 /* "View.MemoryView":226
14820  *
14821  *     @cname('get_memview')
14822  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
14823  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
14824  *         return  memoryview(self, flags, self.dtype_is_object)
14825  */
14826 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)14827 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
14828   int __pyx_v_flags;
14829   PyObject *__pyx_r = NULL;
14830   __Pyx_RefNannyDeclarations
14831   PyObject *__pyx_t_1 = NULL;
14832   PyObject *__pyx_t_2 = NULL;
14833   PyObject *__pyx_t_3 = NULL;
14834   int __pyx_lineno = 0;
14835   const char *__pyx_filename = NULL;
14836   int __pyx_clineno = 0;
14837   __Pyx_RefNannySetupContext("get_memview", 0);
14838 
14839   /* "View.MemoryView":227
14840  *     @cname('get_memview')
14841  *     cdef get_memview(self):
14842  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
14843  *         return  memoryview(self, flags, self.dtype_is_object)
14844  *
14845  */
14846   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
14847 
14848   /* "View.MemoryView":228
14849  *     cdef get_memview(self):
14850  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
14851  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
14852  *
14853  *     def __len__(self):
14854  */
14855   __Pyx_XDECREF(__pyx_r);
14856   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
14857   __Pyx_GOTREF(__pyx_t_1);
14858   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
14859   __Pyx_GOTREF(__pyx_t_2);
14860   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
14861   __Pyx_GOTREF(__pyx_t_3);
14862   __Pyx_INCREF(((PyObject *)__pyx_v_self));
14863   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14864   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
14865   __Pyx_GIVEREF(__pyx_t_1);
14866   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14867   __Pyx_GIVEREF(__pyx_t_2);
14868   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14869   __pyx_t_1 = 0;
14870   __pyx_t_2 = 0;
14871   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
14872   __Pyx_GOTREF(__pyx_t_2);
14873   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14874   __pyx_r = __pyx_t_2;
14875   __pyx_t_2 = 0;
14876   goto __pyx_L0;
14877 
14878   /* "View.MemoryView":226
14879  *
14880  *     @cname('get_memview')
14881  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
14882  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
14883  *         return  memoryview(self, flags, self.dtype_is_object)
14884  */
14885 
14886   /* function exit code */
14887   __pyx_L1_error:;
14888   __Pyx_XDECREF(__pyx_t_1);
14889   __Pyx_XDECREF(__pyx_t_2);
14890   __Pyx_XDECREF(__pyx_t_3);
14891   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
14892   __pyx_r = 0;
14893   __pyx_L0:;
14894   __Pyx_XGIVEREF(__pyx_r);
14895   __Pyx_RefNannyFinishContext();
14896   return __pyx_r;
14897 }
14898 
14899 /* "View.MemoryView":230
14900  *         return  memoryview(self, flags, self.dtype_is_object)
14901  *
14902  *     def __len__(self):             # <<<<<<<<<<<<<<
14903  *         return self._shape[0]
14904  *
14905  */
14906 
14907 /* Python wrapper */
14908 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)14909 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
14910   Py_ssize_t __pyx_r;
14911   __Pyx_RefNannyDeclarations
14912   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14913   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
14914 
14915   /* function exit code */
14916   __Pyx_RefNannyFinishContext();
14917   return __pyx_r;
14918 }
14919 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)14920 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
14921   Py_ssize_t __pyx_r;
14922   __Pyx_RefNannyDeclarations
14923   __Pyx_RefNannySetupContext("__len__", 0);
14924 
14925   /* "View.MemoryView":231
14926  *
14927  *     def __len__(self):
14928  *         return self._shape[0]             # <<<<<<<<<<<<<<
14929  *
14930  *     def __getattr__(self, attr):
14931  */
14932   __pyx_r = (__pyx_v_self->_shape[0]);
14933   goto __pyx_L0;
14934 
14935   /* "View.MemoryView":230
14936  *         return  memoryview(self, flags, self.dtype_is_object)
14937  *
14938  *     def __len__(self):             # <<<<<<<<<<<<<<
14939  *         return self._shape[0]
14940  *
14941  */
14942 
14943   /* function exit code */
14944   __pyx_L0:;
14945   __Pyx_RefNannyFinishContext();
14946   return __pyx_r;
14947 }
14948 
14949 /* "View.MemoryView":233
14950  *         return self._shape[0]
14951  *
14952  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
14953  *         return getattr(self.memview, attr)
14954  *
14955  */
14956 
14957 /* Python wrapper */
14958 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
__pyx_array___getattr__(PyObject * __pyx_v_self,PyObject * __pyx_v_attr)14959 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
14960   PyObject *__pyx_r = 0;
14961   __Pyx_RefNannyDeclarations
14962   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
14963   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
14964 
14965   /* function exit code */
14966   __Pyx_RefNannyFinishContext();
14967   return __pyx_r;
14968 }
14969 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)14970 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
14971   PyObject *__pyx_r = NULL;
14972   __Pyx_RefNannyDeclarations
14973   PyObject *__pyx_t_1 = NULL;
14974   PyObject *__pyx_t_2 = NULL;
14975   int __pyx_lineno = 0;
14976   const char *__pyx_filename = NULL;
14977   int __pyx_clineno = 0;
14978   __Pyx_RefNannySetupContext("__getattr__", 0);
14979 
14980   /* "View.MemoryView":234
14981  *
14982  *     def __getattr__(self, attr):
14983  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
14984  *
14985  *     def __getitem__(self, item):
14986  */
14987   __Pyx_XDECREF(__pyx_r);
14988   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
14989   __Pyx_GOTREF(__pyx_t_1);
14990   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
14991   __Pyx_GOTREF(__pyx_t_2);
14992   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14993   __pyx_r = __pyx_t_2;
14994   __pyx_t_2 = 0;
14995   goto __pyx_L0;
14996 
14997   /* "View.MemoryView":233
14998  *         return self._shape[0]
14999  *
15000  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
15001  *         return getattr(self.memview, attr)
15002  *
15003  */
15004 
15005   /* function exit code */
15006   __pyx_L1_error:;
15007   __Pyx_XDECREF(__pyx_t_1);
15008   __Pyx_XDECREF(__pyx_t_2);
15009   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15010   __pyx_r = NULL;
15011   __pyx_L0:;
15012   __Pyx_XGIVEREF(__pyx_r);
15013   __Pyx_RefNannyFinishContext();
15014   return __pyx_r;
15015 }
15016 
15017 /* "View.MemoryView":236
15018  *         return getattr(self.memview, attr)
15019  *
15020  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
15021  *         return self.memview[item]
15022  *
15023  */
15024 
15025 /* Python wrapper */
15026 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
__pyx_array___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item)15027 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
15028   PyObject *__pyx_r = 0;
15029   __Pyx_RefNannyDeclarations
15030   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
15031   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
15032 
15033   /* function exit code */
15034   __Pyx_RefNannyFinishContext();
15035   return __pyx_r;
15036 }
15037 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)15038 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
15039   PyObject *__pyx_r = NULL;
15040   __Pyx_RefNannyDeclarations
15041   PyObject *__pyx_t_1 = NULL;
15042   PyObject *__pyx_t_2 = NULL;
15043   int __pyx_lineno = 0;
15044   const char *__pyx_filename = NULL;
15045   int __pyx_clineno = 0;
15046   __Pyx_RefNannySetupContext("__getitem__", 0);
15047 
15048   /* "View.MemoryView":237
15049  *
15050  *     def __getitem__(self, item):
15051  *         return self.memview[item]             # <<<<<<<<<<<<<<
15052  *
15053  *     def __setitem__(self, item, value):
15054  */
15055   __Pyx_XDECREF(__pyx_r);
15056   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
15057   __Pyx_GOTREF(__pyx_t_1);
15058   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
15059   __Pyx_GOTREF(__pyx_t_2);
15060   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15061   __pyx_r = __pyx_t_2;
15062   __pyx_t_2 = 0;
15063   goto __pyx_L0;
15064 
15065   /* "View.MemoryView":236
15066  *         return getattr(self.memview, attr)
15067  *
15068  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
15069  *         return self.memview[item]
15070  *
15071  */
15072 
15073   /* function exit code */
15074   __pyx_L1_error:;
15075   __Pyx_XDECREF(__pyx_t_1);
15076   __Pyx_XDECREF(__pyx_t_2);
15077   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15078   __pyx_r = NULL;
15079   __pyx_L0:;
15080   __Pyx_XGIVEREF(__pyx_r);
15081   __Pyx_RefNannyFinishContext();
15082   return __pyx_r;
15083 }
15084 
15085 /* "View.MemoryView":239
15086  *         return self.memview[item]
15087  *
15088  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
15089  *         self.memview[item] = value
15090  *
15091  */
15092 
15093 /* Python wrapper */
15094 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
__pyx_array___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)15095 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
15096   int __pyx_r;
15097   __Pyx_RefNannyDeclarations
15098   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
15099   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
15100 
15101   /* function exit code */
15102   __Pyx_RefNannyFinishContext();
15103   return __pyx_r;
15104 }
15105 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)15106 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
15107   int __pyx_r;
15108   __Pyx_RefNannyDeclarations
15109   PyObject *__pyx_t_1 = NULL;
15110   int __pyx_lineno = 0;
15111   const char *__pyx_filename = NULL;
15112   int __pyx_clineno = 0;
15113   __Pyx_RefNannySetupContext("__setitem__", 0);
15114 
15115   /* "View.MemoryView":240
15116  *
15117  *     def __setitem__(self, item, value):
15118  *         self.memview[item] = value             # <<<<<<<<<<<<<<
15119  *
15120  *
15121  */
15122   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
15123   __Pyx_GOTREF(__pyx_t_1);
15124   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
15125   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15126 
15127   /* "View.MemoryView":239
15128  *         return self.memview[item]
15129  *
15130  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
15131  *         self.memview[item] = value
15132  *
15133  */
15134 
15135   /* function exit code */
15136   __pyx_r = 0;
15137   goto __pyx_L0;
15138   __pyx_L1_error:;
15139   __Pyx_XDECREF(__pyx_t_1);
15140   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15141   __pyx_r = -1;
15142   __pyx_L0:;
15143   __Pyx_RefNannyFinishContext();
15144   return __pyx_r;
15145 }
15146 
15147 /* "(tree fragment)":1
15148  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15149  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15150  * def __setstate_cython__(self, __pyx_state):
15151  */
15152 
15153 /* Python wrapper */
15154 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_array_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)15155 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15156   PyObject *__pyx_r = 0;
15157   __Pyx_RefNannyDeclarations
15158   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15159   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
15160 
15161   /* function exit code */
15162   __Pyx_RefNannyFinishContext();
15163   return __pyx_r;
15164 }
15165 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)15166 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
15167   PyObject *__pyx_r = NULL;
15168   __Pyx_RefNannyDeclarations
15169   PyObject *__pyx_t_1 = NULL;
15170   int __pyx_lineno = 0;
15171   const char *__pyx_filename = NULL;
15172   int __pyx_clineno = 0;
15173   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15174 
15175   /* "(tree fragment)":2
15176  * def __reduce_cython__(self):
15177  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
15178  * def __setstate_cython__(self, __pyx_state):
15179  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15180  */
15181   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
15182   __Pyx_GOTREF(__pyx_t_1);
15183   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15184   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15185   __PYX_ERR(2, 2, __pyx_L1_error)
15186 
15187   /* "(tree fragment)":1
15188  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15189  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15190  * def __setstate_cython__(self, __pyx_state):
15191  */
15192 
15193   /* function exit code */
15194   __pyx_L1_error:;
15195   __Pyx_XDECREF(__pyx_t_1);
15196   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15197   __pyx_r = NULL;
15198   __Pyx_XGIVEREF(__pyx_r);
15199   __Pyx_RefNannyFinishContext();
15200   return __pyx_r;
15201 }
15202 
15203 /* "(tree fragment)":3
15204  * def __reduce_cython__(self):
15205  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15206  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15207  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15208  */
15209 
15210 /* Python wrapper */
15211 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_array_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)15212 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15213   PyObject *__pyx_r = 0;
15214   __Pyx_RefNannyDeclarations
15215   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15216   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15217 
15218   /* function exit code */
15219   __Pyx_RefNannyFinishContext();
15220   return __pyx_r;
15221 }
15222 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)15223 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15224   PyObject *__pyx_r = NULL;
15225   __Pyx_RefNannyDeclarations
15226   PyObject *__pyx_t_1 = NULL;
15227   int __pyx_lineno = 0;
15228   const char *__pyx_filename = NULL;
15229   int __pyx_clineno = 0;
15230   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15231 
15232   /* "(tree fragment)":4
15233  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15234  * def __setstate_cython__(self, __pyx_state):
15235  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
15236  */
15237   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
15238   __Pyx_GOTREF(__pyx_t_1);
15239   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15240   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15241   __PYX_ERR(2, 4, __pyx_L1_error)
15242 
15243   /* "(tree fragment)":3
15244  * def __reduce_cython__(self):
15245  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15246  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15247  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15248  */
15249 
15250   /* function exit code */
15251   __pyx_L1_error:;
15252   __Pyx_XDECREF(__pyx_t_1);
15253   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15254   __pyx_r = NULL;
15255   __Pyx_XGIVEREF(__pyx_r);
15256   __Pyx_RefNannyFinishContext();
15257   return __pyx_r;
15258 }
15259 
15260 /* "View.MemoryView":244
15261  *
15262  * @cname("__pyx_array_new")
15263  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
15264  *                           char *mode, char *buf):
15265  *     cdef array result
15266  */
15267 
__pyx_array_new(PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,char * __pyx_v_format,char * __pyx_v_mode,char * __pyx_v_buf)15268 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
15269   struct __pyx_array_obj *__pyx_v_result = 0;
15270   struct __pyx_array_obj *__pyx_r = NULL;
15271   __Pyx_RefNannyDeclarations
15272   int __pyx_t_1;
15273   PyObject *__pyx_t_2 = NULL;
15274   PyObject *__pyx_t_3 = NULL;
15275   PyObject *__pyx_t_4 = NULL;
15276   PyObject *__pyx_t_5 = NULL;
15277   int __pyx_lineno = 0;
15278   const char *__pyx_filename = NULL;
15279   int __pyx_clineno = 0;
15280   __Pyx_RefNannySetupContext("array_cwrapper", 0);
15281 
15282   /* "View.MemoryView":248
15283  *     cdef array result
15284  *
15285  *     if buf == NULL:             # <<<<<<<<<<<<<<
15286  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
15287  *     else:
15288  */
15289   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
15290   if (__pyx_t_1) {
15291 
15292     /* "View.MemoryView":249
15293  *
15294  *     if buf == NULL:
15295  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
15296  *     else:
15297  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
15298  */
15299     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
15300     __Pyx_GOTREF(__pyx_t_2);
15301     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
15302     __Pyx_GOTREF(__pyx_t_3);
15303     __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
15304     __Pyx_GOTREF(__pyx_t_4);
15305     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
15306     __Pyx_GOTREF(__pyx_t_5);
15307     __Pyx_INCREF(__pyx_v_shape);
15308     __Pyx_GIVEREF(__pyx_v_shape);
15309     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
15310     __Pyx_GIVEREF(__pyx_t_2);
15311     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
15312     __Pyx_GIVEREF(__pyx_t_3);
15313     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
15314     __Pyx_GIVEREF(__pyx_t_4);
15315     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
15316     __pyx_t_2 = 0;
15317     __pyx_t_3 = 0;
15318     __pyx_t_4 = 0;
15319     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
15320     __Pyx_GOTREF(__pyx_t_4);
15321     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15322     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
15323     __pyx_t_4 = 0;
15324 
15325     /* "View.MemoryView":248
15326  *     cdef array result
15327  *
15328  *     if buf == NULL:             # <<<<<<<<<<<<<<
15329  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
15330  *     else:
15331  */
15332     goto __pyx_L3;
15333   }
15334 
15335   /* "View.MemoryView":251
15336  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
15337  *     else:
15338  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
15339  *                        allocate_buffer=False)
15340  *         result.data = buf
15341  */
15342   /*else*/ {
15343     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
15344     __Pyx_GOTREF(__pyx_t_4);
15345     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
15346     __Pyx_GOTREF(__pyx_t_5);
15347     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
15348     __Pyx_GOTREF(__pyx_t_3);
15349     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
15350     __Pyx_GOTREF(__pyx_t_2);
15351     __Pyx_INCREF(__pyx_v_shape);
15352     __Pyx_GIVEREF(__pyx_v_shape);
15353     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
15354     __Pyx_GIVEREF(__pyx_t_4);
15355     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
15356     __Pyx_GIVEREF(__pyx_t_5);
15357     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
15358     __Pyx_GIVEREF(__pyx_t_3);
15359     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
15360     __pyx_t_4 = 0;
15361     __pyx_t_5 = 0;
15362     __pyx_t_3 = 0;
15363 
15364     /* "View.MemoryView":252
15365  *     else:
15366  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
15367  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
15368  *         result.data = buf
15369  *
15370  */
15371     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
15372     __Pyx_GOTREF(__pyx_t_3);
15373     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
15374 
15375     /* "View.MemoryView":251
15376  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
15377  *     else:
15378  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
15379  *                        allocate_buffer=False)
15380  *         result.data = buf
15381  */
15382     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
15383     __Pyx_GOTREF(__pyx_t_5);
15384     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15385     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15386     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
15387     __pyx_t_5 = 0;
15388 
15389     /* "View.MemoryView":253
15390  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
15391  *                        allocate_buffer=False)
15392  *         result.data = buf             # <<<<<<<<<<<<<<
15393  *
15394  *     return result
15395  */
15396     __pyx_v_result->data = __pyx_v_buf;
15397   }
15398   __pyx_L3:;
15399 
15400   /* "View.MemoryView":255
15401  *         result.data = buf
15402  *
15403  *     return result             # <<<<<<<<<<<<<<
15404  *
15405  *
15406  */
15407   __Pyx_XDECREF(((PyObject *)__pyx_r));
15408   __Pyx_INCREF(((PyObject *)__pyx_v_result));
15409   __pyx_r = __pyx_v_result;
15410   goto __pyx_L0;
15411 
15412   /* "View.MemoryView":244
15413  *
15414  * @cname("__pyx_array_new")
15415  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
15416  *                           char *mode, char *buf):
15417  *     cdef array result
15418  */
15419 
15420   /* function exit code */
15421   __pyx_L1_error:;
15422   __Pyx_XDECREF(__pyx_t_2);
15423   __Pyx_XDECREF(__pyx_t_3);
15424   __Pyx_XDECREF(__pyx_t_4);
15425   __Pyx_XDECREF(__pyx_t_5);
15426   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15427   __pyx_r = 0;
15428   __pyx_L0:;
15429   __Pyx_XDECREF((PyObject *)__pyx_v_result);
15430   __Pyx_XGIVEREF((PyObject *)__pyx_r);
15431   __Pyx_RefNannyFinishContext();
15432   return __pyx_r;
15433 }
15434 
15435 /* "View.MemoryView":281
15436  * cdef class Enum(object):
15437  *     cdef object name
15438  *     def __init__(self, name):             # <<<<<<<<<<<<<<
15439  *         self.name = name
15440  *     def __repr__(self):
15441  */
15442 
15443 /* Python wrapper */
15444 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_MemviewEnum___init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)15445 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15446   PyObject *__pyx_v_name = 0;
15447   int __pyx_lineno = 0;
15448   const char *__pyx_filename = NULL;
15449   int __pyx_clineno = 0;
15450   int __pyx_r;
15451   __Pyx_RefNannyDeclarations
15452   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
15453   {
15454     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
15455     PyObject* values[1] = {0};
15456     if (unlikely(__pyx_kwds)) {
15457       Py_ssize_t kw_args;
15458       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15459       switch (pos_args) {
15460         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15461         CYTHON_FALLTHROUGH;
15462         case  0: break;
15463         default: goto __pyx_L5_argtuple_error;
15464       }
15465       kw_args = PyDict_Size(__pyx_kwds);
15466       switch (pos_args) {
15467         case  0:
15468         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
15469         else goto __pyx_L5_argtuple_error;
15470       }
15471       if (unlikely(kw_args > 0)) {
15472         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
15473       }
15474     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
15475       goto __pyx_L5_argtuple_error;
15476     } else {
15477       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15478     }
15479     __pyx_v_name = values[0];
15480   }
15481   goto __pyx_L4_argument_unpacking_done;
15482   __pyx_L5_argtuple_error:;
15483   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
15484   __pyx_L3_error:;
15485   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15486   __Pyx_RefNannyFinishContext();
15487   return -1;
15488   __pyx_L4_argument_unpacking_done:;
15489   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
15490 
15491   /* function exit code */
15492   __Pyx_RefNannyFinishContext();
15493   return __pyx_r;
15494 }
15495 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)15496 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
15497   int __pyx_r;
15498   __Pyx_RefNannyDeclarations
15499   __Pyx_RefNannySetupContext("__init__", 0);
15500 
15501   /* "View.MemoryView":282
15502  *     cdef object name
15503  *     def __init__(self, name):
15504  *         self.name = name             # <<<<<<<<<<<<<<
15505  *     def __repr__(self):
15506  *         return self.name
15507  */
15508   __Pyx_INCREF(__pyx_v_name);
15509   __Pyx_GIVEREF(__pyx_v_name);
15510   __Pyx_GOTREF(__pyx_v_self->name);
15511   __Pyx_DECREF(__pyx_v_self->name);
15512   __pyx_v_self->name = __pyx_v_name;
15513 
15514   /* "View.MemoryView":281
15515  * cdef class Enum(object):
15516  *     cdef object name
15517  *     def __init__(self, name):             # <<<<<<<<<<<<<<
15518  *         self.name = name
15519  *     def __repr__(self):
15520  */
15521 
15522   /* function exit code */
15523   __pyx_r = 0;
15524   __Pyx_RefNannyFinishContext();
15525   return __pyx_r;
15526 }
15527 
15528 /* "View.MemoryView":283
15529  *     def __init__(self, name):
15530  *         self.name = name
15531  *     def __repr__(self):             # <<<<<<<<<<<<<<
15532  *         return self.name
15533  *
15534  */
15535 
15536 /* Python wrapper */
15537 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)15538 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
15539   PyObject *__pyx_r = 0;
15540   __Pyx_RefNannyDeclarations
15541   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
15542   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
15543 
15544   /* function exit code */
15545   __Pyx_RefNannyFinishContext();
15546   return __pyx_r;
15547 }
15548 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)15549 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
15550   PyObject *__pyx_r = NULL;
15551   __Pyx_RefNannyDeclarations
15552   __Pyx_RefNannySetupContext("__repr__", 0);
15553 
15554   /* "View.MemoryView":284
15555  *         self.name = name
15556  *     def __repr__(self):
15557  *         return self.name             # <<<<<<<<<<<<<<
15558  *
15559  * cdef generic = Enum("<strided and direct or indirect>")
15560  */
15561   __Pyx_XDECREF(__pyx_r);
15562   __Pyx_INCREF(__pyx_v_self->name);
15563   __pyx_r = __pyx_v_self->name;
15564   goto __pyx_L0;
15565 
15566   /* "View.MemoryView":283
15567  *     def __init__(self, name):
15568  *         self.name = name
15569  *     def __repr__(self):             # <<<<<<<<<<<<<<
15570  *         return self.name
15571  *
15572  */
15573 
15574   /* function exit code */
15575   __pyx_L0:;
15576   __Pyx_XGIVEREF(__pyx_r);
15577   __Pyx_RefNannyFinishContext();
15578   return __pyx_r;
15579 }
15580 
15581 /* "(tree fragment)":1
15582  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15583  *     cdef tuple state
15584  *     cdef object _dict
15585  */
15586 
15587 /* Python wrapper */
15588 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)15589 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15590   PyObject *__pyx_r = 0;
15591   __Pyx_RefNannyDeclarations
15592   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15593   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
15594 
15595   /* function exit code */
15596   __Pyx_RefNannyFinishContext();
15597   return __pyx_r;
15598 }
15599 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)15600 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
15601   PyObject *__pyx_v_state = 0;
15602   PyObject *__pyx_v__dict = 0;
15603   int __pyx_v_use_setstate;
15604   PyObject *__pyx_r = NULL;
15605   __Pyx_RefNannyDeclarations
15606   PyObject *__pyx_t_1 = NULL;
15607   int __pyx_t_2;
15608   int __pyx_t_3;
15609   PyObject *__pyx_t_4 = NULL;
15610   PyObject *__pyx_t_5 = NULL;
15611   int __pyx_lineno = 0;
15612   const char *__pyx_filename = NULL;
15613   int __pyx_clineno = 0;
15614   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15615 
15616   /* "(tree fragment)":5
15617  *     cdef object _dict
15618  *     cdef bint use_setstate
15619  *     state = (self.name,)             # <<<<<<<<<<<<<<
15620  *     _dict = getattr(self, '__dict__', None)
15621  *     if _dict is not None:
15622  */
15623   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
15624   __Pyx_GOTREF(__pyx_t_1);
15625   __Pyx_INCREF(__pyx_v_self->name);
15626   __Pyx_GIVEREF(__pyx_v_self->name);
15627   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
15628   __pyx_v_state = ((PyObject*)__pyx_t_1);
15629   __pyx_t_1 = 0;
15630 
15631   /* "(tree fragment)":6
15632  *     cdef bint use_setstate
15633  *     state = (self.name,)
15634  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
15635  *     if _dict is not None:
15636  *         state += (_dict,)
15637  */
15638   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
15639   __Pyx_GOTREF(__pyx_t_1);
15640   __pyx_v__dict = __pyx_t_1;
15641   __pyx_t_1 = 0;
15642 
15643   /* "(tree fragment)":7
15644  *     state = (self.name,)
15645  *     _dict = getattr(self, '__dict__', None)
15646  *     if _dict is not None:             # <<<<<<<<<<<<<<
15647  *         state += (_dict,)
15648  *         use_setstate = True
15649  */
15650   __pyx_t_2 = (__pyx_v__dict != Py_None);
15651   __pyx_t_3 = (__pyx_t_2 != 0);
15652   if (__pyx_t_3) {
15653 
15654     /* "(tree fragment)":8
15655  *     _dict = getattr(self, '__dict__', None)
15656  *     if _dict is not None:
15657  *         state += (_dict,)             # <<<<<<<<<<<<<<
15658  *         use_setstate = True
15659  *     else:
15660  */
15661     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
15662     __Pyx_GOTREF(__pyx_t_1);
15663     __Pyx_INCREF(__pyx_v__dict);
15664     __Pyx_GIVEREF(__pyx_v__dict);
15665     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
15666     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
15667     __Pyx_GOTREF(__pyx_t_4);
15668     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15669     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
15670     __pyx_t_4 = 0;
15671 
15672     /* "(tree fragment)":9
15673  *     if _dict is not None:
15674  *         state += (_dict,)
15675  *         use_setstate = True             # <<<<<<<<<<<<<<
15676  *     else:
15677  *         use_setstate = self.name is not None
15678  */
15679     __pyx_v_use_setstate = 1;
15680 
15681     /* "(tree fragment)":7
15682  *     state = (self.name,)
15683  *     _dict = getattr(self, '__dict__', None)
15684  *     if _dict is not None:             # <<<<<<<<<<<<<<
15685  *         state += (_dict,)
15686  *         use_setstate = True
15687  */
15688     goto __pyx_L3;
15689   }
15690 
15691   /* "(tree fragment)":11
15692  *         use_setstate = True
15693  *     else:
15694  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
15695  *     if use_setstate:
15696  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
15697  */
15698   /*else*/ {
15699     __pyx_t_3 = (__pyx_v_self->name != Py_None);
15700     __pyx_v_use_setstate = __pyx_t_3;
15701   }
15702   __pyx_L3:;
15703 
15704   /* "(tree fragment)":12
15705  *     else:
15706  *         use_setstate = self.name is not None
15707  *     if use_setstate:             # <<<<<<<<<<<<<<
15708  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
15709  *     else:
15710  */
15711   __pyx_t_3 = (__pyx_v_use_setstate != 0);
15712   if (__pyx_t_3) {
15713 
15714     /* "(tree fragment)":13
15715  *         use_setstate = self.name is not None
15716  *     if use_setstate:
15717  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
15718  *     else:
15719  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
15720  */
15721     __Pyx_XDECREF(__pyx_r);
15722     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
15723     __Pyx_GOTREF(__pyx_t_4);
15724     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
15725     __Pyx_GOTREF(__pyx_t_1);
15726     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15727     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15728     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15729     __Pyx_INCREF(__pyx_int_184977713);
15730     __Pyx_GIVEREF(__pyx_int_184977713);
15731     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
15732     __Pyx_INCREF(Py_None);
15733     __Pyx_GIVEREF(Py_None);
15734     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
15735     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
15736     __Pyx_GOTREF(__pyx_t_5);
15737     __Pyx_GIVEREF(__pyx_t_4);
15738     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
15739     __Pyx_GIVEREF(__pyx_t_1);
15740     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
15741     __Pyx_INCREF(__pyx_v_state);
15742     __Pyx_GIVEREF(__pyx_v_state);
15743     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
15744     __pyx_t_4 = 0;
15745     __pyx_t_1 = 0;
15746     __pyx_r = __pyx_t_5;
15747     __pyx_t_5 = 0;
15748     goto __pyx_L0;
15749 
15750     /* "(tree fragment)":12
15751  *     else:
15752  *         use_setstate = self.name is not None
15753  *     if use_setstate:             # <<<<<<<<<<<<<<
15754  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
15755  *     else:
15756  */
15757   }
15758 
15759   /* "(tree fragment)":15
15760  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
15761  *     else:
15762  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
15763  * def __setstate_cython__(self, __pyx_state):
15764  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
15765  */
15766   /*else*/ {
15767     __Pyx_XDECREF(__pyx_r);
15768     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
15769     __Pyx_GOTREF(__pyx_t_5);
15770     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
15771     __Pyx_GOTREF(__pyx_t_1);
15772     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15773     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15774     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15775     __Pyx_INCREF(__pyx_int_184977713);
15776     __Pyx_GIVEREF(__pyx_int_184977713);
15777     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
15778     __Pyx_INCREF(__pyx_v_state);
15779     __Pyx_GIVEREF(__pyx_v_state);
15780     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
15781     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
15782     __Pyx_GOTREF(__pyx_t_4);
15783     __Pyx_GIVEREF(__pyx_t_5);
15784     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
15785     __Pyx_GIVEREF(__pyx_t_1);
15786     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
15787     __pyx_t_5 = 0;
15788     __pyx_t_1 = 0;
15789     __pyx_r = __pyx_t_4;
15790     __pyx_t_4 = 0;
15791     goto __pyx_L0;
15792   }
15793 
15794   /* "(tree fragment)":1
15795  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15796  *     cdef tuple state
15797  *     cdef object _dict
15798  */
15799 
15800   /* function exit code */
15801   __pyx_L1_error:;
15802   __Pyx_XDECREF(__pyx_t_1);
15803   __Pyx_XDECREF(__pyx_t_4);
15804   __Pyx_XDECREF(__pyx_t_5);
15805   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15806   __pyx_r = NULL;
15807   __pyx_L0:;
15808   __Pyx_XDECREF(__pyx_v_state);
15809   __Pyx_XDECREF(__pyx_v__dict);
15810   __Pyx_XGIVEREF(__pyx_r);
15811   __Pyx_RefNannyFinishContext();
15812   return __pyx_r;
15813 }
15814 
15815 /* "(tree fragment)":16
15816  *     else:
15817  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
15818  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15819  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
15820  */
15821 
15822 /* Python wrapper */
15823 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)15824 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15825   PyObject *__pyx_r = 0;
15826   __Pyx_RefNannyDeclarations
15827   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15828   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15829 
15830   /* function exit code */
15831   __Pyx_RefNannyFinishContext();
15832   return __pyx_r;
15833 }
15834 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)15835 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15836   PyObject *__pyx_r = NULL;
15837   __Pyx_RefNannyDeclarations
15838   PyObject *__pyx_t_1 = NULL;
15839   int __pyx_lineno = 0;
15840   const char *__pyx_filename = NULL;
15841   int __pyx_clineno = 0;
15842   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15843 
15844   /* "(tree fragment)":17
15845  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
15846  * def __setstate_cython__(self, __pyx_state):
15847  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
15848  */
15849   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
15850   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
15851   __Pyx_GOTREF(__pyx_t_1);
15852   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15853 
15854   /* "(tree fragment)":16
15855  *     else:
15856  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
15857  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15858  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
15859  */
15860 
15861   /* function exit code */
15862   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15863   goto __pyx_L0;
15864   __pyx_L1_error:;
15865   __Pyx_XDECREF(__pyx_t_1);
15866   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15867   __pyx_r = NULL;
15868   __pyx_L0:;
15869   __Pyx_XGIVEREF(__pyx_r);
15870   __Pyx_RefNannyFinishContext();
15871   return __pyx_r;
15872 }
15873 
15874 /* "View.MemoryView":298
15875  *
15876  * @cname('__pyx_align_pointer')
15877  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
15878  *     "Align pointer memory on a given boundary"
15879  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
15880  */
15881 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)15882 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
15883   Py_intptr_t __pyx_v_aligned_p;
15884   size_t __pyx_v_offset;
15885   void *__pyx_r;
15886   int __pyx_t_1;
15887 
15888   /* "View.MemoryView":300
15889  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
15890  *     "Align pointer memory on a given boundary"
15891  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
15892  *     cdef size_t offset
15893  *
15894  */
15895   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
15896 
15897   /* "View.MemoryView":304
15898  *
15899  *     with cython.cdivision(True):
15900  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
15901  *
15902  *     if offset > 0:
15903  */
15904   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
15905 
15906   /* "View.MemoryView":306
15907  *         offset = aligned_p % alignment
15908  *
15909  *     if offset > 0:             # <<<<<<<<<<<<<<
15910  *         aligned_p += alignment - offset
15911  *
15912  */
15913   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
15914   if (__pyx_t_1) {
15915 
15916     /* "View.MemoryView":307
15917  *
15918  *     if offset > 0:
15919  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
15920  *
15921  *     return <void *> aligned_p
15922  */
15923     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
15924 
15925     /* "View.MemoryView":306
15926  *         offset = aligned_p % alignment
15927  *
15928  *     if offset > 0:             # <<<<<<<<<<<<<<
15929  *         aligned_p += alignment - offset
15930  *
15931  */
15932   }
15933 
15934   /* "View.MemoryView":309
15935  *         aligned_p += alignment - offset
15936  *
15937  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
15938  *
15939  *
15940  */
15941   __pyx_r = ((void *)__pyx_v_aligned_p);
15942   goto __pyx_L0;
15943 
15944   /* "View.MemoryView":298
15945  *
15946  * @cname('__pyx_align_pointer')
15947  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
15948  *     "Align pointer memory on a given boundary"
15949  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
15950  */
15951 
15952   /* function exit code */
15953   __pyx_L0:;
15954   return __pyx_r;
15955 }
15956 
15957 /* "View.MemoryView":345
15958  *     cdef __Pyx_TypeInfo *typeinfo
15959  *
15960  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
15961  *         self.obj = obj
15962  *         self.flags = flags
15963  */
15964 
15965 /* Python wrapper */
15966 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_memoryview___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)15967 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15968   PyObject *__pyx_v_obj = 0;
15969   int __pyx_v_flags;
15970   int __pyx_v_dtype_is_object;
15971   int __pyx_lineno = 0;
15972   const char *__pyx_filename = NULL;
15973   int __pyx_clineno = 0;
15974   int __pyx_r;
15975   __Pyx_RefNannyDeclarations
15976   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
15977   {
15978     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
15979     PyObject* values[3] = {0,0,0};
15980     if (unlikely(__pyx_kwds)) {
15981       Py_ssize_t kw_args;
15982       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15983       switch (pos_args) {
15984         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15985         CYTHON_FALLTHROUGH;
15986         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15987         CYTHON_FALLTHROUGH;
15988         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15989         CYTHON_FALLTHROUGH;
15990         case  0: break;
15991         default: goto __pyx_L5_argtuple_error;
15992       }
15993       kw_args = PyDict_Size(__pyx_kwds);
15994       switch (pos_args) {
15995         case  0:
15996         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15997         else goto __pyx_L5_argtuple_error;
15998         CYTHON_FALLTHROUGH;
15999         case  1:
16000         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
16001         else {
16002           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
16003         }
16004         CYTHON_FALLTHROUGH;
16005         case  2:
16006         if (kw_args > 0) {
16007           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
16008           if (value) { values[2] = value; kw_args--; }
16009         }
16010       }
16011       if (unlikely(kw_args > 0)) {
16012         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
16013       }
16014     } else {
16015       switch (PyTuple_GET_SIZE(__pyx_args)) {
16016         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16017         CYTHON_FALLTHROUGH;
16018         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16019         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16020         break;
16021         default: goto __pyx_L5_argtuple_error;
16022       }
16023     }
16024     __pyx_v_obj = values[0];
16025     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
16026     if (values[2]) {
16027       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
16028     } else {
16029       __pyx_v_dtype_is_object = ((int)0);
16030     }
16031   }
16032   goto __pyx_L4_argument_unpacking_done;
16033   __pyx_L5_argtuple_error:;
16034   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
16035   __pyx_L3_error:;
16036   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16037   __Pyx_RefNannyFinishContext();
16038   return -1;
16039   __pyx_L4_argument_unpacking_done:;
16040   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
16041 
16042   /* function exit code */
16043   __Pyx_RefNannyFinishContext();
16044   return __pyx_r;
16045 }
16046 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj,int __pyx_v_flags,int __pyx_v_dtype_is_object)16047 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
16048   int __pyx_r;
16049   __Pyx_RefNannyDeclarations
16050   int __pyx_t_1;
16051   int __pyx_t_2;
16052   int __pyx_t_3;
16053   int __pyx_t_4;
16054   int __pyx_lineno = 0;
16055   const char *__pyx_filename = NULL;
16056   int __pyx_clineno = 0;
16057   __Pyx_RefNannySetupContext("__cinit__", 0);
16058 
16059   /* "View.MemoryView":346
16060  *
16061  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
16062  *         self.obj = obj             # <<<<<<<<<<<<<<
16063  *         self.flags = flags
16064  *         if type(self) is memoryview or obj is not None:
16065  */
16066   __Pyx_INCREF(__pyx_v_obj);
16067   __Pyx_GIVEREF(__pyx_v_obj);
16068   __Pyx_GOTREF(__pyx_v_self->obj);
16069   __Pyx_DECREF(__pyx_v_self->obj);
16070   __pyx_v_self->obj = __pyx_v_obj;
16071 
16072   /* "View.MemoryView":347
16073  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
16074  *         self.obj = obj
16075  *         self.flags = flags             # <<<<<<<<<<<<<<
16076  *         if type(self) is memoryview or obj is not None:
16077  *             __Pyx_GetBuffer(obj, &self.view, flags)
16078  */
16079   __pyx_v_self->flags = __pyx_v_flags;
16080 
16081   /* "View.MemoryView":348
16082  *         self.obj = obj
16083  *         self.flags = flags
16084  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
16085  *             __Pyx_GetBuffer(obj, &self.view, flags)
16086  *             if <PyObject *> self.view.obj == NULL:
16087  */
16088   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
16089   __pyx_t_3 = (__pyx_t_2 != 0);
16090   if (!__pyx_t_3) {
16091   } else {
16092     __pyx_t_1 = __pyx_t_3;
16093     goto __pyx_L4_bool_binop_done;
16094   }
16095   __pyx_t_3 = (__pyx_v_obj != Py_None);
16096   __pyx_t_2 = (__pyx_t_3 != 0);
16097   __pyx_t_1 = __pyx_t_2;
16098   __pyx_L4_bool_binop_done:;
16099   if (__pyx_t_1) {
16100 
16101     /* "View.MemoryView":349
16102  *         self.flags = flags
16103  *         if type(self) is memoryview or obj is not None:
16104  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
16105  *             if <PyObject *> self.view.obj == NULL:
16106  *                 (<__pyx_buffer *> &self.view).obj = Py_None
16107  */
16108     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
16109 
16110     /* "View.MemoryView":350
16111  *         if type(self) is memoryview or obj is not None:
16112  *             __Pyx_GetBuffer(obj, &self.view, flags)
16113  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
16114  *                 (<__pyx_buffer *> &self.view).obj = Py_None
16115  *                 Py_INCREF(Py_None)
16116  */
16117     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
16118     if (__pyx_t_1) {
16119 
16120       /* "View.MemoryView":351
16121  *             __Pyx_GetBuffer(obj, &self.view, flags)
16122  *             if <PyObject *> self.view.obj == NULL:
16123  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
16124  *                 Py_INCREF(Py_None)
16125  *
16126  */
16127       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
16128 
16129       /* "View.MemoryView":352
16130  *             if <PyObject *> self.view.obj == NULL:
16131  *                 (<__pyx_buffer *> &self.view).obj = Py_None
16132  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
16133  *
16134  *         global __pyx_memoryview_thread_locks_used
16135  */
16136       Py_INCREF(Py_None);
16137 
16138       /* "View.MemoryView":350
16139  *         if type(self) is memoryview or obj is not None:
16140  *             __Pyx_GetBuffer(obj, &self.view, flags)
16141  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
16142  *                 (<__pyx_buffer *> &self.view).obj = Py_None
16143  *                 Py_INCREF(Py_None)
16144  */
16145     }
16146 
16147     /* "View.MemoryView":348
16148  *         self.obj = obj
16149  *         self.flags = flags
16150  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
16151  *             __Pyx_GetBuffer(obj, &self.view, flags)
16152  *             if <PyObject *> self.view.obj == NULL:
16153  */
16154   }
16155 
16156   /* "View.MemoryView":355
16157  *
16158  *         global __pyx_memoryview_thread_locks_used
16159  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
16160  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
16161  *             __pyx_memoryview_thread_locks_used += 1
16162  */
16163   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
16164   if (__pyx_t_1) {
16165 
16166     /* "View.MemoryView":356
16167  *         global __pyx_memoryview_thread_locks_used
16168  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
16169  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
16170  *             __pyx_memoryview_thread_locks_used += 1
16171  *         if self.lock is NULL:
16172  */
16173     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
16174 
16175     /* "View.MemoryView":357
16176  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
16177  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
16178  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
16179  *         if self.lock is NULL:
16180  *             self.lock = PyThread_allocate_lock()
16181  */
16182     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
16183 
16184     /* "View.MemoryView":355
16185  *
16186  *         global __pyx_memoryview_thread_locks_used
16187  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
16188  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
16189  *             __pyx_memoryview_thread_locks_used += 1
16190  */
16191   }
16192 
16193   /* "View.MemoryView":358
16194  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
16195  *             __pyx_memoryview_thread_locks_used += 1
16196  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
16197  *             self.lock = PyThread_allocate_lock()
16198  *             if self.lock is NULL:
16199  */
16200   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
16201   if (__pyx_t_1) {
16202 
16203     /* "View.MemoryView":359
16204  *             __pyx_memoryview_thread_locks_used += 1
16205  *         if self.lock is NULL:
16206  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
16207  *             if self.lock is NULL:
16208  *                 raise MemoryError
16209  */
16210     __pyx_v_self->lock = PyThread_allocate_lock();
16211 
16212     /* "View.MemoryView":360
16213  *         if self.lock is NULL:
16214  *             self.lock = PyThread_allocate_lock()
16215  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
16216  *                 raise MemoryError
16217  *
16218  */
16219     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
16220     if (unlikely(__pyx_t_1)) {
16221 
16222       /* "View.MemoryView":361
16223  *             self.lock = PyThread_allocate_lock()
16224  *             if self.lock is NULL:
16225  *                 raise MemoryError             # <<<<<<<<<<<<<<
16226  *
16227  *         if flags & PyBUF_FORMAT:
16228  */
16229       PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
16230 
16231       /* "View.MemoryView":360
16232  *         if self.lock is NULL:
16233  *             self.lock = PyThread_allocate_lock()
16234  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
16235  *                 raise MemoryError
16236  *
16237  */
16238     }
16239 
16240     /* "View.MemoryView":358
16241  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
16242  *             __pyx_memoryview_thread_locks_used += 1
16243  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
16244  *             self.lock = PyThread_allocate_lock()
16245  *             if self.lock is NULL:
16246  */
16247   }
16248 
16249   /* "View.MemoryView":363
16250  *                 raise MemoryError
16251  *
16252  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
16253  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
16254  *         else:
16255  */
16256   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
16257   if (__pyx_t_1) {
16258 
16259     /* "View.MemoryView":364
16260  *
16261  *         if flags & PyBUF_FORMAT:
16262  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
16263  *         else:
16264  *             self.dtype_is_object = dtype_is_object
16265  */
16266     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
16267     if (__pyx_t_2) {
16268     } else {
16269       __pyx_t_1 = __pyx_t_2;
16270       goto __pyx_L11_bool_binop_done;
16271     }
16272     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
16273     __pyx_t_1 = __pyx_t_2;
16274     __pyx_L11_bool_binop_done:;
16275     __pyx_v_self->dtype_is_object = __pyx_t_1;
16276 
16277     /* "View.MemoryView":363
16278  *                 raise MemoryError
16279  *
16280  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
16281  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
16282  *         else:
16283  */
16284     goto __pyx_L10;
16285   }
16286 
16287   /* "View.MemoryView":366
16288  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
16289  *         else:
16290  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
16291  *
16292  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
16293  */
16294   /*else*/ {
16295     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
16296   }
16297   __pyx_L10:;
16298 
16299   /* "View.MemoryView":368
16300  *             self.dtype_is_object = dtype_is_object
16301  *
16302  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
16303  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
16304  *         self.typeinfo = NULL
16305  */
16306   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
16307 
16308   /* "View.MemoryView":370
16309  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
16310  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
16311  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
16312  *
16313  *     def __dealloc__(memoryview self):
16314  */
16315   __pyx_v_self->typeinfo = NULL;
16316 
16317   /* "View.MemoryView":345
16318  *     cdef __Pyx_TypeInfo *typeinfo
16319  *
16320  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
16321  *         self.obj = obj
16322  *         self.flags = flags
16323  */
16324 
16325   /* function exit code */
16326   __pyx_r = 0;
16327   goto __pyx_L0;
16328   __pyx_L1_error:;
16329   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16330   __pyx_r = -1;
16331   __pyx_L0:;
16332   __Pyx_RefNannyFinishContext();
16333   return __pyx_r;
16334 }
16335 
16336 /* "View.MemoryView":372
16337  *         self.typeinfo = NULL
16338  *
16339  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
16340  *         if self.obj is not None:
16341  *             __Pyx_ReleaseBuffer(&self.view)
16342  */
16343 
16344 /* Python wrapper */
16345 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)16346 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
16347   __Pyx_RefNannyDeclarations
16348   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16349   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16350 
16351   /* function exit code */
16352   __Pyx_RefNannyFinishContext();
16353 }
16354 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)16355 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
16356   int __pyx_v_i;
16357   __Pyx_RefNannyDeclarations
16358   int __pyx_t_1;
16359   int __pyx_t_2;
16360   int __pyx_t_3;
16361   int __pyx_t_4;
16362   int __pyx_t_5;
16363   PyThread_type_lock __pyx_t_6;
16364   PyThread_type_lock __pyx_t_7;
16365   __Pyx_RefNannySetupContext("__dealloc__", 0);
16366 
16367   /* "View.MemoryView":373
16368  *
16369  *     def __dealloc__(memoryview self):
16370  *         if self.obj is not None:             # <<<<<<<<<<<<<<
16371  *             __Pyx_ReleaseBuffer(&self.view)
16372  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
16373  */
16374   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
16375   __pyx_t_2 = (__pyx_t_1 != 0);
16376   if (__pyx_t_2) {
16377 
16378     /* "View.MemoryView":374
16379  *     def __dealloc__(memoryview self):
16380  *         if self.obj is not None:
16381  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
16382  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
16383  *
16384  */
16385     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
16386 
16387     /* "View.MemoryView":373
16388  *
16389  *     def __dealloc__(memoryview self):
16390  *         if self.obj is not None:             # <<<<<<<<<<<<<<
16391  *             __Pyx_ReleaseBuffer(&self.view)
16392  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
16393  */
16394     goto __pyx_L3;
16395   }
16396 
16397   /* "View.MemoryView":375
16398  *         if self.obj is not None:
16399  *             __Pyx_ReleaseBuffer(&self.view)
16400  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
16401  *
16402  *             (<__pyx_buffer *> &self.view).obj = NULL
16403  */
16404   __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
16405   if (__pyx_t_2) {
16406 
16407     /* "View.MemoryView":377
16408  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
16409  *
16410  *             (<__pyx_buffer *> &self.view).obj = NULL             # <<<<<<<<<<<<<<
16411  *             Py_DECREF(Py_None)
16412  *
16413  */
16414     ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
16415 
16416     /* "View.MemoryView":378
16417  *
16418  *             (<__pyx_buffer *> &self.view).obj = NULL
16419  *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
16420  *
16421  *         cdef int i
16422  */
16423     Py_DECREF(Py_None);
16424 
16425     /* "View.MemoryView":375
16426  *         if self.obj is not None:
16427  *             __Pyx_ReleaseBuffer(&self.view)
16428  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
16429  *
16430  *             (<__pyx_buffer *> &self.view).obj = NULL
16431  */
16432   }
16433   __pyx_L3:;
16434 
16435   /* "View.MemoryView":382
16436  *         cdef int i
16437  *         global __pyx_memoryview_thread_locks_used
16438  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
16439  *             for i in range(__pyx_memoryview_thread_locks_used):
16440  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
16441  */
16442   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
16443   if (__pyx_t_2) {
16444 
16445     /* "View.MemoryView":383
16446  *         global __pyx_memoryview_thread_locks_used
16447  *         if self.lock != NULL:
16448  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
16449  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
16450  *                     __pyx_memoryview_thread_locks_used -= 1
16451  */
16452     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
16453     __pyx_t_4 = __pyx_t_3;
16454     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16455       __pyx_v_i = __pyx_t_5;
16456 
16457       /* "View.MemoryView":384
16458  *         if self.lock != NULL:
16459  *             for i in range(__pyx_memoryview_thread_locks_used):
16460  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
16461  *                     __pyx_memoryview_thread_locks_used -= 1
16462  *                     if i != __pyx_memoryview_thread_locks_used:
16463  */
16464       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
16465       if (__pyx_t_2) {
16466 
16467         /* "View.MemoryView":385
16468  *             for i in range(__pyx_memoryview_thread_locks_used):
16469  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
16470  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
16471  *                     if i != __pyx_memoryview_thread_locks_used:
16472  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
16473  */
16474         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
16475 
16476         /* "View.MemoryView":386
16477  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
16478  *                     __pyx_memoryview_thread_locks_used -= 1
16479  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
16480  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
16481  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
16482  */
16483         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
16484         if (__pyx_t_2) {
16485 
16486           /* "View.MemoryView":388
16487  *                     if i != __pyx_memoryview_thread_locks_used:
16488  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
16489  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
16490  *                     break
16491  *             else:
16492  */
16493           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
16494           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
16495 
16496           /* "View.MemoryView":387
16497  *                     __pyx_memoryview_thread_locks_used -= 1
16498  *                     if i != __pyx_memoryview_thread_locks_used:
16499  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
16500  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
16501  *                     break
16502  */
16503           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
16504           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
16505 
16506           /* "View.MemoryView":386
16507  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
16508  *                     __pyx_memoryview_thread_locks_used -= 1
16509  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
16510  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
16511  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
16512  */
16513         }
16514 
16515         /* "View.MemoryView":389
16516  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
16517  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
16518  *                     break             # <<<<<<<<<<<<<<
16519  *             else:
16520  *                 PyThread_free_lock(self.lock)
16521  */
16522         goto __pyx_L6_break;
16523 
16524         /* "View.MemoryView":384
16525  *         if self.lock != NULL:
16526  *             for i in range(__pyx_memoryview_thread_locks_used):
16527  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
16528  *                     __pyx_memoryview_thread_locks_used -= 1
16529  *                     if i != __pyx_memoryview_thread_locks_used:
16530  */
16531       }
16532     }
16533     /*else*/ {
16534 
16535       /* "View.MemoryView":391
16536  *                     break
16537  *             else:
16538  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
16539  *
16540  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
16541  */
16542       PyThread_free_lock(__pyx_v_self->lock);
16543     }
16544     __pyx_L6_break:;
16545 
16546     /* "View.MemoryView":382
16547  *         cdef int i
16548  *         global __pyx_memoryview_thread_locks_used
16549  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
16550  *             for i in range(__pyx_memoryview_thread_locks_used):
16551  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
16552  */
16553   }
16554 
16555   /* "View.MemoryView":372
16556  *         self.typeinfo = NULL
16557  *
16558  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
16559  *         if self.obj is not None:
16560  *             __Pyx_ReleaseBuffer(&self.view)
16561  */
16562 
16563   /* function exit code */
16564   __Pyx_RefNannyFinishContext();
16565 }
16566 
16567 /* "View.MemoryView":393
16568  *                 PyThread_free_lock(self.lock)
16569  *
16570  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
16571  *         cdef Py_ssize_t dim
16572  *         cdef char *itemp = <char *> self.view.buf
16573  */
16574 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)16575 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
16576   Py_ssize_t __pyx_v_dim;
16577   char *__pyx_v_itemp;
16578   PyObject *__pyx_v_idx = NULL;
16579   char *__pyx_r;
16580   __Pyx_RefNannyDeclarations
16581   Py_ssize_t __pyx_t_1;
16582   PyObject *__pyx_t_2 = NULL;
16583   Py_ssize_t __pyx_t_3;
16584   PyObject *(*__pyx_t_4)(PyObject *);
16585   PyObject *__pyx_t_5 = NULL;
16586   Py_ssize_t __pyx_t_6;
16587   char *__pyx_t_7;
16588   int __pyx_lineno = 0;
16589   const char *__pyx_filename = NULL;
16590   int __pyx_clineno = 0;
16591   __Pyx_RefNannySetupContext("get_item_pointer", 0);
16592 
16593   /* "View.MemoryView":395
16594  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
16595  *         cdef Py_ssize_t dim
16596  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
16597  *
16598  *         for dim, idx in enumerate(index):
16599  */
16600   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
16601 
16602   /* "View.MemoryView":397
16603  *         cdef char *itemp = <char *> self.view.buf
16604  *
16605  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
16606  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
16607  *
16608  */
16609   __pyx_t_1 = 0;
16610   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
16611     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
16612     __pyx_t_4 = NULL;
16613   } else {
16614     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
16615     __Pyx_GOTREF(__pyx_t_2);
16616     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
16617   }
16618   for (;;) {
16619     if (likely(!__pyx_t_4)) {
16620       if (likely(PyList_CheckExact(__pyx_t_2))) {
16621         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
16622         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16623         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
16624         #else
16625         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
16626         __Pyx_GOTREF(__pyx_t_5);
16627         #endif
16628       } else {
16629         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
16630         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16631         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
16632         #else
16633         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
16634         __Pyx_GOTREF(__pyx_t_5);
16635         #endif
16636       }
16637     } else {
16638       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
16639       if (unlikely(!__pyx_t_5)) {
16640         PyObject* exc_type = PyErr_Occurred();
16641         if (exc_type) {
16642           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16643           else __PYX_ERR(2, 397, __pyx_L1_error)
16644         }
16645         break;
16646       }
16647       __Pyx_GOTREF(__pyx_t_5);
16648     }
16649     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
16650     __pyx_t_5 = 0;
16651     __pyx_v_dim = __pyx_t_1;
16652     __pyx_t_1 = (__pyx_t_1 + 1);
16653 
16654     /* "View.MemoryView":398
16655  *
16656  *         for dim, idx in enumerate(index):
16657  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
16658  *
16659  *         return itemp
16660  */
16661     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
16662     __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error)
16663     __pyx_v_itemp = __pyx_t_7;
16664 
16665     /* "View.MemoryView":397
16666  *         cdef char *itemp = <char *> self.view.buf
16667  *
16668  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
16669  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
16670  *
16671  */
16672   }
16673   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16674 
16675   /* "View.MemoryView":400
16676  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
16677  *
16678  *         return itemp             # <<<<<<<<<<<<<<
16679  *
16680  *
16681  */
16682   __pyx_r = __pyx_v_itemp;
16683   goto __pyx_L0;
16684 
16685   /* "View.MemoryView":393
16686  *                 PyThread_free_lock(self.lock)
16687  *
16688  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
16689  *         cdef Py_ssize_t dim
16690  *         cdef char *itemp = <char *> self.view.buf
16691  */
16692 
16693   /* function exit code */
16694   __pyx_L1_error:;
16695   __Pyx_XDECREF(__pyx_t_2);
16696   __Pyx_XDECREF(__pyx_t_5);
16697   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
16698   __pyx_r = NULL;
16699   __pyx_L0:;
16700   __Pyx_XDECREF(__pyx_v_idx);
16701   __Pyx_RefNannyFinishContext();
16702   return __pyx_r;
16703 }
16704 
16705 /* "View.MemoryView":403
16706  *
16707  *
16708  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
16709  *         if index is Ellipsis:
16710  *             return self
16711  */
16712 
16713 /* Python wrapper */
16714 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
__pyx_memoryview___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index)16715 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
16716   PyObject *__pyx_r = 0;
16717   __Pyx_RefNannyDeclarations
16718   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
16719   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
16720 
16721   /* function exit code */
16722   __Pyx_RefNannyFinishContext();
16723   return __pyx_r;
16724 }
16725 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)16726 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
16727   PyObject *__pyx_v_have_slices = NULL;
16728   PyObject *__pyx_v_indices = NULL;
16729   char *__pyx_v_itemp;
16730   PyObject *__pyx_r = NULL;
16731   __Pyx_RefNannyDeclarations
16732   int __pyx_t_1;
16733   int __pyx_t_2;
16734   PyObject *__pyx_t_3 = NULL;
16735   PyObject *__pyx_t_4 = NULL;
16736   PyObject *__pyx_t_5 = NULL;
16737   char *__pyx_t_6;
16738   int __pyx_lineno = 0;
16739   const char *__pyx_filename = NULL;
16740   int __pyx_clineno = 0;
16741   __Pyx_RefNannySetupContext("__getitem__", 0);
16742 
16743   /* "View.MemoryView":404
16744  *
16745  *     def __getitem__(memoryview self, object index):
16746  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
16747  *             return self
16748  *
16749  */
16750   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
16751   __pyx_t_2 = (__pyx_t_1 != 0);
16752   if (__pyx_t_2) {
16753 
16754     /* "View.MemoryView":405
16755  *     def __getitem__(memoryview self, object index):
16756  *         if index is Ellipsis:
16757  *             return self             # <<<<<<<<<<<<<<
16758  *
16759  *         have_slices, indices = _unellipsify(index, self.view.ndim)
16760  */
16761     __Pyx_XDECREF(__pyx_r);
16762     __Pyx_INCREF(((PyObject *)__pyx_v_self));
16763     __pyx_r = ((PyObject *)__pyx_v_self);
16764     goto __pyx_L0;
16765 
16766     /* "View.MemoryView":404
16767  *
16768  *     def __getitem__(memoryview self, object index):
16769  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
16770  *             return self
16771  *
16772  */
16773   }
16774 
16775   /* "View.MemoryView":407
16776  *             return self
16777  *
16778  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
16779  *
16780  *         cdef char *itemp
16781  */
16782   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
16783   __Pyx_GOTREF(__pyx_t_3);
16784   if (likely(__pyx_t_3 != Py_None)) {
16785     PyObject* sequence = __pyx_t_3;
16786     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16787     if (unlikely(size != 2)) {
16788       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
16789       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16790       __PYX_ERR(2, 407, __pyx_L1_error)
16791     }
16792     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16793     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
16794     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
16795     __Pyx_INCREF(__pyx_t_4);
16796     __Pyx_INCREF(__pyx_t_5);
16797     #else
16798     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
16799     __Pyx_GOTREF(__pyx_t_4);
16800     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
16801     __Pyx_GOTREF(__pyx_t_5);
16802     #endif
16803     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16804   } else {
16805     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
16806   }
16807   __pyx_v_have_slices = __pyx_t_4;
16808   __pyx_t_4 = 0;
16809   __pyx_v_indices = __pyx_t_5;
16810   __pyx_t_5 = 0;
16811 
16812   /* "View.MemoryView":410
16813  *
16814  *         cdef char *itemp
16815  *         if have_slices:             # <<<<<<<<<<<<<<
16816  *             return memview_slice(self, indices)
16817  *         else:
16818  */
16819   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
16820   if (__pyx_t_2) {
16821 
16822     /* "View.MemoryView":411
16823  *         cdef char *itemp
16824  *         if have_slices:
16825  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
16826  *         else:
16827  *             itemp = self.get_item_pointer(indices)
16828  */
16829     __Pyx_XDECREF(__pyx_r);
16830     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
16831     __Pyx_GOTREF(__pyx_t_3);
16832     __pyx_r = __pyx_t_3;
16833     __pyx_t_3 = 0;
16834     goto __pyx_L0;
16835 
16836     /* "View.MemoryView":410
16837  *
16838  *         cdef char *itemp
16839  *         if have_slices:             # <<<<<<<<<<<<<<
16840  *             return memview_slice(self, indices)
16841  *         else:
16842  */
16843   }
16844 
16845   /* "View.MemoryView":413
16846  *             return memview_slice(self, indices)
16847  *         else:
16848  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
16849  *             return self.convert_item_to_object(itemp)
16850  *
16851  */
16852   /*else*/ {
16853     __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error)
16854     __pyx_v_itemp = __pyx_t_6;
16855 
16856     /* "View.MemoryView":414
16857  *         else:
16858  *             itemp = self.get_item_pointer(indices)
16859  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
16860  *
16861  *     def __setitem__(memoryview self, object index, object value):
16862  */
16863     __Pyx_XDECREF(__pyx_r);
16864     __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error)
16865     __Pyx_GOTREF(__pyx_t_3);
16866     __pyx_r = __pyx_t_3;
16867     __pyx_t_3 = 0;
16868     goto __pyx_L0;
16869   }
16870 
16871   /* "View.MemoryView":403
16872  *
16873  *
16874  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
16875  *         if index is Ellipsis:
16876  *             return self
16877  */
16878 
16879   /* function exit code */
16880   __pyx_L1_error:;
16881   __Pyx_XDECREF(__pyx_t_3);
16882   __Pyx_XDECREF(__pyx_t_4);
16883   __Pyx_XDECREF(__pyx_t_5);
16884   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16885   __pyx_r = NULL;
16886   __pyx_L0:;
16887   __Pyx_XDECREF(__pyx_v_have_slices);
16888   __Pyx_XDECREF(__pyx_v_indices);
16889   __Pyx_XGIVEREF(__pyx_r);
16890   __Pyx_RefNannyFinishContext();
16891   return __pyx_r;
16892 }
16893 
16894 /* "View.MemoryView":416
16895  *             return self.convert_item_to_object(itemp)
16896  *
16897  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
16898  *         if self.view.readonly:
16899  *             raise TypeError("Cannot assign to read-only memoryview")
16900  */
16901 
16902 /* Python wrapper */
16903 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
__pyx_memoryview___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)16904 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
16905   int __pyx_r;
16906   __Pyx_RefNannyDeclarations
16907   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
16908   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
16909 
16910   /* function exit code */
16911   __Pyx_RefNannyFinishContext();
16912   return __pyx_r;
16913 }
16914 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)16915 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
16916   PyObject *__pyx_v_have_slices = NULL;
16917   PyObject *__pyx_v_obj = NULL;
16918   int __pyx_r;
16919   __Pyx_RefNannyDeclarations
16920   int __pyx_t_1;
16921   PyObject *__pyx_t_2 = NULL;
16922   PyObject *__pyx_t_3 = NULL;
16923   PyObject *__pyx_t_4 = NULL;
16924   int __pyx_lineno = 0;
16925   const char *__pyx_filename = NULL;
16926   int __pyx_clineno = 0;
16927   __Pyx_RefNannySetupContext("__setitem__", 0);
16928   __Pyx_INCREF(__pyx_v_index);
16929 
16930   /* "View.MemoryView":417
16931  *
16932  *     def __setitem__(memoryview self, object index, object value):
16933  *         if self.view.readonly:             # <<<<<<<<<<<<<<
16934  *             raise TypeError("Cannot assign to read-only memoryview")
16935  *
16936  */
16937   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
16938   if (unlikely(__pyx_t_1)) {
16939 
16940     /* "View.MemoryView":418
16941  *     def __setitem__(memoryview self, object index, object value):
16942  *         if self.view.readonly:
16943  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
16944  *
16945  *         have_slices, index = _unellipsify(index, self.view.ndim)
16946  */
16947     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
16948     __Pyx_GOTREF(__pyx_t_2);
16949     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
16950     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16951     __PYX_ERR(2, 418, __pyx_L1_error)
16952 
16953     /* "View.MemoryView":417
16954  *
16955  *     def __setitem__(memoryview self, object index, object value):
16956  *         if self.view.readonly:             # <<<<<<<<<<<<<<
16957  *             raise TypeError("Cannot assign to read-only memoryview")
16958  *
16959  */
16960   }
16961 
16962   /* "View.MemoryView":420
16963  *             raise TypeError("Cannot assign to read-only memoryview")
16964  *
16965  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
16966  *
16967  *         if have_slices:
16968  */
16969   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
16970   __Pyx_GOTREF(__pyx_t_2);
16971   if (likely(__pyx_t_2 != Py_None)) {
16972     PyObject* sequence = __pyx_t_2;
16973     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16974     if (unlikely(size != 2)) {
16975       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
16976       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16977       __PYX_ERR(2, 420, __pyx_L1_error)
16978     }
16979     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16980     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
16981     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
16982     __Pyx_INCREF(__pyx_t_3);
16983     __Pyx_INCREF(__pyx_t_4);
16984     #else
16985     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
16986     __Pyx_GOTREF(__pyx_t_3);
16987     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
16988     __Pyx_GOTREF(__pyx_t_4);
16989     #endif
16990     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16991   } else {
16992     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
16993   }
16994   __pyx_v_have_slices = __pyx_t_3;
16995   __pyx_t_3 = 0;
16996   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
16997   __pyx_t_4 = 0;
16998 
16999   /* "View.MemoryView":422
17000  *         have_slices, index = _unellipsify(index, self.view.ndim)
17001  *
17002  *         if have_slices:             # <<<<<<<<<<<<<<
17003  *             obj = self.is_slice(value)
17004  *             if obj:
17005  */
17006   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
17007   if (__pyx_t_1) {
17008 
17009     /* "View.MemoryView":423
17010  *
17011  *         if have_slices:
17012  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
17013  *             if obj:
17014  *                 self.setitem_slice_assignment(self[index], obj)
17015  */
17016     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error)
17017     __Pyx_GOTREF(__pyx_t_2);
17018     __pyx_v_obj = __pyx_t_2;
17019     __pyx_t_2 = 0;
17020 
17021     /* "View.MemoryView":424
17022  *         if have_slices:
17023  *             obj = self.is_slice(value)
17024  *             if obj:             # <<<<<<<<<<<<<<
17025  *                 self.setitem_slice_assignment(self[index], obj)
17026  *             else:
17027  */
17028     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
17029     if (__pyx_t_1) {
17030 
17031       /* "View.MemoryView":425
17032  *             obj = self.is_slice(value)
17033  *             if obj:
17034  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
17035  *             else:
17036  *                 self.setitem_slice_assign_scalar(self[index], value)
17037  */
17038       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
17039       __Pyx_GOTREF(__pyx_t_2);
17040       __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error)
17041       __Pyx_GOTREF(__pyx_t_4);
17042       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17043       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17044 
17045       /* "View.MemoryView":424
17046  *         if have_slices:
17047  *             obj = self.is_slice(value)
17048  *             if obj:             # <<<<<<<<<<<<<<
17049  *                 self.setitem_slice_assignment(self[index], obj)
17050  *             else:
17051  */
17052       goto __pyx_L5;
17053     }
17054 
17055     /* "View.MemoryView":427
17056  *                 self.setitem_slice_assignment(self[index], obj)
17057  *             else:
17058  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
17059  *         else:
17060  *             self.setitem_indexed(index, value)
17061  */
17062     /*else*/ {
17063       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
17064       __Pyx_GOTREF(__pyx_t_4);
17065       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
17066       __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
17067       __Pyx_GOTREF(__pyx_t_2);
17068       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17069       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17070     }
17071     __pyx_L5:;
17072 
17073     /* "View.MemoryView":422
17074  *         have_slices, index = _unellipsify(index, self.view.ndim)
17075  *
17076  *         if have_slices:             # <<<<<<<<<<<<<<
17077  *             obj = self.is_slice(value)
17078  *             if obj:
17079  */
17080     goto __pyx_L4;
17081   }
17082 
17083   /* "View.MemoryView":429
17084  *                 self.setitem_slice_assign_scalar(self[index], value)
17085  *         else:
17086  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
17087  *
17088  *     cdef is_slice(self, obj):
17089  */
17090   /*else*/ {
17091     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
17092     __Pyx_GOTREF(__pyx_t_2);
17093     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17094   }
17095   __pyx_L4:;
17096 
17097   /* "View.MemoryView":416
17098  *             return self.convert_item_to_object(itemp)
17099  *
17100  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
17101  *         if self.view.readonly:
17102  *             raise TypeError("Cannot assign to read-only memoryview")
17103  */
17104 
17105   /* function exit code */
17106   __pyx_r = 0;
17107   goto __pyx_L0;
17108   __pyx_L1_error:;
17109   __Pyx_XDECREF(__pyx_t_2);
17110   __Pyx_XDECREF(__pyx_t_3);
17111   __Pyx_XDECREF(__pyx_t_4);
17112   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17113   __pyx_r = -1;
17114   __pyx_L0:;
17115   __Pyx_XDECREF(__pyx_v_have_slices);
17116   __Pyx_XDECREF(__pyx_v_obj);
17117   __Pyx_XDECREF(__pyx_v_index);
17118   __Pyx_RefNannyFinishContext();
17119   return __pyx_r;
17120 }
17121 
17122 /* "View.MemoryView":431
17123  *             self.setitem_indexed(index, value)
17124  *
17125  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
17126  *         if not isinstance(obj, memoryview):
17127  *             try:
17128  */
17129 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)17130 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
17131   PyObject *__pyx_r = NULL;
17132   __Pyx_RefNannyDeclarations
17133   int __pyx_t_1;
17134   int __pyx_t_2;
17135   PyObject *__pyx_t_3 = NULL;
17136   PyObject *__pyx_t_4 = NULL;
17137   PyObject *__pyx_t_5 = NULL;
17138   PyObject *__pyx_t_6 = NULL;
17139   PyObject *__pyx_t_7 = NULL;
17140   PyObject *__pyx_t_8 = NULL;
17141   int __pyx_t_9;
17142   int __pyx_lineno = 0;
17143   const char *__pyx_filename = NULL;
17144   int __pyx_clineno = 0;
17145   __Pyx_RefNannySetupContext("is_slice", 0);
17146   __Pyx_INCREF(__pyx_v_obj);
17147 
17148   /* "View.MemoryView":432
17149  *
17150  *     cdef is_slice(self, obj):
17151  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
17152  *             try:
17153  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
17154  */
17155   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
17156   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
17157   if (__pyx_t_2) {
17158 
17159     /* "View.MemoryView":433
17160  *     cdef is_slice(self, obj):
17161  *         if not isinstance(obj, memoryview):
17162  *             try:             # <<<<<<<<<<<<<<
17163  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
17164  *                                  self.dtype_is_object)
17165  */
17166     {
17167       __Pyx_PyThreadState_declare
17168       __Pyx_PyThreadState_assign
17169       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
17170       __Pyx_XGOTREF(__pyx_t_3);
17171       __Pyx_XGOTREF(__pyx_t_4);
17172       __Pyx_XGOTREF(__pyx_t_5);
17173       /*try:*/ {
17174 
17175         /* "View.MemoryView":434
17176  *         if not isinstance(obj, memoryview):
17177  *             try:
17178  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
17179  *                                  self.dtype_is_object)
17180  *             except TypeError:
17181  */
17182         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
17183         __Pyx_GOTREF(__pyx_t_6);
17184 
17185         /* "View.MemoryView":435
17186  *             try:
17187  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
17188  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
17189  *             except TypeError:
17190  *                 return None
17191  */
17192         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
17193         __Pyx_GOTREF(__pyx_t_7);
17194 
17195         /* "View.MemoryView":434
17196  *         if not isinstance(obj, memoryview):
17197  *             try:
17198  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
17199  *                                  self.dtype_is_object)
17200  *             except TypeError:
17201  */
17202         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
17203         __Pyx_GOTREF(__pyx_t_8);
17204         __Pyx_INCREF(__pyx_v_obj);
17205         __Pyx_GIVEREF(__pyx_v_obj);
17206         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
17207         __Pyx_GIVEREF(__pyx_t_6);
17208         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
17209         __Pyx_GIVEREF(__pyx_t_7);
17210         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
17211         __pyx_t_6 = 0;
17212         __pyx_t_7 = 0;
17213         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
17214         __Pyx_GOTREF(__pyx_t_7);
17215         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17216         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
17217         __pyx_t_7 = 0;
17218 
17219         /* "View.MemoryView":433
17220  *     cdef is_slice(self, obj):
17221  *         if not isinstance(obj, memoryview):
17222  *             try:             # <<<<<<<<<<<<<<
17223  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
17224  *                                  self.dtype_is_object)
17225  */
17226       }
17227       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17228       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17229       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17230       goto __pyx_L9_try_end;
17231       __pyx_L4_error:;
17232       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17233       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17234       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
17235 
17236       /* "View.MemoryView":436
17237  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
17238  *                                  self.dtype_is_object)
17239  *             except TypeError:             # <<<<<<<<<<<<<<
17240  *                 return None
17241  *
17242  */
17243       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
17244       if (__pyx_t_9) {
17245         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17246         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
17247         __Pyx_GOTREF(__pyx_t_7);
17248         __Pyx_GOTREF(__pyx_t_8);
17249         __Pyx_GOTREF(__pyx_t_6);
17250 
17251         /* "View.MemoryView":437
17252  *                                  self.dtype_is_object)
17253  *             except TypeError:
17254  *                 return None             # <<<<<<<<<<<<<<
17255  *
17256  *         return obj
17257  */
17258         __Pyx_XDECREF(__pyx_r);
17259         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17260         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17261         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17262         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17263         goto __pyx_L7_except_return;
17264       }
17265       goto __pyx_L6_except_error;
17266       __pyx_L6_except_error:;
17267 
17268       /* "View.MemoryView":433
17269  *     cdef is_slice(self, obj):
17270  *         if not isinstance(obj, memoryview):
17271  *             try:             # <<<<<<<<<<<<<<
17272  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
17273  *                                  self.dtype_is_object)
17274  */
17275       __Pyx_XGIVEREF(__pyx_t_3);
17276       __Pyx_XGIVEREF(__pyx_t_4);
17277       __Pyx_XGIVEREF(__pyx_t_5);
17278       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
17279       goto __pyx_L1_error;
17280       __pyx_L7_except_return:;
17281       __Pyx_XGIVEREF(__pyx_t_3);
17282       __Pyx_XGIVEREF(__pyx_t_4);
17283       __Pyx_XGIVEREF(__pyx_t_5);
17284       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
17285       goto __pyx_L0;
17286       __pyx_L9_try_end:;
17287     }
17288 
17289     /* "View.MemoryView":432
17290  *
17291  *     cdef is_slice(self, obj):
17292  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
17293  *             try:
17294  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
17295  */
17296   }
17297 
17298   /* "View.MemoryView":439
17299  *                 return None
17300  *
17301  *         return obj             # <<<<<<<<<<<<<<
17302  *
17303  *     cdef setitem_slice_assignment(self, dst, src):
17304  */
17305   __Pyx_XDECREF(__pyx_r);
17306   __Pyx_INCREF(__pyx_v_obj);
17307   __pyx_r = __pyx_v_obj;
17308   goto __pyx_L0;
17309 
17310   /* "View.MemoryView":431
17311  *             self.setitem_indexed(index, value)
17312  *
17313  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
17314  *         if not isinstance(obj, memoryview):
17315  *             try:
17316  */
17317 
17318   /* function exit code */
17319   __pyx_L1_error:;
17320   __Pyx_XDECREF(__pyx_t_6);
17321   __Pyx_XDECREF(__pyx_t_7);
17322   __Pyx_XDECREF(__pyx_t_8);
17323   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17324   __pyx_r = 0;
17325   __pyx_L0:;
17326   __Pyx_XDECREF(__pyx_v_obj);
17327   __Pyx_XGIVEREF(__pyx_r);
17328   __Pyx_RefNannyFinishContext();
17329   return __pyx_r;
17330 }
17331 
17332 /* "View.MemoryView":441
17333  *         return obj
17334  *
17335  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
17336  *         cdef __Pyx_memviewslice dst_slice
17337  *         cdef __Pyx_memviewslice src_slice
17338  */
17339 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)17340 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
17341   __Pyx_memviewslice __pyx_v_dst_slice;
17342   __Pyx_memviewslice __pyx_v_src_slice;
17343   PyObject *__pyx_r = NULL;
17344   __Pyx_RefNannyDeclarations
17345   __Pyx_memviewslice *__pyx_t_1;
17346   __Pyx_memviewslice *__pyx_t_2;
17347   PyObject *__pyx_t_3 = NULL;
17348   int __pyx_t_4;
17349   int __pyx_t_5;
17350   int __pyx_t_6;
17351   int __pyx_lineno = 0;
17352   const char *__pyx_filename = NULL;
17353   int __pyx_clineno = 0;
17354   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
17355 
17356   /* "View.MemoryView":445
17357  *         cdef __Pyx_memviewslice src_slice
17358  *
17359  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
17360  *                                  get_slice_from_memview(dst, &dst_slice)[0],
17361  *                                  src.ndim, dst.ndim, self.dtype_is_object)
17362  */
17363   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
17364   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error)
17365 
17366   /* "View.MemoryView":446
17367  *
17368  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
17369  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
17370  *                                  src.ndim, dst.ndim, self.dtype_is_object)
17371  *
17372  */
17373   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
17374   __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error)
17375 
17376   /* "View.MemoryView":447
17377  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
17378  *                                  get_slice_from_memview(dst, &dst_slice)[0],
17379  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
17380  *
17381  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
17382  */
17383   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
17384   __Pyx_GOTREF(__pyx_t_3);
17385   __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
17386   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17387   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
17388   __Pyx_GOTREF(__pyx_t_3);
17389   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
17390   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17391 
17392   /* "View.MemoryView":445
17393  *         cdef __Pyx_memviewslice src_slice
17394  *
17395  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
17396  *                                  get_slice_from_memview(dst, &dst_slice)[0],
17397  *                                  src.ndim, dst.ndim, self.dtype_is_object)
17398  */
17399   __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error)
17400 
17401   /* "View.MemoryView":441
17402  *         return obj
17403  *
17404  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
17405  *         cdef __Pyx_memviewslice dst_slice
17406  *         cdef __Pyx_memviewslice src_slice
17407  */
17408 
17409   /* function exit code */
17410   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17411   goto __pyx_L0;
17412   __pyx_L1_error:;
17413   __Pyx_XDECREF(__pyx_t_3);
17414   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
17415   __pyx_r = 0;
17416   __pyx_L0:;
17417   __Pyx_XGIVEREF(__pyx_r);
17418   __Pyx_RefNannyFinishContext();
17419   return __pyx_r;
17420 }
17421 
17422 /* "View.MemoryView":449
17423  *                                  src.ndim, dst.ndim, self.dtype_is_object)
17424  *
17425  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
17426  *         cdef int array[128]
17427  *         cdef void *tmp = NULL
17428  */
17429 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)17430 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
17431   int __pyx_v_array[0x80];
17432   void *__pyx_v_tmp;
17433   void *__pyx_v_item;
17434   __Pyx_memviewslice *__pyx_v_dst_slice;
17435   __Pyx_memviewslice __pyx_v_tmp_slice;
17436   PyObject *__pyx_r = NULL;
17437   __Pyx_RefNannyDeclarations
17438   __Pyx_memviewslice *__pyx_t_1;
17439   int __pyx_t_2;
17440   PyObject *__pyx_t_3 = NULL;
17441   int __pyx_t_4;
17442   int __pyx_t_5;
17443   char const *__pyx_t_6;
17444   PyObject *__pyx_t_7 = NULL;
17445   PyObject *__pyx_t_8 = NULL;
17446   PyObject *__pyx_t_9 = NULL;
17447   PyObject *__pyx_t_10 = NULL;
17448   PyObject *__pyx_t_11 = NULL;
17449   PyObject *__pyx_t_12 = NULL;
17450   int __pyx_lineno = 0;
17451   const char *__pyx_filename = NULL;
17452   int __pyx_clineno = 0;
17453   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
17454 
17455   /* "View.MemoryView":451
17456  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
17457  *         cdef int array[128]
17458  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
17459  *         cdef void *item
17460  *
17461  */
17462   __pyx_v_tmp = NULL;
17463 
17464   /* "View.MemoryView":456
17465  *         cdef __Pyx_memviewslice *dst_slice
17466  *         cdef __Pyx_memviewslice tmp_slice
17467  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
17468  *
17469  *         if <size_t>self.view.itemsize > sizeof(array):
17470  */
17471   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error)
17472   __pyx_v_dst_slice = __pyx_t_1;
17473 
17474   /* "View.MemoryView":458
17475  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
17476  *
17477  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
17478  *             tmp = PyMem_Malloc(self.view.itemsize)
17479  *             if tmp == NULL:
17480  */
17481   __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
17482   if (__pyx_t_2) {
17483 
17484     /* "View.MemoryView":459
17485  *
17486  *         if <size_t>self.view.itemsize > sizeof(array):
17487  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
17488  *             if tmp == NULL:
17489  *                 raise MemoryError
17490  */
17491     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
17492 
17493     /* "View.MemoryView":460
17494  *         if <size_t>self.view.itemsize > sizeof(array):
17495  *             tmp = PyMem_Malloc(self.view.itemsize)
17496  *             if tmp == NULL:             # <<<<<<<<<<<<<<
17497  *                 raise MemoryError
17498  *             item = tmp
17499  */
17500     __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
17501     if (unlikely(__pyx_t_2)) {
17502 
17503       /* "View.MemoryView":461
17504  *             tmp = PyMem_Malloc(self.view.itemsize)
17505  *             if tmp == NULL:
17506  *                 raise MemoryError             # <<<<<<<<<<<<<<
17507  *             item = tmp
17508  *         else:
17509  */
17510       PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)
17511 
17512       /* "View.MemoryView":460
17513  *         if <size_t>self.view.itemsize > sizeof(array):
17514  *             tmp = PyMem_Malloc(self.view.itemsize)
17515  *             if tmp == NULL:             # <<<<<<<<<<<<<<
17516  *                 raise MemoryError
17517  *             item = tmp
17518  */
17519     }
17520 
17521     /* "View.MemoryView":462
17522  *             if tmp == NULL:
17523  *                 raise MemoryError
17524  *             item = tmp             # <<<<<<<<<<<<<<
17525  *         else:
17526  *             item = <void *> array
17527  */
17528     __pyx_v_item = __pyx_v_tmp;
17529 
17530     /* "View.MemoryView":458
17531  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
17532  *
17533  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
17534  *             tmp = PyMem_Malloc(self.view.itemsize)
17535  *             if tmp == NULL:
17536  */
17537     goto __pyx_L3;
17538   }
17539 
17540   /* "View.MemoryView":464
17541  *             item = tmp
17542  *         else:
17543  *             item = <void *> array             # <<<<<<<<<<<<<<
17544  *
17545  *         try:
17546  */
17547   /*else*/ {
17548     __pyx_v_item = ((void *)__pyx_v_array);
17549   }
17550   __pyx_L3:;
17551 
17552   /* "View.MemoryView":466
17553  *             item = <void *> array
17554  *
17555  *         try:             # <<<<<<<<<<<<<<
17556  *             if self.dtype_is_object:
17557  *                 (<PyObject **> item)[0] = <PyObject *> value
17558  */
17559   /*try:*/ {
17560 
17561     /* "View.MemoryView":467
17562  *
17563  *         try:
17564  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
17565  *                 (<PyObject **> item)[0] = <PyObject *> value
17566  *             else:
17567  */
17568     __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
17569     if (__pyx_t_2) {
17570 
17571       /* "View.MemoryView":468
17572  *         try:
17573  *             if self.dtype_is_object:
17574  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
17575  *             else:
17576  *                 self.assign_item_from_object(<char *> item, value)
17577  */
17578       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
17579 
17580       /* "View.MemoryView":467
17581  *
17582  *         try:
17583  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
17584  *                 (<PyObject **> item)[0] = <PyObject *> value
17585  *             else:
17586  */
17587       goto __pyx_L8;
17588     }
17589 
17590     /* "View.MemoryView":470
17591  *                 (<PyObject **> item)[0] = <PyObject *> value
17592  *             else:
17593  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
17594  *
17595  *
17596  */
17597     /*else*/ {
17598       __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error)
17599       __Pyx_GOTREF(__pyx_t_3);
17600       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17601     }
17602     __pyx_L8:;
17603 
17604     /* "View.MemoryView":474
17605  *
17606  *
17607  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
17608  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
17609  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
17610  */
17611     __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
17612     if (__pyx_t_2) {
17613 
17614       /* "View.MemoryView":475
17615  *
17616  *             if self.view.suboffsets != NULL:
17617  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
17618  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
17619  *                                 item, self.dtype_is_object)
17620  */
17621       __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
17622       __Pyx_GOTREF(__pyx_t_3);
17623       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17624 
17625       /* "View.MemoryView":474
17626  *
17627  *
17628  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
17629  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
17630  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
17631  */
17632     }
17633 
17634     /* "View.MemoryView":476
17635  *             if self.view.suboffsets != NULL:
17636  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
17637  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
17638  *                                 item, self.dtype_is_object)
17639  *         finally:
17640  */
17641     __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
17642   }
17643 
17644   /* "View.MemoryView":479
17645  *                                 item, self.dtype_is_object)
17646  *         finally:
17647  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
17648  *
17649  *     cdef setitem_indexed(self, index, value):
17650  */
17651   /*finally:*/ {
17652     /*normal exit:*/{
17653       PyMem_Free(__pyx_v_tmp);
17654       goto __pyx_L7;
17655     }
17656     __pyx_L6_error:;
17657     /*exception exit:*/{
17658       __Pyx_PyThreadState_declare
17659       __Pyx_PyThreadState_assign
17660       __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
17661       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17662       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
17663       if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
17664       __Pyx_XGOTREF(__pyx_t_7);
17665       __Pyx_XGOTREF(__pyx_t_8);
17666       __Pyx_XGOTREF(__pyx_t_9);
17667       __Pyx_XGOTREF(__pyx_t_10);
17668       __Pyx_XGOTREF(__pyx_t_11);
17669       __Pyx_XGOTREF(__pyx_t_12);
17670       __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
17671       {
17672         PyMem_Free(__pyx_v_tmp);
17673       }
17674       if (PY_MAJOR_VERSION >= 3) {
17675         __Pyx_XGIVEREF(__pyx_t_10);
17676         __Pyx_XGIVEREF(__pyx_t_11);
17677         __Pyx_XGIVEREF(__pyx_t_12);
17678         __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
17679       }
17680       __Pyx_XGIVEREF(__pyx_t_7);
17681       __Pyx_XGIVEREF(__pyx_t_8);
17682       __Pyx_XGIVEREF(__pyx_t_9);
17683       __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
17684       __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
17685       __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
17686       goto __pyx_L1_error;
17687     }
17688     __pyx_L7:;
17689   }
17690 
17691   /* "View.MemoryView":449
17692  *                                  src.ndim, dst.ndim, self.dtype_is_object)
17693  *
17694  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
17695  *         cdef int array[128]
17696  *         cdef void *tmp = NULL
17697  */
17698 
17699   /* function exit code */
17700   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17701   goto __pyx_L0;
17702   __pyx_L1_error:;
17703   __Pyx_XDECREF(__pyx_t_3);
17704   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
17705   __pyx_r = 0;
17706   __pyx_L0:;
17707   __Pyx_XGIVEREF(__pyx_r);
17708   __Pyx_RefNannyFinishContext();
17709   return __pyx_r;
17710 }
17711 
17712 /* "View.MemoryView":481
17713  *             PyMem_Free(tmp)
17714  *
17715  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
17716  *         cdef char *itemp = self.get_item_pointer(index)
17717  *         self.assign_item_from_object(itemp, value)
17718  */
17719 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)17720 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
17721   char *__pyx_v_itemp;
17722   PyObject *__pyx_r = NULL;
17723   __Pyx_RefNannyDeclarations
17724   char *__pyx_t_1;
17725   PyObject *__pyx_t_2 = NULL;
17726   int __pyx_lineno = 0;
17727   const char *__pyx_filename = NULL;
17728   int __pyx_clineno = 0;
17729   __Pyx_RefNannySetupContext("setitem_indexed", 0);
17730 
17731   /* "View.MemoryView":482
17732  *
17733  *     cdef setitem_indexed(self, index, value):
17734  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
17735  *         self.assign_item_from_object(itemp, value)
17736  *
17737  */
17738   __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error)
17739   __pyx_v_itemp = __pyx_t_1;
17740 
17741   /* "View.MemoryView":483
17742  *     cdef setitem_indexed(self, index, value):
17743  *         cdef char *itemp = self.get_item_pointer(index)
17744  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
17745  *
17746  *     cdef convert_item_to_object(self, char *itemp):
17747  */
17748   __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error)
17749   __Pyx_GOTREF(__pyx_t_2);
17750   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17751 
17752   /* "View.MemoryView":481
17753  *             PyMem_Free(tmp)
17754  *
17755  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
17756  *         cdef char *itemp = self.get_item_pointer(index)
17757  *         self.assign_item_from_object(itemp, value)
17758  */
17759 
17760   /* function exit code */
17761   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17762   goto __pyx_L0;
17763   __pyx_L1_error:;
17764   __Pyx_XDECREF(__pyx_t_2);
17765   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
17766   __pyx_r = 0;
17767   __pyx_L0:;
17768   __Pyx_XGIVEREF(__pyx_r);
17769   __Pyx_RefNannyFinishContext();
17770   return __pyx_r;
17771 }
17772 
17773 /* "View.MemoryView":485
17774  *         self.assign_item_from_object(itemp, value)
17775  *
17776  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
17777  *         """Only used if instantiated manually by the user, or if Cython doesn't
17778  *         know how to convert the type"""
17779  */
17780 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)17781 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
17782   PyObject *__pyx_v_struct = NULL;
17783   PyObject *__pyx_v_bytesitem = 0;
17784   PyObject *__pyx_v_result = NULL;
17785   PyObject *__pyx_r = NULL;
17786   __Pyx_RefNannyDeclarations
17787   PyObject *__pyx_t_1 = NULL;
17788   PyObject *__pyx_t_2 = NULL;
17789   PyObject *__pyx_t_3 = NULL;
17790   PyObject *__pyx_t_4 = NULL;
17791   PyObject *__pyx_t_5 = NULL;
17792   PyObject *__pyx_t_6 = NULL;
17793   PyObject *__pyx_t_7 = NULL;
17794   int __pyx_t_8;
17795   PyObject *__pyx_t_9 = NULL;
17796   size_t __pyx_t_10;
17797   int __pyx_t_11;
17798   int __pyx_lineno = 0;
17799   const char *__pyx_filename = NULL;
17800   int __pyx_clineno = 0;
17801   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17802 
17803   /* "View.MemoryView":488
17804  *         """Only used if instantiated manually by the user, or if Cython doesn't
17805  *         know how to convert the type"""
17806  *         import struct             # <<<<<<<<<<<<<<
17807  *         cdef bytes bytesitem
17808  *
17809  */
17810   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
17811   __Pyx_GOTREF(__pyx_t_1);
17812   __pyx_v_struct = __pyx_t_1;
17813   __pyx_t_1 = 0;
17814 
17815   /* "View.MemoryView":491
17816  *         cdef bytes bytesitem
17817  *
17818  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
17819  *         try:
17820  *             result = struct.unpack(self.view.format, bytesitem)
17821  */
17822   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
17823   __Pyx_GOTREF(__pyx_t_1);
17824   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
17825   __pyx_t_1 = 0;
17826 
17827   /* "View.MemoryView":492
17828  *
17829  *         bytesitem = itemp[:self.view.itemsize]
17830  *         try:             # <<<<<<<<<<<<<<
17831  *             result = struct.unpack(self.view.format, bytesitem)
17832  *         except struct.error:
17833  */
17834   {
17835     __Pyx_PyThreadState_declare
17836     __Pyx_PyThreadState_assign
17837     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
17838     __Pyx_XGOTREF(__pyx_t_2);
17839     __Pyx_XGOTREF(__pyx_t_3);
17840     __Pyx_XGOTREF(__pyx_t_4);
17841     /*try:*/ {
17842 
17843       /* "View.MemoryView":493
17844  *         bytesitem = itemp[:self.view.itemsize]
17845  *         try:
17846  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
17847  *         except struct.error:
17848  *             raise ValueError("Unable to convert item to object")
17849  */
17850       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
17851       __Pyx_GOTREF(__pyx_t_5);
17852       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
17853       __Pyx_GOTREF(__pyx_t_6);
17854       __pyx_t_7 = NULL;
17855       __pyx_t_8 = 0;
17856       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
17857         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
17858         if (likely(__pyx_t_7)) {
17859           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
17860           __Pyx_INCREF(__pyx_t_7);
17861           __Pyx_INCREF(function);
17862           __Pyx_DECREF_SET(__pyx_t_5, function);
17863           __pyx_t_8 = 1;
17864         }
17865       }
17866       #if CYTHON_FAST_PYCALL
17867       if (PyFunction_Check(__pyx_t_5)) {
17868         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
17869         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
17870         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17871         __Pyx_GOTREF(__pyx_t_1);
17872         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17873       } else
17874       #endif
17875       #if CYTHON_FAST_PYCCALL
17876       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
17877         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
17878         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
17879         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17880         __Pyx_GOTREF(__pyx_t_1);
17881         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17882       } else
17883       #endif
17884       {
17885         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
17886         __Pyx_GOTREF(__pyx_t_9);
17887         if (__pyx_t_7) {
17888           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
17889         }
17890         __Pyx_GIVEREF(__pyx_t_6);
17891         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
17892         __Pyx_INCREF(__pyx_v_bytesitem);
17893         __Pyx_GIVEREF(__pyx_v_bytesitem);
17894         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
17895         __pyx_t_6 = 0;
17896         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
17897         __Pyx_GOTREF(__pyx_t_1);
17898         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17899       }
17900       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17901       __pyx_v_result = __pyx_t_1;
17902       __pyx_t_1 = 0;
17903 
17904       /* "View.MemoryView":492
17905  *
17906  *         bytesitem = itemp[:self.view.itemsize]
17907  *         try:             # <<<<<<<<<<<<<<
17908  *             result = struct.unpack(self.view.format, bytesitem)
17909  *         except struct.error:
17910  */
17911     }
17912 
17913     /* "View.MemoryView":497
17914  *             raise ValueError("Unable to convert item to object")
17915  *         else:
17916  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
17917  *                 return result[0]
17918  *             return result
17919  */
17920     /*else:*/ {
17921       __pyx_t_10 = strlen(__pyx_v_self->view.format);
17922       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
17923       if (__pyx_t_11) {
17924 
17925         /* "View.MemoryView":498
17926  *         else:
17927  *             if len(self.view.format) == 1:
17928  *                 return result[0]             # <<<<<<<<<<<<<<
17929  *             return result
17930  *
17931  */
17932         __Pyx_XDECREF(__pyx_r);
17933         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error)
17934         __Pyx_GOTREF(__pyx_t_1);
17935         __pyx_r = __pyx_t_1;
17936         __pyx_t_1 = 0;
17937         goto __pyx_L6_except_return;
17938 
17939         /* "View.MemoryView":497
17940  *             raise ValueError("Unable to convert item to object")
17941  *         else:
17942  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
17943  *                 return result[0]
17944  *             return result
17945  */
17946       }
17947 
17948       /* "View.MemoryView":499
17949  *             if len(self.view.format) == 1:
17950  *                 return result[0]
17951  *             return result             # <<<<<<<<<<<<<<
17952  *
17953  *     cdef assign_item_from_object(self, char *itemp, object value):
17954  */
17955       __Pyx_XDECREF(__pyx_r);
17956       __Pyx_INCREF(__pyx_v_result);
17957       __pyx_r = __pyx_v_result;
17958       goto __pyx_L6_except_return;
17959     }
17960     __pyx_L3_error:;
17961     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17962     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17963     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17964     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17965     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17966 
17967     /* "View.MemoryView":494
17968  *         try:
17969  *             result = struct.unpack(self.view.format, bytesitem)
17970  *         except struct.error:             # <<<<<<<<<<<<<<
17971  *             raise ValueError("Unable to convert item to object")
17972  *         else:
17973  */
17974     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
17975     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
17976     __Pyx_GOTREF(__pyx_t_6);
17977     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
17978     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17979     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
17980     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
17981     if (__pyx_t_8) {
17982       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17983       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
17984       __Pyx_GOTREF(__pyx_t_9);
17985       __Pyx_GOTREF(__pyx_t_5);
17986       __Pyx_GOTREF(__pyx_t_1);
17987 
17988       /* "View.MemoryView":495
17989  *             result = struct.unpack(self.view.format, bytesitem)
17990  *         except struct.error:
17991  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
17992  *         else:
17993  *             if len(self.view.format) == 1:
17994  */
17995       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error)
17996       __Pyx_GOTREF(__pyx_t_6);
17997       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
17998       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17999       __PYX_ERR(2, 495, __pyx_L5_except_error)
18000     }
18001     goto __pyx_L5_except_error;
18002     __pyx_L5_except_error:;
18003 
18004     /* "View.MemoryView":492
18005  *
18006  *         bytesitem = itemp[:self.view.itemsize]
18007  *         try:             # <<<<<<<<<<<<<<
18008  *             result = struct.unpack(self.view.format, bytesitem)
18009  *         except struct.error:
18010  */
18011     __Pyx_XGIVEREF(__pyx_t_2);
18012     __Pyx_XGIVEREF(__pyx_t_3);
18013     __Pyx_XGIVEREF(__pyx_t_4);
18014     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
18015     goto __pyx_L1_error;
18016     __pyx_L6_except_return:;
18017     __Pyx_XGIVEREF(__pyx_t_2);
18018     __Pyx_XGIVEREF(__pyx_t_3);
18019     __Pyx_XGIVEREF(__pyx_t_4);
18020     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
18021     goto __pyx_L0;
18022   }
18023 
18024   /* "View.MemoryView":485
18025  *         self.assign_item_from_object(itemp, value)
18026  *
18027  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
18028  *         """Only used if instantiated manually by the user, or if Cython doesn't
18029  *         know how to convert the type"""
18030  */
18031 
18032   /* function exit code */
18033   __pyx_L1_error:;
18034   __Pyx_XDECREF(__pyx_t_1);
18035   __Pyx_XDECREF(__pyx_t_5);
18036   __Pyx_XDECREF(__pyx_t_6);
18037   __Pyx_XDECREF(__pyx_t_7);
18038   __Pyx_XDECREF(__pyx_t_9);
18039   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18040   __pyx_r = 0;
18041   __pyx_L0:;
18042   __Pyx_XDECREF(__pyx_v_struct);
18043   __Pyx_XDECREF(__pyx_v_bytesitem);
18044   __Pyx_XDECREF(__pyx_v_result);
18045   __Pyx_XGIVEREF(__pyx_r);
18046   __Pyx_RefNannyFinishContext();
18047   return __pyx_r;
18048 }
18049 
18050 /* "View.MemoryView":501
18051  *             return result
18052  *
18053  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
18054  *         """Only used if instantiated manually by the user, or if Cython doesn't
18055  *         know how to convert the type"""
18056  */
18057 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)18058 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18059   PyObject *__pyx_v_struct = NULL;
18060   char __pyx_v_c;
18061   PyObject *__pyx_v_bytesvalue = 0;
18062   Py_ssize_t __pyx_v_i;
18063   PyObject *__pyx_r = NULL;
18064   __Pyx_RefNannyDeclarations
18065   PyObject *__pyx_t_1 = NULL;
18066   int __pyx_t_2;
18067   int __pyx_t_3;
18068   PyObject *__pyx_t_4 = NULL;
18069   PyObject *__pyx_t_5 = NULL;
18070   PyObject *__pyx_t_6 = NULL;
18071   int __pyx_t_7;
18072   PyObject *__pyx_t_8 = NULL;
18073   Py_ssize_t __pyx_t_9;
18074   PyObject *__pyx_t_10 = NULL;
18075   char *__pyx_t_11;
18076   char *__pyx_t_12;
18077   char *__pyx_t_13;
18078   char *__pyx_t_14;
18079   int __pyx_lineno = 0;
18080   const char *__pyx_filename = NULL;
18081   int __pyx_clineno = 0;
18082   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
18083 
18084   /* "View.MemoryView":504
18085  *         """Only used if instantiated manually by the user, or if Cython doesn't
18086  *         know how to convert the type"""
18087  *         import struct             # <<<<<<<<<<<<<<
18088  *         cdef char c
18089  *         cdef bytes bytesvalue
18090  */
18091   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
18092   __Pyx_GOTREF(__pyx_t_1);
18093   __pyx_v_struct = __pyx_t_1;
18094   __pyx_t_1 = 0;
18095 
18096   /* "View.MemoryView":509
18097  *         cdef Py_ssize_t i
18098  *
18099  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
18100  *             bytesvalue = struct.pack(self.view.format, *value)
18101  *         else:
18102  */
18103   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
18104   __pyx_t_3 = (__pyx_t_2 != 0);
18105   if (__pyx_t_3) {
18106 
18107     /* "View.MemoryView":510
18108  *
18109  *         if isinstance(value, tuple):
18110  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
18111  *         else:
18112  *             bytesvalue = struct.pack(self.view.format, value)
18113  */
18114     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
18115     __Pyx_GOTREF(__pyx_t_1);
18116     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
18117     __Pyx_GOTREF(__pyx_t_4);
18118     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
18119     __Pyx_GOTREF(__pyx_t_5);
18120     __Pyx_GIVEREF(__pyx_t_4);
18121     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
18122     __pyx_t_4 = 0;
18123     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
18124     __Pyx_GOTREF(__pyx_t_4);
18125     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error)
18126     __Pyx_GOTREF(__pyx_t_6);
18127     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18128     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18129     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
18130     __Pyx_GOTREF(__pyx_t_4);
18131     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18132     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18133     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error)
18134     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
18135     __pyx_t_4 = 0;
18136 
18137     /* "View.MemoryView":509
18138  *         cdef Py_ssize_t i
18139  *
18140  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
18141  *             bytesvalue = struct.pack(self.view.format, *value)
18142  *         else:
18143  */
18144     goto __pyx_L3;
18145   }
18146 
18147   /* "View.MemoryView":512
18148  *             bytesvalue = struct.pack(self.view.format, *value)
18149  *         else:
18150  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
18151  *
18152  *         for i, c in enumerate(bytesvalue):
18153  */
18154   /*else*/ {
18155     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
18156     __Pyx_GOTREF(__pyx_t_6);
18157     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
18158     __Pyx_GOTREF(__pyx_t_1);
18159     __pyx_t_5 = NULL;
18160     __pyx_t_7 = 0;
18161     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
18162       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
18163       if (likely(__pyx_t_5)) {
18164         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
18165         __Pyx_INCREF(__pyx_t_5);
18166         __Pyx_INCREF(function);
18167         __Pyx_DECREF_SET(__pyx_t_6, function);
18168         __pyx_t_7 = 1;
18169       }
18170     }
18171     #if CYTHON_FAST_PYCALL
18172     if (PyFunction_Check(__pyx_t_6)) {
18173       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
18174       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
18175       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18176       __Pyx_GOTREF(__pyx_t_4);
18177       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18178     } else
18179     #endif
18180     #if CYTHON_FAST_PYCCALL
18181     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
18182       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
18183       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
18184       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18185       __Pyx_GOTREF(__pyx_t_4);
18186       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18187     } else
18188     #endif
18189     {
18190       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
18191       __Pyx_GOTREF(__pyx_t_8);
18192       if (__pyx_t_5) {
18193         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
18194       }
18195       __Pyx_GIVEREF(__pyx_t_1);
18196       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
18197       __Pyx_INCREF(__pyx_v_value);
18198       __Pyx_GIVEREF(__pyx_v_value);
18199       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
18200       __pyx_t_1 = 0;
18201       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
18202       __Pyx_GOTREF(__pyx_t_4);
18203       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18204     }
18205     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18206     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
18207     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
18208     __pyx_t_4 = 0;
18209   }
18210   __pyx_L3:;
18211 
18212   /* "View.MemoryView":514
18213  *             bytesvalue = struct.pack(self.view.format, value)
18214  *
18215  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
18216  *             itemp[i] = c
18217  *
18218  */
18219   __pyx_t_9 = 0;
18220   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
18221     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
18222     __PYX_ERR(2, 514, __pyx_L1_error)
18223   }
18224   __Pyx_INCREF(__pyx_v_bytesvalue);
18225   __pyx_t_10 = __pyx_v_bytesvalue;
18226   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
18227   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
18228   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
18229     __pyx_t_11 = __pyx_t_14;
18230     __pyx_v_c = (__pyx_t_11[0]);
18231 
18232     /* "View.MemoryView":515
18233  *
18234  *         for i, c in enumerate(bytesvalue):
18235  *             itemp[i] = c             # <<<<<<<<<<<<<<
18236  *
18237  *     @cname('getbuffer')
18238  */
18239     __pyx_v_i = __pyx_t_9;
18240 
18241     /* "View.MemoryView":514
18242  *             bytesvalue = struct.pack(self.view.format, value)
18243  *
18244  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
18245  *             itemp[i] = c
18246  *
18247  */
18248     __pyx_t_9 = (__pyx_t_9 + 1);
18249 
18250     /* "View.MemoryView":515
18251  *
18252  *         for i, c in enumerate(bytesvalue):
18253  *             itemp[i] = c             # <<<<<<<<<<<<<<
18254  *
18255  *     @cname('getbuffer')
18256  */
18257     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
18258   }
18259   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18260 
18261   /* "View.MemoryView":501
18262  *             return result
18263  *
18264  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
18265  *         """Only used if instantiated manually by the user, or if Cython doesn't
18266  *         know how to convert the type"""
18267  */
18268 
18269   /* function exit code */
18270   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18271   goto __pyx_L0;
18272   __pyx_L1_error:;
18273   __Pyx_XDECREF(__pyx_t_1);
18274   __Pyx_XDECREF(__pyx_t_4);
18275   __Pyx_XDECREF(__pyx_t_5);
18276   __Pyx_XDECREF(__pyx_t_6);
18277   __Pyx_XDECREF(__pyx_t_8);
18278   __Pyx_XDECREF(__pyx_t_10);
18279   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18280   __pyx_r = 0;
18281   __pyx_L0:;
18282   __Pyx_XDECREF(__pyx_v_struct);
18283   __Pyx_XDECREF(__pyx_v_bytesvalue);
18284   __Pyx_XGIVEREF(__pyx_r);
18285   __Pyx_RefNannyFinishContext();
18286   return __pyx_r;
18287 }
18288 
18289 /* "View.MemoryView":518
18290  *
18291  *     @cname('getbuffer')
18292  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
18293  *         if flags & PyBUF_WRITABLE and self.view.readonly:
18294  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
18295  */
18296 
18297 /* Python wrapper */
18298 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_memoryview_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)18299 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
18300   int __pyx_r;
18301   __Pyx_RefNannyDeclarations
18302   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
18303   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
18304 
18305   /* function exit code */
18306   __Pyx_RefNannyFinishContext();
18307   return __pyx_r;
18308 }
18309 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)18310 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
18311   int __pyx_r;
18312   __Pyx_RefNannyDeclarations
18313   int __pyx_t_1;
18314   int __pyx_t_2;
18315   PyObject *__pyx_t_3 = NULL;
18316   Py_ssize_t *__pyx_t_4;
18317   char *__pyx_t_5;
18318   void *__pyx_t_6;
18319   int __pyx_t_7;
18320   Py_ssize_t __pyx_t_8;
18321   int __pyx_lineno = 0;
18322   const char *__pyx_filename = NULL;
18323   int __pyx_clineno = 0;
18324   if (__pyx_v_info == NULL) {
18325     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
18326     return -1;
18327   }
18328   __Pyx_RefNannySetupContext("__getbuffer__", 0);
18329   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
18330   __Pyx_GIVEREF(__pyx_v_info->obj);
18331 
18332   /* "View.MemoryView":519
18333  *     @cname('getbuffer')
18334  *     def __getbuffer__(self, Py_buffer *info, int flags):
18335  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
18336  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
18337  *
18338  */
18339   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
18340   if (__pyx_t_2) {
18341   } else {
18342     __pyx_t_1 = __pyx_t_2;
18343     goto __pyx_L4_bool_binop_done;
18344   }
18345   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
18346   __pyx_t_1 = __pyx_t_2;
18347   __pyx_L4_bool_binop_done:;
18348   if (unlikely(__pyx_t_1)) {
18349 
18350     /* "View.MemoryView":520
18351  *     def __getbuffer__(self, Py_buffer *info, int flags):
18352  *         if flags & PyBUF_WRITABLE and self.view.readonly:
18353  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
18354  *
18355  *         if flags & PyBUF_ND:
18356  */
18357     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error)
18358     __Pyx_GOTREF(__pyx_t_3);
18359     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
18360     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18361     __PYX_ERR(2, 520, __pyx_L1_error)
18362 
18363     /* "View.MemoryView":519
18364  *     @cname('getbuffer')
18365  *     def __getbuffer__(self, Py_buffer *info, int flags):
18366  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
18367  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
18368  *
18369  */
18370   }
18371 
18372   /* "View.MemoryView":522
18373  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
18374  *
18375  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
18376  *             info.shape = self.view.shape
18377  *         else:
18378  */
18379   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
18380   if (__pyx_t_1) {
18381 
18382     /* "View.MemoryView":523
18383  *
18384  *         if flags & PyBUF_ND:
18385  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
18386  *         else:
18387  *             info.shape = NULL
18388  */
18389     __pyx_t_4 = __pyx_v_self->view.shape;
18390     __pyx_v_info->shape = __pyx_t_4;
18391 
18392     /* "View.MemoryView":522
18393  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
18394  *
18395  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
18396  *             info.shape = self.view.shape
18397  *         else:
18398  */
18399     goto __pyx_L6;
18400   }
18401 
18402   /* "View.MemoryView":525
18403  *             info.shape = self.view.shape
18404  *         else:
18405  *             info.shape = NULL             # <<<<<<<<<<<<<<
18406  *
18407  *         if flags & PyBUF_STRIDES:
18408  */
18409   /*else*/ {
18410     __pyx_v_info->shape = NULL;
18411   }
18412   __pyx_L6:;
18413 
18414   /* "View.MemoryView":527
18415  *             info.shape = NULL
18416  *
18417  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
18418  *             info.strides = self.view.strides
18419  *         else:
18420  */
18421   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
18422   if (__pyx_t_1) {
18423 
18424     /* "View.MemoryView":528
18425  *
18426  *         if flags & PyBUF_STRIDES:
18427  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
18428  *         else:
18429  *             info.strides = NULL
18430  */
18431     __pyx_t_4 = __pyx_v_self->view.strides;
18432     __pyx_v_info->strides = __pyx_t_4;
18433 
18434     /* "View.MemoryView":527
18435  *             info.shape = NULL
18436  *
18437  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
18438  *             info.strides = self.view.strides
18439  *         else:
18440  */
18441     goto __pyx_L7;
18442   }
18443 
18444   /* "View.MemoryView":530
18445  *             info.strides = self.view.strides
18446  *         else:
18447  *             info.strides = NULL             # <<<<<<<<<<<<<<
18448  *
18449  *         if flags & PyBUF_INDIRECT:
18450  */
18451   /*else*/ {
18452     __pyx_v_info->strides = NULL;
18453   }
18454   __pyx_L7:;
18455 
18456   /* "View.MemoryView":532
18457  *             info.strides = NULL
18458  *
18459  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
18460  *             info.suboffsets = self.view.suboffsets
18461  *         else:
18462  */
18463   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
18464   if (__pyx_t_1) {
18465 
18466     /* "View.MemoryView":533
18467  *
18468  *         if flags & PyBUF_INDIRECT:
18469  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
18470  *         else:
18471  *             info.suboffsets = NULL
18472  */
18473     __pyx_t_4 = __pyx_v_self->view.suboffsets;
18474     __pyx_v_info->suboffsets = __pyx_t_4;
18475 
18476     /* "View.MemoryView":532
18477  *             info.strides = NULL
18478  *
18479  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
18480  *             info.suboffsets = self.view.suboffsets
18481  *         else:
18482  */
18483     goto __pyx_L8;
18484   }
18485 
18486   /* "View.MemoryView":535
18487  *             info.suboffsets = self.view.suboffsets
18488  *         else:
18489  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
18490  *
18491  *         if flags & PyBUF_FORMAT:
18492  */
18493   /*else*/ {
18494     __pyx_v_info->suboffsets = NULL;
18495   }
18496   __pyx_L8:;
18497 
18498   /* "View.MemoryView":537
18499  *             info.suboffsets = NULL
18500  *
18501  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
18502  *             info.format = self.view.format
18503  *         else:
18504  */
18505   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
18506   if (__pyx_t_1) {
18507 
18508     /* "View.MemoryView":538
18509  *
18510  *         if flags & PyBUF_FORMAT:
18511  *             info.format = self.view.format             # <<<<<<<<<<<<<<
18512  *         else:
18513  *             info.format = NULL
18514  */
18515     __pyx_t_5 = __pyx_v_self->view.format;
18516     __pyx_v_info->format = __pyx_t_5;
18517 
18518     /* "View.MemoryView":537
18519  *             info.suboffsets = NULL
18520  *
18521  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
18522  *             info.format = self.view.format
18523  *         else:
18524  */
18525     goto __pyx_L9;
18526   }
18527 
18528   /* "View.MemoryView":540
18529  *             info.format = self.view.format
18530  *         else:
18531  *             info.format = NULL             # <<<<<<<<<<<<<<
18532  *
18533  *         info.buf = self.view.buf
18534  */
18535   /*else*/ {
18536     __pyx_v_info->format = NULL;
18537   }
18538   __pyx_L9:;
18539 
18540   /* "View.MemoryView":542
18541  *             info.format = NULL
18542  *
18543  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
18544  *         info.ndim = self.view.ndim
18545  *         info.itemsize = self.view.itemsize
18546  */
18547   __pyx_t_6 = __pyx_v_self->view.buf;
18548   __pyx_v_info->buf = __pyx_t_6;
18549 
18550   /* "View.MemoryView":543
18551  *
18552  *         info.buf = self.view.buf
18553  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
18554  *         info.itemsize = self.view.itemsize
18555  *         info.len = self.view.len
18556  */
18557   __pyx_t_7 = __pyx_v_self->view.ndim;
18558   __pyx_v_info->ndim = __pyx_t_7;
18559 
18560   /* "View.MemoryView":544
18561  *         info.buf = self.view.buf
18562  *         info.ndim = self.view.ndim
18563  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
18564  *         info.len = self.view.len
18565  *         info.readonly = self.view.readonly
18566  */
18567   __pyx_t_8 = __pyx_v_self->view.itemsize;
18568   __pyx_v_info->itemsize = __pyx_t_8;
18569 
18570   /* "View.MemoryView":545
18571  *         info.ndim = self.view.ndim
18572  *         info.itemsize = self.view.itemsize
18573  *         info.len = self.view.len             # <<<<<<<<<<<<<<
18574  *         info.readonly = self.view.readonly
18575  *         info.obj = self
18576  */
18577   __pyx_t_8 = __pyx_v_self->view.len;
18578   __pyx_v_info->len = __pyx_t_8;
18579 
18580   /* "View.MemoryView":546
18581  *         info.itemsize = self.view.itemsize
18582  *         info.len = self.view.len
18583  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
18584  *         info.obj = self
18585  *
18586  */
18587   __pyx_t_1 = __pyx_v_self->view.readonly;
18588   __pyx_v_info->readonly = __pyx_t_1;
18589 
18590   /* "View.MemoryView":547
18591  *         info.len = self.view.len
18592  *         info.readonly = self.view.readonly
18593  *         info.obj = self             # <<<<<<<<<<<<<<
18594  *
18595  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
18596  */
18597   __Pyx_INCREF(((PyObject *)__pyx_v_self));
18598   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
18599   __Pyx_GOTREF(__pyx_v_info->obj);
18600   __Pyx_DECREF(__pyx_v_info->obj);
18601   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
18602 
18603   /* "View.MemoryView":518
18604  *
18605  *     @cname('getbuffer')
18606  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
18607  *         if flags & PyBUF_WRITABLE and self.view.readonly:
18608  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
18609  */
18610 
18611   /* function exit code */
18612   __pyx_r = 0;
18613   goto __pyx_L0;
18614   __pyx_L1_error:;
18615   __Pyx_XDECREF(__pyx_t_3);
18616   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18617   __pyx_r = -1;
18618   if (__pyx_v_info->obj != NULL) {
18619     __Pyx_GOTREF(__pyx_v_info->obj);
18620     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
18621   }
18622   goto __pyx_L2;
18623   __pyx_L0:;
18624   if (__pyx_v_info->obj == Py_None) {
18625     __Pyx_GOTREF(__pyx_v_info->obj);
18626     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
18627   }
18628   __pyx_L2:;
18629   __Pyx_RefNannyFinishContext();
18630   return __pyx_r;
18631 }
18632 
18633 /* "View.MemoryView":553
18634  *
18635  *     @property
18636  *     def T(self):             # <<<<<<<<<<<<<<
18637  *         cdef _memoryviewslice result = memoryview_copy(self)
18638  *         transpose_memslice(&result.from_slice)
18639  */
18640 
18641 /* Python wrapper */
18642 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject * __pyx_v_self)18643 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
18644   PyObject *__pyx_r = 0;
18645   __Pyx_RefNannyDeclarations
18646   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18647   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18648 
18649   /* function exit code */
18650   __Pyx_RefNannyFinishContext();
18651   return __pyx_r;
18652 }
18653 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)18654 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18655   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18656   PyObject *__pyx_r = NULL;
18657   __Pyx_RefNannyDeclarations
18658   PyObject *__pyx_t_1 = NULL;
18659   int __pyx_t_2;
18660   int __pyx_lineno = 0;
18661   const char *__pyx_filename = NULL;
18662   int __pyx_clineno = 0;
18663   __Pyx_RefNannySetupContext("__get__", 0);
18664 
18665   /* "View.MemoryView":554
18666  *     @property
18667  *     def T(self):
18668  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
18669  *         transpose_memslice(&result.from_slice)
18670  *         return result
18671  */
18672   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
18673   __Pyx_GOTREF(__pyx_t_1);
18674   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
18675   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
18676   __pyx_t_1 = 0;
18677 
18678   /* "View.MemoryView":555
18679  *     def T(self):
18680  *         cdef _memoryviewslice result = memoryview_copy(self)
18681  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
18682  *         return result
18683  *
18684  */
18685   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error)
18686 
18687   /* "View.MemoryView":556
18688  *         cdef _memoryviewslice result = memoryview_copy(self)
18689  *         transpose_memslice(&result.from_slice)
18690  *         return result             # <<<<<<<<<<<<<<
18691  *
18692  *     @property
18693  */
18694   __Pyx_XDECREF(__pyx_r);
18695   __Pyx_INCREF(((PyObject *)__pyx_v_result));
18696   __pyx_r = ((PyObject *)__pyx_v_result);
18697   goto __pyx_L0;
18698 
18699   /* "View.MemoryView":553
18700  *
18701  *     @property
18702  *     def T(self):             # <<<<<<<<<<<<<<
18703  *         cdef _memoryviewslice result = memoryview_copy(self)
18704  *         transpose_memslice(&result.from_slice)
18705  */
18706 
18707   /* function exit code */
18708   __pyx_L1_error:;
18709   __Pyx_XDECREF(__pyx_t_1);
18710   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18711   __pyx_r = NULL;
18712   __pyx_L0:;
18713   __Pyx_XDECREF((PyObject *)__pyx_v_result);
18714   __Pyx_XGIVEREF(__pyx_r);
18715   __Pyx_RefNannyFinishContext();
18716   return __pyx_r;
18717 }
18718 
18719 /* "View.MemoryView":559
18720  *
18721  *     @property
18722  *     def base(self):             # <<<<<<<<<<<<<<
18723  *         return self.obj
18724  *
18725  */
18726 
18727 /* Python wrapper */
18728 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject * __pyx_v_self)18729 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
18730   PyObject *__pyx_r = 0;
18731   __Pyx_RefNannyDeclarations
18732   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18733   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18734 
18735   /* function exit code */
18736   __Pyx_RefNannyFinishContext();
18737   return __pyx_r;
18738 }
18739 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)18740 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18741   PyObject *__pyx_r = NULL;
18742   __Pyx_RefNannyDeclarations
18743   __Pyx_RefNannySetupContext("__get__", 0);
18744 
18745   /* "View.MemoryView":560
18746  *     @property
18747  *     def base(self):
18748  *         return self.obj             # <<<<<<<<<<<<<<
18749  *
18750  *     @property
18751  */
18752   __Pyx_XDECREF(__pyx_r);
18753   __Pyx_INCREF(__pyx_v_self->obj);
18754   __pyx_r = __pyx_v_self->obj;
18755   goto __pyx_L0;
18756 
18757   /* "View.MemoryView":559
18758  *
18759  *     @property
18760  *     def base(self):             # <<<<<<<<<<<<<<
18761  *         return self.obj
18762  *
18763  */
18764 
18765   /* function exit code */
18766   __pyx_L0:;
18767   __Pyx_XGIVEREF(__pyx_r);
18768   __Pyx_RefNannyFinishContext();
18769   return __pyx_r;
18770 }
18771 
18772 /* "View.MemoryView":563
18773  *
18774  *     @property
18775  *     def shape(self):             # <<<<<<<<<<<<<<
18776  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
18777  *
18778  */
18779 
18780 /* Python wrapper */
18781 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject * __pyx_v_self)18782 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
18783   PyObject *__pyx_r = 0;
18784   __Pyx_RefNannyDeclarations
18785   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18786   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18787 
18788   /* function exit code */
18789   __Pyx_RefNannyFinishContext();
18790   return __pyx_r;
18791 }
18792 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)18793 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18794   Py_ssize_t __pyx_v_length;
18795   PyObject *__pyx_r = NULL;
18796   __Pyx_RefNannyDeclarations
18797   PyObject *__pyx_t_1 = NULL;
18798   Py_ssize_t *__pyx_t_2;
18799   Py_ssize_t *__pyx_t_3;
18800   Py_ssize_t *__pyx_t_4;
18801   PyObject *__pyx_t_5 = NULL;
18802   int __pyx_lineno = 0;
18803   const char *__pyx_filename = NULL;
18804   int __pyx_clineno = 0;
18805   __Pyx_RefNannySetupContext("__get__", 0);
18806 
18807   /* "View.MemoryView":564
18808  *     @property
18809  *     def shape(self):
18810  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
18811  *
18812  *     @property
18813  */
18814   __Pyx_XDECREF(__pyx_r);
18815   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
18816   __Pyx_GOTREF(__pyx_t_1);
18817   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
18818   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18819     __pyx_t_2 = __pyx_t_4;
18820     __pyx_v_length = (__pyx_t_2[0]);
18821     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
18822     __Pyx_GOTREF(__pyx_t_5);
18823     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
18824     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18825   }
18826   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
18827   __Pyx_GOTREF(__pyx_t_5);
18828   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18829   __pyx_r = __pyx_t_5;
18830   __pyx_t_5 = 0;
18831   goto __pyx_L0;
18832 
18833   /* "View.MemoryView":563
18834  *
18835  *     @property
18836  *     def shape(self):             # <<<<<<<<<<<<<<
18837  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
18838  *
18839  */
18840 
18841   /* function exit code */
18842   __pyx_L1_error:;
18843   __Pyx_XDECREF(__pyx_t_1);
18844   __Pyx_XDECREF(__pyx_t_5);
18845   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18846   __pyx_r = NULL;
18847   __pyx_L0:;
18848   __Pyx_XGIVEREF(__pyx_r);
18849   __Pyx_RefNannyFinishContext();
18850   return __pyx_r;
18851 }
18852 
18853 /* "View.MemoryView":567
18854  *
18855  *     @property
18856  *     def strides(self):             # <<<<<<<<<<<<<<
18857  *         if self.view.strides == NULL:
18858  *
18859  */
18860 
18861 /* Python wrapper */
18862 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject * __pyx_v_self)18863 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
18864   PyObject *__pyx_r = 0;
18865   __Pyx_RefNannyDeclarations
18866   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18867   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18868 
18869   /* function exit code */
18870   __Pyx_RefNannyFinishContext();
18871   return __pyx_r;
18872 }
18873 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)18874 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18875   Py_ssize_t __pyx_v_stride;
18876   PyObject *__pyx_r = NULL;
18877   __Pyx_RefNannyDeclarations
18878   int __pyx_t_1;
18879   PyObject *__pyx_t_2 = NULL;
18880   Py_ssize_t *__pyx_t_3;
18881   Py_ssize_t *__pyx_t_4;
18882   Py_ssize_t *__pyx_t_5;
18883   PyObject *__pyx_t_6 = NULL;
18884   int __pyx_lineno = 0;
18885   const char *__pyx_filename = NULL;
18886   int __pyx_clineno = 0;
18887   __Pyx_RefNannySetupContext("__get__", 0);
18888 
18889   /* "View.MemoryView":568
18890  *     @property
18891  *     def strides(self):
18892  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
18893  *
18894  *             raise ValueError("Buffer view does not expose strides")
18895  */
18896   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
18897   if (unlikely(__pyx_t_1)) {
18898 
18899     /* "View.MemoryView":570
18900  *         if self.view.strides == NULL:
18901  *
18902  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
18903  *
18904  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
18905  */
18906     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
18907     __Pyx_GOTREF(__pyx_t_2);
18908     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18909     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18910     __PYX_ERR(2, 570, __pyx_L1_error)
18911 
18912     /* "View.MemoryView":568
18913  *     @property
18914  *     def strides(self):
18915  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
18916  *
18917  *             raise ValueError("Buffer view does not expose strides")
18918  */
18919   }
18920 
18921   /* "View.MemoryView":572
18922  *             raise ValueError("Buffer view does not expose strides")
18923  *
18924  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
18925  *
18926  *     @property
18927  */
18928   __Pyx_XDECREF(__pyx_r);
18929   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
18930   __Pyx_GOTREF(__pyx_t_2);
18931   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
18932   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
18933     __pyx_t_3 = __pyx_t_5;
18934     __pyx_v_stride = (__pyx_t_3[0]);
18935     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
18936     __Pyx_GOTREF(__pyx_t_6);
18937     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
18938     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18939   }
18940   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
18941   __Pyx_GOTREF(__pyx_t_6);
18942   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18943   __pyx_r = __pyx_t_6;
18944   __pyx_t_6 = 0;
18945   goto __pyx_L0;
18946 
18947   /* "View.MemoryView":567
18948  *
18949  *     @property
18950  *     def strides(self):             # <<<<<<<<<<<<<<
18951  *         if self.view.strides == NULL:
18952  *
18953  */
18954 
18955   /* function exit code */
18956   __pyx_L1_error:;
18957   __Pyx_XDECREF(__pyx_t_2);
18958   __Pyx_XDECREF(__pyx_t_6);
18959   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18960   __pyx_r = NULL;
18961   __pyx_L0:;
18962   __Pyx_XGIVEREF(__pyx_r);
18963   __Pyx_RefNannyFinishContext();
18964   return __pyx_r;
18965 }
18966 
18967 /* "View.MemoryView":575
18968  *
18969  *     @property
18970  *     def suboffsets(self):             # <<<<<<<<<<<<<<
18971  *         if self.view.suboffsets == NULL:
18972  *             return (-1,) * self.view.ndim
18973  */
18974 
18975 /* Python wrapper */
18976 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject * __pyx_v_self)18977 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
18978   PyObject *__pyx_r = 0;
18979   __Pyx_RefNannyDeclarations
18980   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18981   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18982 
18983   /* function exit code */
18984   __Pyx_RefNannyFinishContext();
18985   return __pyx_r;
18986 }
18987 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)18988 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18989   Py_ssize_t __pyx_v_suboffset;
18990   PyObject *__pyx_r = NULL;
18991   __Pyx_RefNannyDeclarations
18992   int __pyx_t_1;
18993   PyObject *__pyx_t_2 = NULL;
18994   PyObject *__pyx_t_3 = NULL;
18995   Py_ssize_t *__pyx_t_4;
18996   Py_ssize_t *__pyx_t_5;
18997   Py_ssize_t *__pyx_t_6;
18998   int __pyx_lineno = 0;
18999   const char *__pyx_filename = NULL;
19000   int __pyx_clineno = 0;
19001   __Pyx_RefNannySetupContext("__get__", 0);
19002 
19003   /* "View.MemoryView":576
19004  *     @property
19005  *     def suboffsets(self):
19006  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
19007  *             return (-1,) * self.view.ndim
19008  *
19009  */
19010   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
19011   if (__pyx_t_1) {
19012 
19013     /* "View.MemoryView":577
19014  *     def suboffsets(self):
19015  *         if self.view.suboffsets == NULL:
19016  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
19017  *
19018  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
19019  */
19020     __Pyx_XDECREF(__pyx_r);
19021     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
19022     __Pyx_GOTREF(__pyx_t_2);
19023     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__30, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
19024     __Pyx_GOTREF(__pyx_t_3);
19025     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19026     __pyx_r = __pyx_t_3;
19027     __pyx_t_3 = 0;
19028     goto __pyx_L0;
19029 
19030     /* "View.MemoryView":576
19031  *     @property
19032  *     def suboffsets(self):
19033  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
19034  *             return (-1,) * self.view.ndim
19035  *
19036  */
19037   }
19038 
19039   /* "View.MemoryView":579
19040  *             return (-1,) * self.view.ndim
19041  *
19042  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
19043  *
19044  *     @property
19045  */
19046   __Pyx_XDECREF(__pyx_r);
19047   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
19048   __Pyx_GOTREF(__pyx_t_3);
19049   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
19050   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
19051     __pyx_t_4 = __pyx_t_6;
19052     __pyx_v_suboffset = (__pyx_t_4[0]);
19053     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
19054     __Pyx_GOTREF(__pyx_t_2);
19055     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
19056     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19057   }
19058   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
19059   __Pyx_GOTREF(__pyx_t_2);
19060   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19061   __pyx_r = __pyx_t_2;
19062   __pyx_t_2 = 0;
19063   goto __pyx_L0;
19064 
19065   /* "View.MemoryView":575
19066  *
19067  *     @property
19068  *     def suboffsets(self):             # <<<<<<<<<<<<<<
19069  *         if self.view.suboffsets == NULL:
19070  *             return (-1,) * self.view.ndim
19071  */
19072 
19073   /* function exit code */
19074   __pyx_L1_error:;
19075   __Pyx_XDECREF(__pyx_t_2);
19076   __Pyx_XDECREF(__pyx_t_3);
19077   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19078   __pyx_r = NULL;
19079   __pyx_L0:;
19080   __Pyx_XGIVEREF(__pyx_r);
19081   __Pyx_RefNannyFinishContext();
19082   return __pyx_r;
19083 }
19084 
19085 /* "View.MemoryView":582
19086  *
19087  *     @property
19088  *     def ndim(self):             # <<<<<<<<<<<<<<
19089  *         return self.view.ndim
19090  *
19091  */
19092 
19093 /* Python wrapper */
19094 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject * __pyx_v_self)19095 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
19096   PyObject *__pyx_r = 0;
19097   __Pyx_RefNannyDeclarations
19098   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
19099   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19100 
19101   /* function exit code */
19102   __Pyx_RefNannyFinishContext();
19103   return __pyx_r;
19104 }
19105 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)19106 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
19107   PyObject *__pyx_r = NULL;
19108   __Pyx_RefNannyDeclarations
19109   PyObject *__pyx_t_1 = NULL;
19110   int __pyx_lineno = 0;
19111   const char *__pyx_filename = NULL;
19112   int __pyx_clineno = 0;
19113   __Pyx_RefNannySetupContext("__get__", 0);
19114 
19115   /* "View.MemoryView":583
19116  *     @property
19117  *     def ndim(self):
19118  *         return self.view.ndim             # <<<<<<<<<<<<<<
19119  *
19120  *     @property
19121  */
19122   __Pyx_XDECREF(__pyx_r);
19123   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
19124   __Pyx_GOTREF(__pyx_t_1);
19125   __pyx_r = __pyx_t_1;
19126   __pyx_t_1 = 0;
19127   goto __pyx_L0;
19128 
19129   /* "View.MemoryView":582
19130  *
19131  *     @property
19132  *     def ndim(self):             # <<<<<<<<<<<<<<
19133  *         return self.view.ndim
19134  *
19135  */
19136 
19137   /* function exit code */
19138   __pyx_L1_error:;
19139   __Pyx_XDECREF(__pyx_t_1);
19140   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19141   __pyx_r = NULL;
19142   __pyx_L0:;
19143   __Pyx_XGIVEREF(__pyx_r);
19144   __Pyx_RefNannyFinishContext();
19145   return __pyx_r;
19146 }
19147 
19148 /* "View.MemoryView":586
19149  *
19150  *     @property
19151  *     def itemsize(self):             # <<<<<<<<<<<<<<
19152  *         return self.view.itemsize
19153  *
19154  */
19155 
19156 /* Python wrapper */
19157 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject * __pyx_v_self)19158 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
19159   PyObject *__pyx_r = 0;
19160   __Pyx_RefNannyDeclarations
19161   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
19162   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19163 
19164   /* function exit code */
19165   __Pyx_RefNannyFinishContext();
19166   return __pyx_r;
19167 }
19168 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)19169 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
19170   PyObject *__pyx_r = NULL;
19171   __Pyx_RefNannyDeclarations
19172   PyObject *__pyx_t_1 = NULL;
19173   int __pyx_lineno = 0;
19174   const char *__pyx_filename = NULL;
19175   int __pyx_clineno = 0;
19176   __Pyx_RefNannySetupContext("__get__", 0);
19177 
19178   /* "View.MemoryView":587
19179  *     @property
19180  *     def itemsize(self):
19181  *         return self.view.itemsize             # <<<<<<<<<<<<<<
19182  *
19183  *     @property
19184  */
19185   __Pyx_XDECREF(__pyx_r);
19186   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
19187   __Pyx_GOTREF(__pyx_t_1);
19188   __pyx_r = __pyx_t_1;
19189   __pyx_t_1 = 0;
19190   goto __pyx_L0;
19191 
19192   /* "View.MemoryView":586
19193  *
19194  *     @property
19195  *     def itemsize(self):             # <<<<<<<<<<<<<<
19196  *         return self.view.itemsize
19197  *
19198  */
19199 
19200   /* function exit code */
19201   __pyx_L1_error:;
19202   __Pyx_XDECREF(__pyx_t_1);
19203   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19204   __pyx_r = NULL;
19205   __pyx_L0:;
19206   __Pyx_XGIVEREF(__pyx_r);
19207   __Pyx_RefNannyFinishContext();
19208   return __pyx_r;
19209 }
19210 
19211 /* "View.MemoryView":590
19212  *
19213  *     @property
19214  *     def nbytes(self):             # <<<<<<<<<<<<<<
19215  *         return self.size * self.view.itemsize
19216  *
19217  */
19218 
19219 /* Python wrapper */
19220 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject * __pyx_v_self)19221 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
19222   PyObject *__pyx_r = 0;
19223   __Pyx_RefNannyDeclarations
19224   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
19225   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19226 
19227   /* function exit code */
19228   __Pyx_RefNannyFinishContext();
19229   return __pyx_r;
19230 }
19231 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)19232 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
19233   PyObject *__pyx_r = NULL;
19234   __Pyx_RefNannyDeclarations
19235   PyObject *__pyx_t_1 = NULL;
19236   PyObject *__pyx_t_2 = NULL;
19237   PyObject *__pyx_t_3 = NULL;
19238   int __pyx_lineno = 0;
19239   const char *__pyx_filename = NULL;
19240   int __pyx_clineno = 0;
19241   __Pyx_RefNannySetupContext("__get__", 0);
19242 
19243   /* "View.MemoryView":591
19244  *     @property
19245  *     def nbytes(self):
19246  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
19247  *
19248  *     @property
19249  */
19250   __Pyx_XDECREF(__pyx_r);
19251   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
19252   __Pyx_GOTREF(__pyx_t_1);
19253   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
19254   __Pyx_GOTREF(__pyx_t_2);
19255   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error)
19256   __Pyx_GOTREF(__pyx_t_3);
19257   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19258   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19259   __pyx_r = __pyx_t_3;
19260   __pyx_t_3 = 0;
19261   goto __pyx_L0;
19262 
19263   /* "View.MemoryView":590
19264  *
19265  *     @property
19266  *     def nbytes(self):             # <<<<<<<<<<<<<<
19267  *         return self.size * self.view.itemsize
19268  *
19269  */
19270 
19271   /* function exit code */
19272   __pyx_L1_error:;
19273   __Pyx_XDECREF(__pyx_t_1);
19274   __Pyx_XDECREF(__pyx_t_2);
19275   __Pyx_XDECREF(__pyx_t_3);
19276   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19277   __pyx_r = NULL;
19278   __pyx_L0:;
19279   __Pyx_XGIVEREF(__pyx_r);
19280   __Pyx_RefNannyFinishContext();
19281   return __pyx_r;
19282 }
19283 
19284 /* "View.MemoryView":594
19285  *
19286  *     @property
19287  *     def size(self):             # <<<<<<<<<<<<<<
19288  *         if self._size is None:
19289  *             result = 1
19290  */
19291 
19292 /* Python wrapper */
19293 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject * __pyx_v_self)19294 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
19295   PyObject *__pyx_r = 0;
19296   __Pyx_RefNannyDeclarations
19297   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
19298   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19299 
19300   /* function exit code */
19301   __Pyx_RefNannyFinishContext();
19302   return __pyx_r;
19303 }
19304 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)19305 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
19306   PyObject *__pyx_v_result = NULL;
19307   PyObject *__pyx_v_length = NULL;
19308   PyObject *__pyx_r = NULL;
19309   __Pyx_RefNannyDeclarations
19310   int __pyx_t_1;
19311   int __pyx_t_2;
19312   Py_ssize_t *__pyx_t_3;
19313   Py_ssize_t *__pyx_t_4;
19314   Py_ssize_t *__pyx_t_5;
19315   PyObject *__pyx_t_6 = NULL;
19316   int __pyx_lineno = 0;
19317   const char *__pyx_filename = NULL;
19318   int __pyx_clineno = 0;
19319   __Pyx_RefNannySetupContext("__get__", 0);
19320 
19321   /* "View.MemoryView":595
19322  *     @property
19323  *     def size(self):
19324  *         if self._size is None:             # <<<<<<<<<<<<<<
19325  *             result = 1
19326  *
19327  */
19328   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
19329   __pyx_t_2 = (__pyx_t_1 != 0);
19330   if (__pyx_t_2) {
19331 
19332     /* "View.MemoryView":596
19333  *     def size(self):
19334  *         if self._size is None:
19335  *             result = 1             # <<<<<<<<<<<<<<
19336  *
19337  *             for length in self.view.shape[:self.view.ndim]:
19338  */
19339     __Pyx_INCREF(__pyx_int_1);
19340     __pyx_v_result = __pyx_int_1;
19341 
19342     /* "View.MemoryView":598
19343  *             result = 1
19344  *
19345  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
19346  *                 result *= length
19347  *
19348  */
19349     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
19350     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
19351       __pyx_t_3 = __pyx_t_5;
19352       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
19353       __Pyx_GOTREF(__pyx_t_6);
19354       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
19355       __pyx_t_6 = 0;
19356 
19357       /* "View.MemoryView":599
19358  *
19359  *             for length in self.view.shape[:self.view.ndim]:
19360  *                 result *= length             # <<<<<<<<<<<<<<
19361  *
19362  *             self._size = result
19363  */
19364       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
19365       __Pyx_GOTREF(__pyx_t_6);
19366       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
19367       __pyx_t_6 = 0;
19368     }
19369 
19370     /* "View.MemoryView":601
19371  *                 result *= length
19372  *
19373  *             self._size = result             # <<<<<<<<<<<<<<
19374  *
19375  *         return self._size
19376  */
19377     __Pyx_INCREF(__pyx_v_result);
19378     __Pyx_GIVEREF(__pyx_v_result);
19379     __Pyx_GOTREF(__pyx_v_self->_size);
19380     __Pyx_DECREF(__pyx_v_self->_size);
19381     __pyx_v_self->_size = __pyx_v_result;
19382 
19383     /* "View.MemoryView":595
19384  *     @property
19385  *     def size(self):
19386  *         if self._size is None:             # <<<<<<<<<<<<<<
19387  *             result = 1
19388  *
19389  */
19390   }
19391 
19392   /* "View.MemoryView":603
19393  *             self._size = result
19394  *
19395  *         return self._size             # <<<<<<<<<<<<<<
19396  *
19397  *     def __len__(self):
19398  */
19399   __Pyx_XDECREF(__pyx_r);
19400   __Pyx_INCREF(__pyx_v_self->_size);
19401   __pyx_r = __pyx_v_self->_size;
19402   goto __pyx_L0;
19403 
19404   /* "View.MemoryView":594
19405  *
19406  *     @property
19407  *     def size(self):             # <<<<<<<<<<<<<<
19408  *         if self._size is None:
19409  *             result = 1
19410  */
19411 
19412   /* function exit code */
19413   __pyx_L1_error:;
19414   __Pyx_XDECREF(__pyx_t_6);
19415   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19416   __pyx_r = NULL;
19417   __pyx_L0:;
19418   __Pyx_XDECREF(__pyx_v_result);
19419   __Pyx_XDECREF(__pyx_v_length);
19420   __Pyx_XGIVEREF(__pyx_r);
19421   __Pyx_RefNannyFinishContext();
19422   return __pyx_r;
19423 }
19424 
19425 /* "View.MemoryView":605
19426  *         return self._size
19427  *
19428  *     def __len__(self):             # <<<<<<<<<<<<<<
19429  *         if self.view.ndim >= 1:
19430  *             return self.view.shape[0]
19431  */
19432 
19433 /* Python wrapper */
19434 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)19435 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
19436   Py_ssize_t __pyx_r;
19437   __Pyx_RefNannyDeclarations
19438   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
19439   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19440 
19441   /* function exit code */
19442   __Pyx_RefNannyFinishContext();
19443   return __pyx_r;
19444 }
19445 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)19446 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
19447   Py_ssize_t __pyx_r;
19448   __Pyx_RefNannyDeclarations
19449   int __pyx_t_1;
19450   __Pyx_RefNannySetupContext("__len__", 0);
19451 
19452   /* "View.MemoryView":606
19453  *
19454  *     def __len__(self):
19455  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
19456  *             return self.view.shape[0]
19457  *
19458  */
19459   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
19460   if (__pyx_t_1) {
19461 
19462     /* "View.MemoryView":607
19463  *     def __len__(self):
19464  *         if self.view.ndim >= 1:
19465  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
19466  *
19467  *         return 0
19468  */
19469     __pyx_r = (__pyx_v_self->view.shape[0]);
19470     goto __pyx_L0;
19471 
19472     /* "View.MemoryView":606
19473  *
19474  *     def __len__(self):
19475  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
19476  *             return self.view.shape[0]
19477  *
19478  */
19479   }
19480 
19481   /* "View.MemoryView":609
19482  *             return self.view.shape[0]
19483  *
19484  *         return 0             # <<<<<<<<<<<<<<
19485  *
19486  *     def __repr__(self):
19487  */
19488   __pyx_r = 0;
19489   goto __pyx_L0;
19490 
19491   /* "View.MemoryView":605
19492  *         return self._size
19493  *
19494  *     def __len__(self):             # <<<<<<<<<<<<<<
19495  *         if self.view.ndim >= 1:
19496  *             return self.view.shape[0]
19497  */
19498 
19499   /* function exit code */
19500   __pyx_L0:;
19501   __Pyx_RefNannyFinishContext();
19502   return __pyx_r;
19503 }
19504 
19505 /* "View.MemoryView":611
19506  *         return 0
19507  *
19508  *     def __repr__(self):             # <<<<<<<<<<<<<<
19509  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
19510  *                                                id(self))
19511  */
19512 
19513 /* Python wrapper */
19514 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)19515 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
19516   PyObject *__pyx_r = 0;
19517   __Pyx_RefNannyDeclarations
19518   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
19519   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19520 
19521   /* function exit code */
19522   __Pyx_RefNannyFinishContext();
19523   return __pyx_r;
19524 }
19525 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)19526 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
19527   PyObject *__pyx_r = NULL;
19528   __Pyx_RefNannyDeclarations
19529   PyObject *__pyx_t_1 = NULL;
19530   PyObject *__pyx_t_2 = NULL;
19531   PyObject *__pyx_t_3 = NULL;
19532   int __pyx_lineno = 0;
19533   const char *__pyx_filename = NULL;
19534   int __pyx_clineno = 0;
19535   __Pyx_RefNannySetupContext("__repr__", 0);
19536 
19537   /* "View.MemoryView":612
19538  *
19539  *     def __repr__(self):
19540  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
19541  *                                                id(self))
19542  *
19543  */
19544   __Pyx_XDECREF(__pyx_r);
19545   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
19546   __Pyx_GOTREF(__pyx_t_1);
19547   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
19548   __Pyx_GOTREF(__pyx_t_2);
19549   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19550   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
19551   __Pyx_GOTREF(__pyx_t_1);
19552   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19553 
19554   /* "View.MemoryView":613
19555  *     def __repr__(self):
19556  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
19557  *                                                id(self))             # <<<<<<<<<<<<<<
19558  *
19559  *     def __str__(self):
19560  */
19561   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
19562   __Pyx_GOTREF(__pyx_t_2);
19563 
19564   /* "View.MemoryView":612
19565  *
19566  *     def __repr__(self):
19567  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
19568  *                                                id(self))
19569  *
19570  */
19571   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
19572   __Pyx_GOTREF(__pyx_t_3);
19573   __Pyx_GIVEREF(__pyx_t_1);
19574   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
19575   __Pyx_GIVEREF(__pyx_t_2);
19576   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
19577   __pyx_t_1 = 0;
19578   __pyx_t_2 = 0;
19579   __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
19580   __Pyx_GOTREF(__pyx_t_2);
19581   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19582   __pyx_r = __pyx_t_2;
19583   __pyx_t_2 = 0;
19584   goto __pyx_L0;
19585 
19586   /* "View.MemoryView":611
19587  *         return 0
19588  *
19589  *     def __repr__(self):             # <<<<<<<<<<<<<<
19590  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
19591  *                                                id(self))
19592  */
19593 
19594   /* function exit code */
19595   __pyx_L1_error:;
19596   __Pyx_XDECREF(__pyx_t_1);
19597   __Pyx_XDECREF(__pyx_t_2);
19598   __Pyx_XDECREF(__pyx_t_3);
19599   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19600   __pyx_r = NULL;
19601   __pyx_L0:;
19602   __Pyx_XGIVEREF(__pyx_r);
19603   __Pyx_RefNannyFinishContext();
19604   return __pyx_r;
19605 }
19606 
19607 /* "View.MemoryView":615
19608  *                                                id(self))
19609  *
19610  *     def __str__(self):             # <<<<<<<<<<<<<<
19611  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
19612  *
19613  */
19614 
19615 /* Python wrapper */
19616 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)19617 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
19618   PyObject *__pyx_r = 0;
19619   __Pyx_RefNannyDeclarations
19620   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
19621   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19622 
19623   /* function exit code */
19624   __Pyx_RefNannyFinishContext();
19625   return __pyx_r;
19626 }
19627 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)19628 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
19629   PyObject *__pyx_r = NULL;
19630   __Pyx_RefNannyDeclarations
19631   PyObject *__pyx_t_1 = NULL;
19632   PyObject *__pyx_t_2 = NULL;
19633   int __pyx_lineno = 0;
19634   const char *__pyx_filename = NULL;
19635   int __pyx_clineno = 0;
19636   __Pyx_RefNannySetupContext("__str__", 0);
19637 
19638   /* "View.MemoryView":616
19639  *
19640  *     def __str__(self):
19641  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
19642  *
19643  *
19644  */
19645   __Pyx_XDECREF(__pyx_r);
19646   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
19647   __Pyx_GOTREF(__pyx_t_1);
19648   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
19649   __Pyx_GOTREF(__pyx_t_2);
19650   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19651   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
19652   __Pyx_GOTREF(__pyx_t_1);
19653   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19654   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
19655   __Pyx_GOTREF(__pyx_t_2);
19656   __Pyx_GIVEREF(__pyx_t_1);
19657   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
19658   __pyx_t_1 = 0;
19659   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
19660   __Pyx_GOTREF(__pyx_t_1);
19661   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19662   __pyx_r = __pyx_t_1;
19663   __pyx_t_1 = 0;
19664   goto __pyx_L0;
19665 
19666   /* "View.MemoryView":615
19667  *                                                id(self))
19668  *
19669  *     def __str__(self):             # <<<<<<<<<<<<<<
19670  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
19671  *
19672  */
19673 
19674   /* function exit code */
19675   __pyx_L1_error:;
19676   __Pyx_XDECREF(__pyx_t_1);
19677   __Pyx_XDECREF(__pyx_t_2);
19678   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19679   __pyx_r = NULL;
19680   __pyx_L0:;
19681   __Pyx_XGIVEREF(__pyx_r);
19682   __Pyx_RefNannyFinishContext();
19683   return __pyx_r;
19684 }
19685 
19686 /* "View.MemoryView":619
19687  *
19688  *
19689  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
19690  *         cdef __Pyx_memviewslice *mslice
19691  *         cdef __Pyx_memviewslice tmp
19692  */
19693 
19694 /* Python wrapper */
19695 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_c_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)19696 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19697   PyObject *__pyx_r = 0;
19698   __Pyx_RefNannyDeclarations
19699   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
19700   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
19701 
19702   /* function exit code */
19703   __Pyx_RefNannyFinishContext();
19704   return __pyx_r;
19705 }
19706 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)19707 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
19708   __Pyx_memviewslice *__pyx_v_mslice;
19709   __Pyx_memviewslice __pyx_v_tmp;
19710   PyObject *__pyx_r = NULL;
19711   __Pyx_RefNannyDeclarations
19712   __Pyx_memviewslice *__pyx_t_1;
19713   PyObject *__pyx_t_2 = NULL;
19714   int __pyx_lineno = 0;
19715   const char *__pyx_filename = NULL;
19716   int __pyx_clineno = 0;
19717   __Pyx_RefNannySetupContext("is_c_contig", 0);
19718 
19719   /* "View.MemoryView":622
19720  *         cdef __Pyx_memviewslice *mslice
19721  *         cdef __Pyx_memviewslice tmp
19722  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
19723  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
19724  *
19725  */
19726   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error)
19727   __pyx_v_mslice = __pyx_t_1;
19728 
19729   /* "View.MemoryView":623
19730  *         cdef __Pyx_memviewslice tmp
19731  *         mslice = get_slice_from_memview(self, &tmp)
19732  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
19733  *
19734  *     def is_f_contig(self):
19735  */
19736   __Pyx_XDECREF(__pyx_r);
19737   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error)
19738   __Pyx_GOTREF(__pyx_t_2);
19739   __pyx_r = __pyx_t_2;
19740   __pyx_t_2 = 0;
19741   goto __pyx_L0;
19742 
19743   /* "View.MemoryView":619
19744  *
19745  *
19746  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
19747  *         cdef __Pyx_memviewslice *mslice
19748  *         cdef __Pyx_memviewslice tmp
19749  */
19750 
19751   /* function exit code */
19752   __pyx_L1_error:;
19753   __Pyx_XDECREF(__pyx_t_2);
19754   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
19755   __pyx_r = NULL;
19756   __pyx_L0:;
19757   __Pyx_XGIVEREF(__pyx_r);
19758   __Pyx_RefNannyFinishContext();
19759   return __pyx_r;
19760 }
19761 
19762 /* "View.MemoryView":625
19763  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
19764  *
19765  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
19766  *         cdef __Pyx_memviewslice *mslice
19767  *         cdef __Pyx_memviewslice tmp
19768  */
19769 
19770 /* Python wrapper */
19771 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_f_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)19772 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19773   PyObject *__pyx_r = 0;
19774   __Pyx_RefNannyDeclarations
19775   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
19776   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
19777 
19778   /* function exit code */
19779   __Pyx_RefNannyFinishContext();
19780   return __pyx_r;
19781 }
19782 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)19783 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
19784   __Pyx_memviewslice *__pyx_v_mslice;
19785   __Pyx_memviewslice __pyx_v_tmp;
19786   PyObject *__pyx_r = NULL;
19787   __Pyx_RefNannyDeclarations
19788   __Pyx_memviewslice *__pyx_t_1;
19789   PyObject *__pyx_t_2 = NULL;
19790   int __pyx_lineno = 0;
19791   const char *__pyx_filename = NULL;
19792   int __pyx_clineno = 0;
19793   __Pyx_RefNannySetupContext("is_f_contig", 0);
19794 
19795   /* "View.MemoryView":628
19796  *         cdef __Pyx_memviewslice *mslice
19797  *         cdef __Pyx_memviewslice tmp
19798  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
19799  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
19800  *
19801  */
19802   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error)
19803   __pyx_v_mslice = __pyx_t_1;
19804 
19805   /* "View.MemoryView":629
19806  *         cdef __Pyx_memviewslice tmp
19807  *         mslice = get_slice_from_memview(self, &tmp)
19808  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
19809  *
19810  *     def copy(self):
19811  */
19812   __Pyx_XDECREF(__pyx_r);
19813   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error)
19814   __Pyx_GOTREF(__pyx_t_2);
19815   __pyx_r = __pyx_t_2;
19816   __pyx_t_2 = 0;
19817   goto __pyx_L0;
19818 
19819   /* "View.MemoryView":625
19820  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
19821  *
19822  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
19823  *         cdef __Pyx_memviewslice *mslice
19824  *         cdef __Pyx_memviewslice tmp
19825  */
19826 
19827   /* function exit code */
19828   __pyx_L1_error:;
19829   __Pyx_XDECREF(__pyx_t_2);
19830   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
19831   __pyx_r = NULL;
19832   __pyx_L0:;
19833   __Pyx_XGIVEREF(__pyx_r);
19834   __Pyx_RefNannyFinishContext();
19835   return __pyx_r;
19836 }
19837 
19838 /* "View.MemoryView":631
19839  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
19840  *
19841  *     def copy(self):             # <<<<<<<<<<<<<<
19842  *         cdef __Pyx_memviewslice mslice
19843  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
19844  */
19845 
19846 /* Python wrapper */
19847 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)19848 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19849   PyObject *__pyx_r = 0;
19850   __Pyx_RefNannyDeclarations
19851   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
19852   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
19853 
19854   /* function exit code */
19855   __Pyx_RefNannyFinishContext();
19856   return __pyx_r;
19857 }
19858 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)19859 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
19860   __Pyx_memviewslice __pyx_v_mslice;
19861   int __pyx_v_flags;
19862   PyObject *__pyx_r = NULL;
19863   __Pyx_RefNannyDeclarations
19864   __Pyx_memviewslice __pyx_t_1;
19865   PyObject *__pyx_t_2 = NULL;
19866   int __pyx_lineno = 0;
19867   const char *__pyx_filename = NULL;
19868   int __pyx_clineno = 0;
19869   __Pyx_RefNannySetupContext("copy", 0);
19870 
19871   /* "View.MemoryView":633
19872  *     def copy(self):
19873  *         cdef __Pyx_memviewslice mslice
19874  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
19875  *
19876  *         slice_copy(self, &mslice)
19877  */
19878   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
19879 
19880   /* "View.MemoryView":635
19881  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
19882  *
19883  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
19884  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
19885  *                                    self.view.itemsize,
19886  */
19887   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
19888 
19889   /* "View.MemoryView":636
19890  *
19891  *         slice_copy(self, &mslice)
19892  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
19893  *                                    self.view.itemsize,
19894  *                                    flags|PyBUF_C_CONTIGUOUS,
19895  */
19896   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error)
19897   __pyx_v_mslice = __pyx_t_1;
19898 
19899   /* "View.MemoryView":641
19900  *                                    self.dtype_is_object)
19901  *
19902  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
19903  *
19904  *     def copy_fortran(self):
19905  */
19906   __Pyx_XDECREF(__pyx_r);
19907   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
19908   __Pyx_GOTREF(__pyx_t_2);
19909   __pyx_r = __pyx_t_2;
19910   __pyx_t_2 = 0;
19911   goto __pyx_L0;
19912 
19913   /* "View.MemoryView":631
19914  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
19915  *
19916  *     def copy(self):             # <<<<<<<<<<<<<<
19917  *         cdef __Pyx_memviewslice mslice
19918  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
19919  */
19920 
19921   /* function exit code */
19922   __pyx_L1_error:;
19923   __Pyx_XDECREF(__pyx_t_2);
19924   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
19925   __pyx_r = NULL;
19926   __pyx_L0:;
19927   __Pyx_XGIVEREF(__pyx_r);
19928   __Pyx_RefNannyFinishContext();
19929   return __pyx_r;
19930 }
19931 
19932 /* "View.MemoryView":643
19933  *         return memoryview_copy_from_slice(self, &mslice)
19934  *
19935  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
19936  *         cdef __Pyx_memviewslice src, dst
19937  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
19938  */
19939 
19940 /* Python wrapper */
19941 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy_fortran(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)19942 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19943   PyObject *__pyx_r = 0;
19944   __Pyx_RefNannyDeclarations
19945   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
19946   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
19947 
19948   /* function exit code */
19949   __Pyx_RefNannyFinishContext();
19950   return __pyx_r;
19951 }
19952 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)19953 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
19954   __Pyx_memviewslice __pyx_v_src;
19955   __Pyx_memviewslice __pyx_v_dst;
19956   int __pyx_v_flags;
19957   PyObject *__pyx_r = NULL;
19958   __Pyx_RefNannyDeclarations
19959   __Pyx_memviewslice __pyx_t_1;
19960   PyObject *__pyx_t_2 = NULL;
19961   int __pyx_lineno = 0;
19962   const char *__pyx_filename = NULL;
19963   int __pyx_clineno = 0;
19964   __Pyx_RefNannySetupContext("copy_fortran", 0);
19965 
19966   /* "View.MemoryView":645
19967  *     def copy_fortran(self):
19968  *         cdef __Pyx_memviewslice src, dst
19969  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
19970  *
19971  *         slice_copy(self, &src)
19972  */
19973   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
19974 
19975   /* "View.MemoryView":647
19976  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
19977  *
19978  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
19979  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
19980  *                                 self.view.itemsize,
19981  */
19982   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
19983 
19984   /* "View.MemoryView":648
19985  *
19986  *         slice_copy(self, &src)
19987  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
19988  *                                 self.view.itemsize,
19989  *                                 flags|PyBUF_F_CONTIGUOUS,
19990  */
19991   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error)
19992   __pyx_v_dst = __pyx_t_1;
19993 
19994   /* "View.MemoryView":653
19995  *                                 self.dtype_is_object)
19996  *
19997  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
19998  *
19999  *
20000  */
20001   __Pyx_XDECREF(__pyx_r);
20002   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
20003   __Pyx_GOTREF(__pyx_t_2);
20004   __pyx_r = __pyx_t_2;
20005   __pyx_t_2 = 0;
20006   goto __pyx_L0;
20007 
20008   /* "View.MemoryView":643
20009  *         return memoryview_copy_from_slice(self, &mslice)
20010  *
20011  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
20012  *         cdef __Pyx_memviewslice src, dst
20013  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
20014  */
20015 
20016   /* function exit code */
20017   __pyx_L1_error:;
20018   __Pyx_XDECREF(__pyx_t_2);
20019   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
20020   __pyx_r = NULL;
20021   __pyx_L0:;
20022   __Pyx_XGIVEREF(__pyx_r);
20023   __Pyx_RefNannyFinishContext();
20024   return __pyx_r;
20025 }
20026 
20027 /* "(tree fragment)":1
20028  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
20029  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20030  * def __setstate_cython__(self, __pyx_state):
20031  */
20032 
20033 /* Python wrapper */
20034 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)20035 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
20036   PyObject *__pyx_r = 0;
20037   __Pyx_RefNannyDeclarations
20038   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
20039   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
20040 
20041   /* function exit code */
20042   __Pyx_RefNannyFinishContext();
20043   return __pyx_r;
20044 }
20045 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)20046 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
20047   PyObject *__pyx_r = NULL;
20048   __Pyx_RefNannyDeclarations
20049   PyObject *__pyx_t_1 = NULL;
20050   int __pyx_lineno = 0;
20051   const char *__pyx_filename = NULL;
20052   int __pyx_clineno = 0;
20053   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
20054 
20055   /* "(tree fragment)":2
20056  * def __reduce_cython__(self):
20057  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20058  * def __setstate_cython__(self, __pyx_state):
20059  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20060  */
20061   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
20062   __Pyx_GOTREF(__pyx_t_1);
20063   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20064   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20065   __PYX_ERR(2, 2, __pyx_L1_error)
20066 
20067   /* "(tree fragment)":1
20068  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
20069  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20070  * def __setstate_cython__(self, __pyx_state):
20071  */
20072 
20073   /* function exit code */
20074   __pyx_L1_error:;
20075   __Pyx_XDECREF(__pyx_t_1);
20076   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20077   __pyx_r = NULL;
20078   __Pyx_XGIVEREF(__pyx_r);
20079   __Pyx_RefNannyFinishContext();
20080   return __pyx_r;
20081 }
20082 
20083 /* "(tree fragment)":3
20084  * def __reduce_cython__(self):
20085  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20086  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
20087  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20088  */
20089 
20090 /* Python wrapper */
20091 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)20092 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
20093   PyObject *__pyx_r = 0;
20094   __Pyx_RefNannyDeclarations
20095   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
20096   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
20097 
20098   /* function exit code */
20099   __Pyx_RefNannyFinishContext();
20100   return __pyx_r;
20101 }
20102 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)20103 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
20104   PyObject *__pyx_r = NULL;
20105   __Pyx_RefNannyDeclarations
20106   PyObject *__pyx_t_1 = NULL;
20107   int __pyx_lineno = 0;
20108   const char *__pyx_filename = NULL;
20109   int __pyx_clineno = 0;
20110   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
20111 
20112   /* "(tree fragment)":4
20113  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20114  * def __setstate_cython__(self, __pyx_state):
20115  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20116  */
20117   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
20118   __Pyx_GOTREF(__pyx_t_1);
20119   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20120   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20121   __PYX_ERR(2, 4, __pyx_L1_error)
20122 
20123   /* "(tree fragment)":3
20124  * def __reduce_cython__(self):
20125  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20126  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
20127  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20128  */
20129 
20130   /* function exit code */
20131   __pyx_L1_error:;
20132   __Pyx_XDECREF(__pyx_t_1);
20133   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20134   __pyx_r = NULL;
20135   __Pyx_XGIVEREF(__pyx_r);
20136   __Pyx_RefNannyFinishContext();
20137   return __pyx_r;
20138 }
20139 
20140 /* "View.MemoryView":657
20141  *
20142  * @cname('__pyx_memoryview_new')
20143  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
20144  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
20145  *     result.typeinfo = typeinfo
20146  */
20147 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)20148 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
20149   struct __pyx_memoryview_obj *__pyx_v_result = 0;
20150   PyObject *__pyx_r = NULL;
20151   __Pyx_RefNannyDeclarations
20152   PyObject *__pyx_t_1 = NULL;
20153   PyObject *__pyx_t_2 = NULL;
20154   PyObject *__pyx_t_3 = NULL;
20155   int __pyx_lineno = 0;
20156   const char *__pyx_filename = NULL;
20157   int __pyx_clineno = 0;
20158   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
20159 
20160   /* "View.MemoryView":658
20161  * @cname('__pyx_memoryview_new')
20162  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
20163  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
20164  *     result.typeinfo = typeinfo
20165  *     return result
20166  */
20167   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
20168   __Pyx_GOTREF(__pyx_t_1);
20169   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
20170   __Pyx_GOTREF(__pyx_t_2);
20171   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
20172   __Pyx_GOTREF(__pyx_t_3);
20173   __Pyx_INCREF(__pyx_v_o);
20174   __Pyx_GIVEREF(__pyx_v_o);
20175   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
20176   __Pyx_GIVEREF(__pyx_t_1);
20177   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
20178   __Pyx_GIVEREF(__pyx_t_2);
20179   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
20180   __pyx_t_1 = 0;
20181   __pyx_t_2 = 0;
20182   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
20183   __Pyx_GOTREF(__pyx_t_2);
20184   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20185   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
20186   __pyx_t_2 = 0;
20187 
20188   /* "View.MemoryView":659
20189  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
20190  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
20191  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
20192  *     return result
20193  *
20194  */
20195   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
20196 
20197   /* "View.MemoryView":660
20198  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
20199  *     result.typeinfo = typeinfo
20200  *     return result             # <<<<<<<<<<<<<<
20201  *
20202  * @cname('__pyx_memoryview_check')
20203  */
20204   __Pyx_XDECREF(__pyx_r);
20205   __Pyx_INCREF(((PyObject *)__pyx_v_result));
20206   __pyx_r = ((PyObject *)__pyx_v_result);
20207   goto __pyx_L0;
20208 
20209   /* "View.MemoryView":657
20210  *
20211  * @cname('__pyx_memoryview_new')
20212  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
20213  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
20214  *     result.typeinfo = typeinfo
20215  */
20216 
20217   /* function exit code */
20218   __pyx_L1_error:;
20219   __Pyx_XDECREF(__pyx_t_1);
20220   __Pyx_XDECREF(__pyx_t_2);
20221   __Pyx_XDECREF(__pyx_t_3);
20222   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
20223   __pyx_r = 0;
20224   __pyx_L0:;
20225   __Pyx_XDECREF((PyObject *)__pyx_v_result);
20226   __Pyx_XGIVEREF(__pyx_r);
20227   __Pyx_RefNannyFinishContext();
20228   return __pyx_r;
20229 }
20230 
20231 /* "View.MemoryView":663
20232  *
20233  * @cname('__pyx_memoryview_check')
20234  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
20235  *     return isinstance(o, memoryview)
20236  *
20237  */
20238 
__pyx_memoryview_check(PyObject * __pyx_v_o)20239 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
20240   int __pyx_r;
20241   __Pyx_RefNannyDeclarations
20242   int __pyx_t_1;
20243   __Pyx_RefNannySetupContext("memoryview_check", 0);
20244 
20245   /* "View.MemoryView":664
20246  * @cname('__pyx_memoryview_check')
20247  * cdef inline bint memoryview_check(object o):
20248  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
20249  *
20250  * cdef tuple _unellipsify(object index, int ndim):
20251  */
20252   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
20253   __pyx_r = __pyx_t_1;
20254   goto __pyx_L0;
20255 
20256   /* "View.MemoryView":663
20257  *
20258  * @cname('__pyx_memoryview_check')
20259  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
20260  *     return isinstance(o, memoryview)
20261  *
20262  */
20263 
20264   /* function exit code */
20265   __pyx_L0:;
20266   __Pyx_RefNannyFinishContext();
20267   return __pyx_r;
20268 }
20269 
20270 /* "View.MemoryView":666
20271  *     return isinstance(o, memoryview)
20272  *
20273  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
20274  *     """
20275  *     Replace all ellipses with full slices and fill incomplete indices with
20276  */
20277 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)20278 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
20279   PyObject *__pyx_v_tup = NULL;
20280   PyObject *__pyx_v_result = NULL;
20281   int __pyx_v_have_slices;
20282   int __pyx_v_seen_ellipsis;
20283   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
20284   PyObject *__pyx_v_item = NULL;
20285   Py_ssize_t __pyx_v_nslices;
20286   PyObject *__pyx_r = NULL;
20287   __Pyx_RefNannyDeclarations
20288   int __pyx_t_1;
20289   int __pyx_t_2;
20290   PyObject *__pyx_t_3 = NULL;
20291   PyObject *__pyx_t_4 = NULL;
20292   Py_ssize_t __pyx_t_5;
20293   PyObject *(*__pyx_t_6)(PyObject *);
20294   PyObject *__pyx_t_7 = NULL;
20295   Py_ssize_t __pyx_t_8;
20296   int __pyx_t_9;
20297   int __pyx_t_10;
20298   PyObject *__pyx_t_11 = NULL;
20299   int __pyx_lineno = 0;
20300   const char *__pyx_filename = NULL;
20301   int __pyx_clineno = 0;
20302   __Pyx_RefNannySetupContext("_unellipsify", 0);
20303 
20304   /* "View.MemoryView":671
20305  *     full slices.
20306  *     """
20307  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
20308  *         tup = (index,)
20309  *     else:
20310  */
20311   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
20312   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
20313   if (__pyx_t_2) {
20314 
20315     /* "View.MemoryView":672
20316  *     """
20317  *     if not isinstance(index, tuple):
20318  *         tup = (index,)             # <<<<<<<<<<<<<<
20319  *     else:
20320  *         tup = index
20321  */
20322     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
20323     __Pyx_GOTREF(__pyx_t_3);
20324     __Pyx_INCREF(__pyx_v_index);
20325     __Pyx_GIVEREF(__pyx_v_index);
20326     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
20327     __pyx_v_tup = __pyx_t_3;
20328     __pyx_t_3 = 0;
20329 
20330     /* "View.MemoryView":671
20331  *     full slices.
20332  *     """
20333  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
20334  *         tup = (index,)
20335  *     else:
20336  */
20337     goto __pyx_L3;
20338   }
20339 
20340   /* "View.MemoryView":674
20341  *         tup = (index,)
20342  *     else:
20343  *         tup = index             # <<<<<<<<<<<<<<
20344  *
20345  *     result = []
20346  */
20347   /*else*/ {
20348     __Pyx_INCREF(__pyx_v_index);
20349     __pyx_v_tup = __pyx_v_index;
20350   }
20351   __pyx_L3:;
20352 
20353   /* "View.MemoryView":676
20354  *         tup = index
20355  *
20356  *     result = []             # <<<<<<<<<<<<<<
20357  *     have_slices = False
20358  *     seen_ellipsis = False
20359  */
20360   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
20361   __Pyx_GOTREF(__pyx_t_3);
20362   __pyx_v_result = ((PyObject*)__pyx_t_3);
20363   __pyx_t_3 = 0;
20364 
20365   /* "View.MemoryView":677
20366  *
20367  *     result = []
20368  *     have_slices = False             # <<<<<<<<<<<<<<
20369  *     seen_ellipsis = False
20370  *     for idx, item in enumerate(tup):
20371  */
20372   __pyx_v_have_slices = 0;
20373 
20374   /* "View.MemoryView":678
20375  *     result = []
20376  *     have_slices = False
20377  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
20378  *     for idx, item in enumerate(tup):
20379  *         if item is Ellipsis:
20380  */
20381   __pyx_v_seen_ellipsis = 0;
20382 
20383   /* "View.MemoryView":679
20384  *     have_slices = False
20385  *     seen_ellipsis = False
20386  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
20387  *         if item is Ellipsis:
20388  *             if not seen_ellipsis:
20389  */
20390   __Pyx_INCREF(__pyx_int_0);
20391   __pyx_t_3 = __pyx_int_0;
20392   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
20393     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
20394     __pyx_t_6 = NULL;
20395   } else {
20396     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
20397     __Pyx_GOTREF(__pyx_t_4);
20398     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
20399   }
20400   for (;;) {
20401     if (likely(!__pyx_t_6)) {
20402       if (likely(PyList_CheckExact(__pyx_t_4))) {
20403         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
20404         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20405         __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
20406         #else
20407         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
20408         __Pyx_GOTREF(__pyx_t_7);
20409         #endif
20410       } else {
20411         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
20412         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20413         __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
20414         #else
20415         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
20416         __Pyx_GOTREF(__pyx_t_7);
20417         #endif
20418       }
20419     } else {
20420       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
20421       if (unlikely(!__pyx_t_7)) {
20422         PyObject* exc_type = PyErr_Occurred();
20423         if (exc_type) {
20424           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
20425           else __PYX_ERR(2, 679, __pyx_L1_error)
20426         }
20427         break;
20428       }
20429       __Pyx_GOTREF(__pyx_t_7);
20430     }
20431     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
20432     __pyx_t_7 = 0;
20433     __Pyx_INCREF(__pyx_t_3);
20434     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
20435     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
20436     __Pyx_GOTREF(__pyx_t_7);
20437     __Pyx_DECREF(__pyx_t_3);
20438     __pyx_t_3 = __pyx_t_7;
20439     __pyx_t_7 = 0;
20440 
20441     /* "View.MemoryView":680
20442  *     seen_ellipsis = False
20443  *     for idx, item in enumerate(tup):
20444  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
20445  *             if not seen_ellipsis:
20446  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
20447  */
20448     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
20449     __pyx_t_1 = (__pyx_t_2 != 0);
20450     if (__pyx_t_1) {
20451 
20452       /* "View.MemoryView":681
20453  *     for idx, item in enumerate(tup):
20454  *         if item is Ellipsis:
20455  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
20456  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
20457  *                 seen_ellipsis = True
20458  */
20459       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
20460       if (__pyx_t_1) {
20461 
20462         /* "View.MemoryView":682
20463  *         if item is Ellipsis:
20464  *             if not seen_ellipsis:
20465  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
20466  *                 seen_ellipsis = True
20467  *             else:
20468  */
20469         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
20470         __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error)
20471         __Pyx_GOTREF(__pyx_t_7);
20472         { Py_ssize_t __pyx_temp;
20473           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
20474             __Pyx_INCREF(__pyx_slice__33);
20475             __Pyx_GIVEREF(__pyx_slice__33);
20476             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__33);
20477           }
20478         }
20479         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
20480         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20481 
20482         /* "View.MemoryView":683
20483  *             if not seen_ellipsis:
20484  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
20485  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
20486  *             else:
20487  *                 result.append(slice(None))
20488  */
20489         __pyx_v_seen_ellipsis = 1;
20490 
20491         /* "View.MemoryView":681
20492  *     for idx, item in enumerate(tup):
20493  *         if item is Ellipsis:
20494  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
20495  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
20496  *                 seen_ellipsis = True
20497  */
20498         goto __pyx_L7;
20499       }
20500 
20501       /* "View.MemoryView":685
20502  *                 seen_ellipsis = True
20503  *             else:
20504  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
20505  *             have_slices = True
20506  *         else:
20507  */
20508       /*else*/ {
20509         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__33); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
20510       }
20511       __pyx_L7:;
20512 
20513       /* "View.MemoryView":686
20514  *             else:
20515  *                 result.append(slice(None))
20516  *             have_slices = True             # <<<<<<<<<<<<<<
20517  *         else:
20518  *             if not isinstance(item, slice) and not PyIndex_Check(item):
20519  */
20520       __pyx_v_have_slices = 1;
20521 
20522       /* "View.MemoryView":680
20523  *     seen_ellipsis = False
20524  *     for idx, item in enumerate(tup):
20525  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
20526  *             if not seen_ellipsis:
20527  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
20528  */
20529       goto __pyx_L6;
20530     }
20531 
20532     /* "View.MemoryView":688
20533  *             have_slices = True
20534  *         else:
20535  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
20536  *                 raise TypeError("Cannot index with type '%s'" % type(item))
20537  *
20538  */
20539     /*else*/ {
20540       __pyx_t_2 = PySlice_Check(__pyx_v_item);
20541       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
20542       if (__pyx_t_10) {
20543       } else {
20544         __pyx_t_1 = __pyx_t_10;
20545         goto __pyx_L9_bool_binop_done;
20546       }
20547       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
20548       __pyx_t_1 = __pyx_t_10;
20549       __pyx_L9_bool_binop_done:;
20550       if (unlikely(__pyx_t_1)) {
20551 
20552         /* "View.MemoryView":689
20553  *         else:
20554  *             if not isinstance(item, slice) and not PyIndex_Check(item):
20555  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
20556  *
20557  *             have_slices = have_slices or isinstance(item, slice)
20558  */
20559         __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error)
20560         __Pyx_GOTREF(__pyx_t_7);
20561         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
20562         __Pyx_GOTREF(__pyx_t_11);
20563         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20564         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
20565         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
20566         __PYX_ERR(2, 689, __pyx_L1_error)
20567 
20568         /* "View.MemoryView":688
20569  *             have_slices = True
20570  *         else:
20571  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
20572  *                 raise TypeError("Cannot index with type '%s'" % type(item))
20573  *
20574  */
20575       }
20576 
20577       /* "View.MemoryView":691
20578  *                 raise TypeError("Cannot index with type '%s'" % type(item))
20579  *
20580  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
20581  *             result.append(item)
20582  *
20583  */
20584       __pyx_t_10 = (__pyx_v_have_slices != 0);
20585       if (!__pyx_t_10) {
20586       } else {
20587         __pyx_t_1 = __pyx_t_10;
20588         goto __pyx_L11_bool_binop_done;
20589       }
20590       __pyx_t_10 = PySlice_Check(__pyx_v_item);
20591       __pyx_t_2 = (__pyx_t_10 != 0);
20592       __pyx_t_1 = __pyx_t_2;
20593       __pyx_L11_bool_binop_done:;
20594       __pyx_v_have_slices = __pyx_t_1;
20595 
20596       /* "View.MemoryView":692
20597  *
20598  *             have_slices = have_slices or isinstance(item, slice)
20599  *             result.append(item)             # <<<<<<<<<<<<<<
20600  *
20601  *     nslices = ndim - len(result)
20602  */
20603       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
20604     }
20605     __pyx_L6:;
20606 
20607     /* "View.MemoryView":679
20608  *     have_slices = False
20609  *     seen_ellipsis = False
20610  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
20611  *         if item is Ellipsis:
20612  *             if not seen_ellipsis:
20613  */
20614   }
20615   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20616   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20617 
20618   /* "View.MemoryView":694
20619  *             result.append(item)
20620  *
20621  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
20622  *     if nslices:
20623  *         result.extend([slice(None)] * nslices)
20624  */
20625   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
20626   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
20627 
20628   /* "View.MemoryView":695
20629  *
20630  *     nslices = ndim - len(result)
20631  *     if nslices:             # <<<<<<<<<<<<<<
20632  *         result.extend([slice(None)] * nslices)
20633  *
20634  */
20635   __pyx_t_1 = (__pyx_v_nslices != 0);
20636   if (__pyx_t_1) {
20637 
20638     /* "View.MemoryView":696
20639  *     nslices = ndim - len(result)
20640  *     if nslices:
20641  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
20642  *
20643  *     return have_slices or nslices, tuple(result)
20644  */
20645     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
20646     __Pyx_GOTREF(__pyx_t_3);
20647     { Py_ssize_t __pyx_temp;
20648       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
20649         __Pyx_INCREF(__pyx_slice__33);
20650         __Pyx_GIVEREF(__pyx_slice__33);
20651         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__33);
20652       }
20653     }
20654     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
20655     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20656 
20657     /* "View.MemoryView":695
20658  *
20659  *     nslices = ndim - len(result)
20660  *     if nslices:             # <<<<<<<<<<<<<<
20661  *         result.extend([slice(None)] * nslices)
20662  *
20663  */
20664   }
20665 
20666   /* "View.MemoryView":698
20667  *         result.extend([slice(None)] * nslices)
20668  *
20669  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
20670  *
20671  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
20672  */
20673   __Pyx_XDECREF(__pyx_r);
20674   if (!__pyx_v_have_slices) {
20675   } else {
20676     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
20677     __Pyx_GOTREF(__pyx_t_4);
20678     __pyx_t_3 = __pyx_t_4;
20679     __pyx_t_4 = 0;
20680     goto __pyx_L14_bool_binop_done;
20681   }
20682   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
20683   __Pyx_GOTREF(__pyx_t_4);
20684   __pyx_t_3 = __pyx_t_4;
20685   __pyx_t_4 = 0;
20686   __pyx_L14_bool_binop_done:;
20687   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
20688   __Pyx_GOTREF(__pyx_t_4);
20689   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
20690   __Pyx_GOTREF(__pyx_t_11);
20691   __Pyx_GIVEREF(__pyx_t_3);
20692   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
20693   __Pyx_GIVEREF(__pyx_t_4);
20694   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
20695   __pyx_t_3 = 0;
20696   __pyx_t_4 = 0;
20697   __pyx_r = ((PyObject*)__pyx_t_11);
20698   __pyx_t_11 = 0;
20699   goto __pyx_L0;
20700 
20701   /* "View.MemoryView":666
20702  *     return isinstance(o, memoryview)
20703  *
20704  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
20705  *     """
20706  *     Replace all ellipses with full slices and fill incomplete indices with
20707  */
20708 
20709   /* function exit code */
20710   __pyx_L1_error:;
20711   __Pyx_XDECREF(__pyx_t_3);
20712   __Pyx_XDECREF(__pyx_t_4);
20713   __Pyx_XDECREF(__pyx_t_7);
20714   __Pyx_XDECREF(__pyx_t_11);
20715   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
20716   __pyx_r = 0;
20717   __pyx_L0:;
20718   __Pyx_XDECREF(__pyx_v_tup);
20719   __Pyx_XDECREF(__pyx_v_result);
20720   __Pyx_XDECREF(__pyx_v_idx);
20721   __Pyx_XDECREF(__pyx_v_item);
20722   __Pyx_XGIVEREF(__pyx_r);
20723   __Pyx_RefNannyFinishContext();
20724   return __pyx_r;
20725 }
20726 
20727 /* "View.MemoryView":700
20728  *     return have_slices or nslices, tuple(result)
20729  *
20730  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
20731  *     for suboffset in suboffsets[:ndim]:
20732  *         if suboffset >= 0:
20733  */
20734 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)20735 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
20736   Py_ssize_t __pyx_v_suboffset;
20737   PyObject *__pyx_r = NULL;
20738   __Pyx_RefNannyDeclarations
20739   Py_ssize_t *__pyx_t_1;
20740   Py_ssize_t *__pyx_t_2;
20741   Py_ssize_t *__pyx_t_3;
20742   int __pyx_t_4;
20743   PyObject *__pyx_t_5 = NULL;
20744   int __pyx_lineno = 0;
20745   const char *__pyx_filename = NULL;
20746   int __pyx_clineno = 0;
20747   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
20748 
20749   /* "View.MemoryView":701
20750  *
20751  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
20752  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
20753  *         if suboffset >= 0:
20754  *             raise ValueError("Indirect dimensions not supported")
20755  */
20756   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
20757   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
20758     __pyx_t_1 = __pyx_t_3;
20759     __pyx_v_suboffset = (__pyx_t_1[0]);
20760 
20761     /* "View.MemoryView":702
20762  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
20763  *     for suboffset in suboffsets[:ndim]:
20764  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
20765  *             raise ValueError("Indirect dimensions not supported")
20766  *
20767  */
20768     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
20769     if (unlikely(__pyx_t_4)) {
20770 
20771       /* "View.MemoryView":703
20772  *     for suboffset in suboffsets[:ndim]:
20773  *         if suboffset >= 0:
20774  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
20775  *
20776  *
20777  */
20778       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error)
20779       __Pyx_GOTREF(__pyx_t_5);
20780       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
20781       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20782       __PYX_ERR(2, 703, __pyx_L1_error)
20783 
20784       /* "View.MemoryView":702
20785  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
20786  *     for suboffset in suboffsets[:ndim]:
20787  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
20788  *             raise ValueError("Indirect dimensions not supported")
20789  *
20790  */
20791     }
20792   }
20793 
20794   /* "View.MemoryView":700
20795  *     return have_slices or nslices, tuple(result)
20796  *
20797  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
20798  *     for suboffset in suboffsets[:ndim]:
20799  *         if suboffset >= 0:
20800  */
20801 
20802   /* function exit code */
20803   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20804   goto __pyx_L0;
20805   __pyx_L1_error:;
20806   __Pyx_XDECREF(__pyx_t_5);
20807   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
20808   __pyx_r = 0;
20809   __pyx_L0:;
20810   __Pyx_XGIVEREF(__pyx_r);
20811   __Pyx_RefNannyFinishContext();
20812   return __pyx_r;
20813 }
20814 
20815 /* "View.MemoryView":710
20816  *
20817  * @cname('__pyx_memview_slice')
20818  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
20819  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
20820  *     cdef bint negative_step
20821  */
20822 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)20823 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
20824   int __pyx_v_new_ndim;
20825   int __pyx_v_suboffset_dim;
20826   int __pyx_v_dim;
20827   __Pyx_memviewslice __pyx_v_src;
20828   __Pyx_memviewslice __pyx_v_dst;
20829   __Pyx_memviewslice *__pyx_v_p_src;
20830   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
20831   __Pyx_memviewslice *__pyx_v_p_dst;
20832   int *__pyx_v_p_suboffset_dim;
20833   Py_ssize_t __pyx_v_start;
20834   Py_ssize_t __pyx_v_stop;
20835   Py_ssize_t __pyx_v_step;
20836   int __pyx_v_have_start;
20837   int __pyx_v_have_stop;
20838   int __pyx_v_have_step;
20839   PyObject *__pyx_v_index = NULL;
20840   struct __pyx_memoryview_obj *__pyx_r = NULL;
20841   __Pyx_RefNannyDeclarations
20842   int __pyx_t_1;
20843   int __pyx_t_2;
20844   PyObject *__pyx_t_3 = NULL;
20845   struct __pyx_memoryview_obj *__pyx_t_4;
20846   char *__pyx_t_5;
20847   int __pyx_t_6;
20848   Py_ssize_t __pyx_t_7;
20849   PyObject *(*__pyx_t_8)(PyObject *);
20850   PyObject *__pyx_t_9 = NULL;
20851   Py_ssize_t __pyx_t_10;
20852   int __pyx_t_11;
20853   Py_ssize_t __pyx_t_12;
20854   int __pyx_lineno = 0;
20855   const char *__pyx_filename = NULL;
20856   int __pyx_clineno = 0;
20857   __Pyx_RefNannySetupContext("memview_slice", 0);
20858 
20859   /* "View.MemoryView":711
20860  * @cname('__pyx_memview_slice')
20861  * cdef memoryview memview_slice(memoryview memview, object indices):
20862  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
20863  *     cdef bint negative_step
20864  *     cdef __Pyx_memviewslice src, dst
20865  */
20866   __pyx_v_new_ndim = 0;
20867   __pyx_v_suboffset_dim = -1;
20868 
20869   /* "View.MemoryView":718
20870  *
20871  *
20872  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
20873  *
20874  *     cdef _memoryviewslice memviewsliceobj
20875  */
20876   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
20877 
20878   /* "View.MemoryView":722
20879  *     cdef _memoryviewslice memviewsliceobj
20880  *
20881  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
20882  *
20883  *     if isinstance(memview, _memoryviewslice):
20884  */
20885   #ifndef CYTHON_WITHOUT_ASSERTIONS
20886   if (unlikely(!Py_OptimizeFlag)) {
20887     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
20888       PyErr_SetNone(PyExc_AssertionError);
20889       __PYX_ERR(2, 722, __pyx_L1_error)
20890     }
20891   }
20892   #endif
20893 
20894   /* "View.MemoryView":724
20895  *     assert memview.view.ndim > 0
20896  *
20897  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
20898  *         memviewsliceobj = memview
20899  *         p_src = &memviewsliceobj.from_slice
20900  */
20901   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
20902   __pyx_t_2 = (__pyx_t_1 != 0);
20903   if (__pyx_t_2) {
20904 
20905     /* "View.MemoryView":725
20906  *
20907  *     if isinstance(memview, _memoryviewslice):
20908  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
20909  *         p_src = &memviewsliceobj.from_slice
20910  *     else:
20911  */
20912     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
20913     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
20914     __Pyx_INCREF(__pyx_t_3);
20915     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
20916     __pyx_t_3 = 0;
20917 
20918     /* "View.MemoryView":726
20919  *     if isinstance(memview, _memoryviewslice):
20920  *         memviewsliceobj = memview
20921  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
20922  *     else:
20923  *         slice_copy(memview, &src)
20924  */
20925     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
20926 
20927     /* "View.MemoryView":724
20928  *     assert memview.view.ndim > 0
20929  *
20930  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
20931  *         memviewsliceobj = memview
20932  *         p_src = &memviewsliceobj.from_slice
20933  */
20934     goto __pyx_L3;
20935   }
20936 
20937   /* "View.MemoryView":728
20938  *         p_src = &memviewsliceobj.from_slice
20939  *     else:
20940  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
20941  *         p_src = &src
20942  *
20943  */
20944   /*else*/ {
20945     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
20946 
20947     /* "View.MemoryView":729
20948  *     else:
20949  *         slice_copy(memview, &src)
20950  *         p_src = &src             # <<<<<<<<<<<<<<
20951  *
20952  *
20953  */
20954     __pyx_v_p_src = (&__pyx_v_src);
20955   }
20956   __pyx_L3:;
20957 
20958   /* "View.MemoryView":735
20959  *
20960  *
20961  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
20962  *     dst.data = p_src.data
20963  *
20964  */
20965   __pyx_t_4 = __pyx_v_p_src->memview;
20966   __pyx_v_dst.memview = __pyx_t_4;
20967 
20968   /* "View.MemoryView":736
20969  *
20970  *     dst.memview = p_src.memview
20971  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
20972  *
20973  *
20974  */
20975   __pyx_t_5 = __pyx_v_p_src->data;
20976   __pyx_v_dst.data = __pyx_t_5;
20977 
20978   /* "View.MemoryView":741
20979  *
20980  *
20981  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
20982  *     cdef int *p_suboffset_dim = &suboffset_dim
20983  *     cdef Py_ssize_t start, stop, step
20984  */
20985   __pyx_v_p_dst = (&__pyx_v_dst);
20986 
20987   /* "View.MemoryView":742
20988  *
20989  *     cdef __Pyx_memviewslice *p_dst = &dst
20990  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
20991  *     cdef Py_ssize_t start, stop, step
20992  *     cdef bint have_start, have_stop, have_step
20993  */
20994   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
20995 
20996   /* "View.MemoryView":746
20997  *     cdef bint have_start, have_stop, have_step
20998  *
20999  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
21000  *         if PyIndex_Check(index):
21001  *             slice_memviewslice(
21002  */
21003   __pyx_t_6 = 0;
21004   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
21005     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
21006     __pyx_t_8 = NULL;
21007   } else {
21008     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
21009     __Pyx_GOTREF(__pyx_t_3);
21010     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
21011   }
21012   for (;;) {
21013     if (likely(!__pyx_t_8)) {
21014       if (likely(PyList_CheckExact(__pyx_t_3))) {
21015         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
21016         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21017         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
21018         #else
21019         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
21020         __Pyx_GOTREF(__pyx_t_9);
21021         #endif
21022       } else {
21023         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
21024         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21025         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
21026         #else
21027         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
21028         __Pyx_GOTREF(__pyx_t_9);
21029         #endif
21030       }
21031     } else {
21032       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
21033       if (unlikely(!__pyx_t_9)) {
21034         PyObject* exc_type = PyErr_Occurred();
21035         if (exc_type) {
21036           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
21037           else __PYX_ERR(2, 746, __pyx_L1_error)
21038         }
21039         break;
21040       }
21041       __Pyx_GOTREF(__pyx_t_9);
21042     }
21043     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
21044     __pyx_t_9 = 0;
21045     __pyx_v_dim = __pyx_t_6;
21046     __pyx_t_6 = (__pyx_t_6 + 1);
21047 
21048     /* "View.MemoryView":747
21049  *
21050  *     for dim, index in enumerate(indices):
21051  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
21052  *             slice_memviewslice(
21053  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
21054  */
21055     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
21056     if (__pyx_t_2) {
21057 
21058       /* "View.MemoryView":751
21059  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
21060  *                 dim, new_ndim, p_suboffset_dim,
21061  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
21062  *                 0, 0, 0, # have_{start,stop,step}
21063  *                 False)
21064  */
21065       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)
21066 
21067       /* "View.MemoryView":748
21068  *     for dim, index in enumerate(indices):
21069  *         if PyIndex_Check(index):
21070  *             slice_memviewslice(             # <<<<<<<<<<<<<<
21071  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
21072  *                 dim, new_ndim, p_suboffset_dim,
21073  */
21074       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error)
21075 
21076       /* "View.MemoryView":747
21077  *
21078  *     for dim, index in enumerate(indices):
21079  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
21080  *             slice_memviewslice(
21081  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
21082  */
21083       goto __pyx_L6;
21084     }
21085 
21086     /* "View.MemoryView":754
21087  *                 0, 0, 0, # have_{start,stop,step}
21088  *                 False)
21089  *         elif index is None:             # <<<<<<<<<<<<<<
21090  *             p_dst.shape[new_ndim] = 1
21091  *             p_dst.strides[new_ndim] = 0
21092  */
21093     __pyx_t_2 = (__pyx_v_index == Py_None);
21094     __pyx_t_1 = (__pyx_t_2 != 0);
21095     if (__pyx_t_1) {
21096 
21097       /* "View.MemoryView":755
21098  *                 False)
21099  *         elif index is None:
21100  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
21101  *             p_dst.strides[new_ndim] = 0
21102  *             p_dst.suboffsets[new_ndim] = -1
21103  */
21104       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
21105 
21106       /* "View.MemoryView":756
21107  *         elif index is None:
21108  *             p_dst.shape[new_ndim] = 1
21109  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
21110  *             p_dst.suboffsets[new_ndim] = -1
21111  *             new_ndim += 1
21112  */
21113       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
21114 
21115       /* "View.MemoryView":757
21116  *             p_dst.shape[new_ndim] = 1
21117  *             p_dst.strides[new_ndim] = 0
21118  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
21119  *             new_ndim += 1
21120  *         else:
21121  */
21122       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
21123 
21124       /* "View.MemoryView":758
21125  *             p_dst.strides[new_ndim] = 0
21126  *             p_dst.suboffsets[new_ndim] = -1
21127  *             new_ndim += 1             # <<<<<<<<<<<<<<
21128  *         else:
21129  *             start = index.start or 0
21130  */
21131       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
21132 
21133       /* "View.MemoryView":754
21134  *                 0, 0, 0, # have_{start,stop,step}
21135  *                 False)
21136  *         elif index is None:             # <<<<<<<<<<<<<<
21137  *             p_dst.shape[new_ndim] = 1
21138  *             p_dst.strides[new_ndim] = 0
21139  */
21140       goto __pyx_L6;
21141     }
21142 
21143     /* "View.MemoryView":760
21144  *             new_ndim += 1
21145  *         else:
21146  *             start = index.start or 0             # <<<<<<<<<<<<<<
21147  *             stop = index.stop or 0
21148  *             step = index.step or 0
21149  */
21150     /*else*/ {
21151       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
21152       __Pyx_GOTREF(__pyx_t_9);
21153       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
21154       if (!__pyx_t_1) {
21155         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21156       } else {
21157         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
21158         __pyx_t_10 = __pyx_t_12;
21159         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21160         goto __pyx_L7_bool_binop_done;
21161       }
21162       __pyx_t_10 = 0;
21163       __pyx_L7_bool_binop_done:;
21164       __pyx_v_start = __pyx_t_10;
21165 
21166       /* "View.MemoryView":761
21167  *         else:
21168  *             start = index.start or 0
21169  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
21170  *             step = index.step or 0
21171  *
21172  */
21173       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
21174       __Pyx_GOTREF(__pyx_t_9);
21175       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
21176       if (!__pyx_t_1) {
21177         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21178       } else {
21179         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
21180         __pyx_t_10 = __pyx_t_12;
21181         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21182         goto __pyx_L9_bool_binop_done;
21183       }
21184       __pyx_t_10 = 0;
21185       __pyx_L9_bool_binop_done:;
21186       __pyx_v_stop = __pyx_t_10;
21187 
21188       /* "View.MemoryView":762
21189  *             start = index.start or 0
21190  *             stop = index.stop or 0
21191  *             step = index.step or 0             # <<<<<<<<<<<<<<
21192  *
21193  *             have_start = index.start is not None
21194  */
21195       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
21196       __Pyx_GOTREF(__pyx_t_9);
21197       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
21198       if (!__pyx_t_1) {
21199         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21200       } else {
21201         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
21202         __pyx_t_10 = __pyx_t_12;
21203         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21204         goto __pyx_L11_bool_binop_done;
21205       }
21206       __pyx_t_10 = 0;
21207       __pyx_L11_bool_binop_done:;
21208       __pyx_v_step = __pyx_t_10;
21209 
21210       /* "View.MemoryView":764
21211  *             step = index.step or 0
21212  *
21213  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
21214  *             have_stop = index.stop is not None
21215  *             have_step = index.step is not None
21216  */
21217       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
21218       __Pyx_GOTREF(__pyx_t_9);
21219       __pyx_t_1 = (__pyx_t_9 != Py_None);
21220       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21221       __pyx_v_have_start = __pyx_t_1;
21222 
21223       /* "View.MemoryView":765
21224  *
21225  *             have_start = index.start is not None
21226  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
21227  *             have_step = index.step is not None
21228  *
21229  */
21230       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
21231       __Pyx_GOTREF(__pyx_t_9);
21232       __pyx_t_1 = (__pyx_t_9 != Py_None);
21233       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21234       __pyx_v_have_stop = __pyx_t_1;
21235 
21236       /* "View.MemoryView":766
21237  *             have_start = index.start is not None
21238  *             have_stop = index.stop is not None
21239  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
21240  *
21241  *             slice_memviewslice(
21242  */
21243       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
21244       __Pyx_GOTREF(__pyx_t_9);
21245       __pyx_t_1 = (__pyx_t_9 != Py_None);
21246       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21247       __pyx_v_have_step = __pyx_t_1;
21248 
21249       /* "View.MemoryView":768
21250  *             have_step = index.step is not None
21251  *
21252  *             slice_memviewslice(             # <<<<<<<<<<<<<<
21253  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
21254  *                 dim, new_ndim, p_suboffset_dim,
21255  */
21256       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error)
21257 
21258       /* "View.MemoryView":774
21259  *                 have_start, have_stop, have_step,
21260  *                 True)
21261  *             new_ndim += 1             # <<<<<<<<<<<<<<
21262  *
21263  *     if isinstance(memview, _memoryviewslice):
21264  */
21265       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
21266     }
21267     __pyx_L6:;
21268 
21269     /* "View.MemoryView":746
21270  *     cdef bint have_start, have_stop, have_step
21271  *
21272  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
21273  *         if PyIndex_Check(index):
21274  *             slice_memviewslice(
21275  */
21276   }
21277   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21278 
21279   /* "View.MemoryView":776
21280  *             new_ndim += 1
21281  *
21282  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
21283  *         return memoryview_fromslice(dst, new_ndim,
21284  *                                     memviewsliceobj.to_object_func,
21285  */
21286   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
21287   __pyx_t_2 = (__pyx_t_1 != 0);
21288   if (__pyx_t_2) {
21289 
21290     /* "View.MemoryView":777
21291  *
21292  *     if isinstance(memview, _memoryviewslice):
21293  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
21294  *                                     memviewsliceobj.to_object_func,
21295  *                                     memviewsliceobj.to_dtype_func,
21296  */
21297     __Pyx_XDECREF(((PyObject *)__pyx_r));
21298 
21299     /* "View.MemoryView":778
21300  *     if isinstance(memview, _memoryviewslice):
21301  *         return memoryview_fromslice(dst, new_ndim,
21302  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
21303  *                                     memviewsliceobj.to_dtype_func,
21304  *                                     memview.dtype_is_object)
21305  */
21306     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }
21307 
21308     /* "View.MemoryView":779
21309  *         return memoryview_fromslice(dst, new_ndim,
21310  *                                     memviewsliceobj.to_object_func,
21311  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
21312  *                                     memview.dtype_is_object)
21313  *     else:
21314  */
21315     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }
21316 
21317     /* "View.MemoryView":777
21318  *
21319  *     if isinstance(memview, _memoryviewslice):
21320  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
21321  *                                     memviewsliceobj.to_object_func,
21322  *                                     memviewsliceobj.to_dtype_func,
21323  */
21324     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
21325     __Pyx_GOTREF(__pyx_t_3);
21326     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
21327     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
21328     __pyx_t_3 = 0;
21329     goto __pyx_L0;
21330 
21331     /* "View.MemoryView":776
21332  *             new_ndim += 1
21333  *
21334  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
21335  *         return memoryview_fromslice(dst, new_ndim,
21336  *                                     memviewsliceobj.to_object_func,
21337  */
21338   }
21339 
21340   /* "View.MemoryView":782
21341  *                                     memview.dtype_is_object)
21342  *     else:
21343  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
21344  *                                     memview.dtype_is_object)
21345  *
21346  */
21347   /*else*/ {
21348     __Pyx_XDECREF(((PyObject *)__pyx_r));
21349 
21350     /* "View.MemoryView":783
21351  *     else:
21352  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
21353  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
21354  *
21355  *
21356  */
21357     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error)
21358     __Pyx_GOTREF(__pyx_t_3);
21359 
21360     /* "View.MemoryView":782
21361  *                                     memview.dtype_is_object)
21362  *     else:
21363  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
21364  *                                     memview.dtype_is_object)
21365  *
21366  */
21367     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
21368     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
21369     __pyx_t_3 = 0;
21370     goto __pyx_L0;
21371   }
21372 
21373   /* "View.MemoryView":710
21374  *
21375  * @cname('__pyx_memview_slice')
21376  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
21377  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
21378  *     cdef bint negative_step
21379  */
21380 
21381   /* function exit code */
21382   __pyx_L1_error:;
21383   __Pyx_XDECREF(__pyx_t_3);
21384   __Pyx_XDECREF(__pyx_t_9);
21385   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21386   __pyx_r = 0;
21387   __pyx_L0:;
21388   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
21389   __Pyx_XDECREF(__pyx_v_index);
21390   __Pyx_XGIVEREF((PyObject *)__pyx_r);
21391   __Pyx_RefNannyFinishContext();
21392   return __pyx_r;
21393 }
21394 
21395 /* "View.MemoryView":807
21396  *
21397  * @cname('__pyx_memoryview_slice_memviewslice')
21398  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
21399  *         __Pyx_memviewslice *dst,
21400  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
21401  */
21402 
__pyx_memoryview_slice_memviewslice(__Pyx_memviewslice * __pyx_v_dst,Py_ssize_t __pyx_v_shape,Py_ssize_t __pyx_v_stride,Py_ssize_t __pyx_v_suboffset,int __pyx_v_dim,int __pyx_v_new_ndim,int * __pyx_v_suboffset_dim,Py_ssize_t __pyx_v_start,Py_ssize_t __pyx_v_stop,Py_ssize_t __pyx_v_step,int __pyx_v_have_start,int __pyx_v_have_stop,int __pyx_v_have_step,int __pyx_v_is_slice)21403 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
21404   Py_ssize_t __pyx_v_new_shape;
21405   int __pyx_v_negative_step;
21406   int __pyx_r;
21407   int __pyx_t_1;
21408   int __pyx_t_2;
21409   int __pyx_t_3;
21410   int __pyx_lineno = 0;
21411   const char *__pyx_filename = NULL;
21412   int __pyx_clineno = 0;
21413 
21414   /* "View.MemoryView":827
21415  *     cdef bint negative_step
21416  *
21417  *     if not is_slice:             # <<<<<<<<<<<<<<
21418  *
21419  *         if start < 0:
21420  */
21421   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
21422   if (__pyx_t_1) {
21423 
21424     /* "View.MemoryView":829
21425  *     if not is_slice:
21426  *
21427  *         if start < 0:             # <<<<<<<<<<<<<<
21428  *             start += shape
21429  *         if not 0 <= start < shape:
21430  */
21431     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
21432     if (__pyx_t_1) {
21433 
21434       /* "View.MemoryView":830
21435  *
21436  *         if start < 0:
21437  *             start += shape             # <<<<<<<<<<<<<<
21438  *         if not 0 <= start < shape:
21439  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
21440  */
21441       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
21442 
21443       /* "View.MemoryView":829
21444  *     if not is_slice:
21445  *
21446  *         if start < 0:             # <<<<<<<<<<<<<<
21447  *             start += shape
21448  *         if not 0 <= start < shape:
21449  */
21450     }
21451 
21452     /* "View.MemoryView":831
21453  *         if start < 0:
21454  *             start += shape
21455  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
21456  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
21457  *     else:
21458  */
21459     __pyx_t_1 = (0 <= __pyx_v_start);
21460     if (__pyx_t_1) {
21461       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
21462     }
21463     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
21464     if (__pyx_t_2) {
21465 
21466       /* "View.MemoryView":832
21467  *             start += shape
21468  *         if not 0 <= start < shape:
21469  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
21470  *     else:
21471  *
21472  */
21473       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error)
21474 
21475       /* "View.MemoryView":831
21476  *         if start < 0:
21477  *             start += shape
21478  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
21479  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
21480  *     else:
21481  */
21482     }
21483 
21484     /* "View.MemoryView":827
21485  *     cdef bint negative_step
21486  *
21487  *     if not is_slice:             # <<<<<<<<<<<<<<
21488  *
21489  *         if start < 0:
21490  */
21491     goto __pyx_L3;
21492   }
21493 
21494   /* "View.MemoryView":835
21495  *     else:
21496  *
21497  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
21498  *
21499  *         if have_step and step == 0:
21500  */
21501   /*else*/ {
21502     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
21503     if (__pyx_t_1) {
21504     } else {
21505       __pyx_t_2 = __pyx_t_1;
21506       goto __pyx_L6_bool_binop_done;
21507     }
21508     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
21509     __pyx_t_2 = __pyx_t_1;
21510     __pyx_L6_bool_binop_done:;
21511     __pyx_v_negative_step = __pyx_t_2;
21512 
21513     /* "View.MemoryView":837
21514  *         negative_step = have_step != 0 and step < 0
21515  *
21516  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
21517  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
21518  *
21519  */
21520     __pyx_t_1 = (__pyx_v_have_step != 0);
21521     if (__pyx_t_1) {
21522     } else {
21523       __pyx_t_2 = __pyx_t_1;
21524       goto __pyx_L9_bool_binop_done;
21525     }
21526     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
21527     __pyx_t_2 = __pyx_t_1;
21528     __pyx_L9_bool_binop_done:;
21529     if (__pyx_t_2) {
21530 
21531       /* "View.MemoryView":838
21532  *
21533  *         if have_step and step == 0:
21534  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
21535  *
21536  *
21537  */
21538       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error)
21539 
21540       /* "View.MemoryView":837
21541  *         negative_step = have_step != 0 and step < 0
21542  *
21543  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
21544  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
21545  *
21546  */
21547     }
21548 
21549     /* "View.MemoryView":841
21550  *
21551  *
21552  *         if have_start:             # <<<<<<<<<<<<<<
21553  *             if start < 0:
21554  *                 start += shape
21555  */
21556     __pyx_t_2 = (__pyx_v_have_start != 0);
21557     if (__pyx_t_2) {
21558 
21559       /* "View.MemoryView":842
21560  *
21561  *         if have_start:
21562  *             if start < 0:             # <<<<<<<<<<<<<<
21563  *                 start += shape
21564  *                 if start < 0:
21565  */
21566       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
21567       if (__pyx_t_2) {
21568 
21569         /* "View.MemoryView":843
21570  *         if have_start:
21571  *             if start < 0:
21572  *                 start += shape             # <<<<<<<<<<<<<<
21573  *                 if start < 0:
21574  *                     start = 0
21575  */
21576         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
21577 
21578         /* "View.MemoryView":844
21579  *             if start < 0:
21580  *                 start += shape
21581  *                 if start < 0:             # <<<<<<<<<<<<<<
21582  *                     start = 0
21583  *             elif start >= shape:
21584  */
21585         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
21586         if (__pyx_t_2) {
21587 
21588           /* "View.MemoryView":845
21589  *                 start += shape
21590  *                 if start < 0:
21591  *                     start = 0             # <<<<<<<<<<<<<<
21592  *             elif start >= shape:
21593  *                 if negative_step:
21594  */
21595           __pyx_v_start = 0;
21596 
21597           /* "View.MemoryView":844
21598  *             if start < 0:
21599  *                 start += shape
21600  *                 if start < 0:             # <<<<<<<<<<<<<<
21601  *                     start = 0
21602  *             elif start >= shape:
21603  */
21604         }
21605 
21606         /* "View.MemoryView":842
21607  *
21608  *         if have_start:
21609  *             if start < 0:             # <<<<<<<<<<<<<<
21610  *                 start += shape
21611  *                 if start < 0:
21612  */
21613         goto __pyx_L12;
21614       }
21615 
21616       /* "View.MemoryView":846
21617  *                 if start < 0:
21618  *                     start = 0
21619  *             elif start >= shape:             # <<<<<<<<<<<<<<
21620  *                 if negative_step:
21621  *                     start = shape - 1
21622  */
21623       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
21624       if (__pyx_t_2) {
21625 
21626         /* "View.MemoryView":847
21627  *                     start = 0
21628  *             elif start >= shape:
21629  *                 if negative_step:             # <<<<<<<<<<<<<<
21630  *                     start = shape - 1
21631  *                 else:
21632  */
21633         __pyx_t_2 = (__pyx_v_negative_step != 0);
21634         if (__pyx_t_2) {
21635 
21636           /* "View.MemoryView":848
21637  *             elif start >= shape:
21638  *                 if negative_step:
21639  *                     start = shape - 1             # <<<<<<<<<<<<<<
21640  *                 else:
21641  *                     start = shape
21642  */
21643           __pyx_v_start = (__pyx_v_shape - 1);
21644 
21645           /* "View.MemoryView":847
21646  *                     start = 0
21647  *             elif start >= shape:
21648  *                 if negative_step:             # <<<<<<<<<<<<<<
21649  *                     start = shape - 1
21650  *                 else:
21651  */
21652           goto __pyx_L14;
21653         }
21654 
21655         /* "View.MemoryView":850
21656  *                     start = shape - 1
21657  *                 else:
21658  *                     start = shape             # <<<<<<<<<<<<<<
21659  *         else:
21660  *             if negative_step:
21661  */
21662         /*else*/ {
21663           __pyx_v_start = __pyx_v_shape;
21664         }
21665         __pyx_L14:;
21666 
21667         /* "View.MemoryView":846
21668  *                 if start < 0:
21669  *                     start = 0
21670  *             elif start >= shape:             # <<<<<<<<<<<<<<
21671  *                 if negative_step:
21672  *                     start = shape - 1
21673  */
21674       }
21675       __pyx_L12:;
21676 
21677       /* "View.MemoryView":841
21678  *
21679  *
21680  *         if have_start:             # <<<<<<<<<<<<<<
21681  *             if start < 0:
21682  *                 start += shape
21683  */
21684       goto __pyx_L11;
21685     }
21686 
21687     /* "View.MemoryView":852
21688  *                     start = shape
21689  *         else:
21690  *             if negative_step:             # <<<<<<<<<<<<<<
21691  *                 start = shape - 1
21692  *             else:
21693  */
21694     /*else*/ {
21695       __pyx_t_2 = (__pyx_v_negative_step != 0);
21696       if (__pyx_t_2) {
21697 
21698         /* "View.MemoryView":853
21699  *         else:
21700  *             if negative_step:
21701  *                 start = shape - 1             # <<<<<<<<<<<<<<
21702  *             else:
21703  *                 start = 0
21704  */
21705         __pyx_v_start = (__pyx_v_shape - 1);
21706 
21707         /* "View.MemoryView":852
21708  *                     start = shape
21709  *         else:
21710  *             if negative_step:             # <<<<<<<<<<<<<<
21711  *                 start = shape - 1
21712  *             else:
21713  */
21714         goto __pyx_L15;
21715       }
21716 
21717       /* "View.MemoryView":855
21718  *                 start = shape - 1
21719  *             else:
21720  *                 start = 0             # <<<<<<<<<<<<<<
21721  *
21722  *         if have_stop:
21723  */
21724       /*else*/ {
21725         __pyx_v_start = 0;
21726       }
21727       __pyx_L15:;
21728     }
21729     __pyx_L11:;
21730 
21731     /* "View.MemoryView":857
21732  *                 start = 0
21733  *
21734  *         if have_stop:             # <<<<<<<<<<<<<<
21735  *             if stop < 0:
21736  *                 stop += shape
21737  */
21738     __pyx_t_2 = (__pyx_v_have_stop != 0);
21739     if (__pyx_t_2) {
21740 
21741       /* "View.MemoryView":858
21742  *
21743  *         if have_stop:
21744  *             if stop < 0:             # <<<<<<<<<<<<<<
21745  *                 stop += shape
21746  *                 if stop < 0:
21747  */
21748       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
21749       if (__pyx_t_2) {
21750 
21751         /* "View.MemoryView":859
21752  *         if have_stop:
21753  *             if stop < 0:
21754  *                 stop += shape             # <<<<<<<<<<<<<<
21755  *                 if stop < 0:
21756  *                     stop = 0
21757  */
21758         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
21759 
21760         /* "View.MemoryView":860
21761  *             if stop < 0:
21762  *                 stop += shape
21763  *                 if stop < 0:             # <<<<<<<<<<<<<<
21764  *                     stop = 0
21765  *             elif stop > shape:
21766  */
21767         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
21768         if (__pyx_t_2) {
21769 
21770           /* "View.MemoryView":861
21771  *                 stop += shape
21772  *                 if stop < 0:
21773  *                     stop = 0             # <<<<<<<<<<<<<<
21774  *             elif stop > shape:
21775  *                 stop = shape
21776  */
21777           __pyx_v_stop = 0;
21778 
21779           /* "View.MemoryView":860
21780  *             if stop < 0:
21781  *                 stop += shape
21782  *                 if stop < 0:             # <<<<<<<<<<<<<<
21783  *                     stop = 0
21784  *             elif stop > shape:
21785  */
21786         }
21787 
21788         /* "View.MemoryView":858
21789  *
21790  *         if have_stop:
21791  *             if stop < 0:             # <<<<<<<<<<<<<<
21792  *                 stop += shape
21793  *                 if stop < 0:
21794  */
21795         goto __pyx_L17;
21796       }
21797 
21798       /* "View.MemoryView":862
21799  *                 if stop < 0:
21800  *                     stop = 0
21801  *             elif stop > shape:             # <<<<<<<<<<<<<<
21802  *                 stop = shape
21803  *         else:
21804  */
21805       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
21806       if (__pyx_t_2) {
21807 
21808         /* "View.MemoryView":863
21809  *                     stop = 0
21810  *             elif stop > shape:
21811  *                 stop = shape             # <<<<<<<<<<<<<<
21812  *         else:
21813  *             if negative_step:
21814  */
21815         __pyx_v_stop = __pyx_v_shape;
21816 
21817         /* "View.MemoryView":862
21818  *                 if stop < 0:
21819  *                     stop = 0
21820  *             elif stop > shape:             # <<<<<<<<<<<<<<
21821  *                 stop = shape
21822  *         else:
21823  */
21824       }
21825       __pyx_L17:;
21826 
21827       /* "View.MemoryView":857
21828  *                 start = 0
21829  *
21830  *         if have_stop:             # <<<<<<<<<<<<<<
21831  *             if stop < 0:
21832  *                 stop += shape
21833  */
21834       goto __pyx_L16;
21835     }
21836 
21837     /* "View.MemoryView":865
21838  *                 stop = shape
21839  *         else:
21840  *             if negative_step:             # <<<<<<<<<<<<<<
21841  *                 stop = -1
21842  *             else:
21843  */
21844     /*else*/ {
21845       __pyx_t_2 = (__pyx_v_negative_step != 0);
21846       if (__pyx_t_2) {
21847 
21848         /* "View.MemoryView":866
21849  *         else:
21850  *             if negative_step:
21851  *                 stop = -1             # <<<<<<<<<<<<<<
21852  *             else:
21853  *                 stop = shape
21854  */
21855         __pyx_v_stop = -1L;
21856 
21857         /* "View.MemoryView":865
21858  *                 stop = shape
21859  *         else:
21860  *             if negative_step:             # <<<<<<<<<<<<<<
21861  *                 stop = -1
21862  *             else:
21863  */
21864         goto __pyx_L19;
21865       }
21866 
21867       /* "View.MemoryView":868
21868  *                 stop = -1
21869  *             else:
21870  *                 stop = shape             # <<<<<<<<<<<<<<
21871  *
21872  *         if not have_step:
21873  */
21874       /*else*/ {
21875         __pyx_v_stop = __pyx_v_shape;
21876       }
21877       __pyx_L19:;
21878     }
21879     __pyx_L16:;
21880 
21881     /* "View.MemoryView":870
21882  *                 stop = shape
21883  *
21884  *         if not have_step:             # <<<<<<<<<<<<<<
21885  *             step = 1
21886  *
21887  */
21888     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
21889     if (__pyx_t_2) {
21890 
21891       /* "View.MemoryView":871
21892  *
21893  *         if not have_step:
21894  *             step = 1             # <<<<<<<<<<<<<<
21895  *
21896  *
21897  */
21898       __pyx_v_step = 1;
21899 
21900       /* "View.MemoryView":870
21901  *                 stop = shape
21902  *
21903  *         if not have_step:             # <<<<<<<<<<<<<<
21904  *             step = 1
21905  *
21906  */
21907     }
21908 
21909     /* "View.MemoryView":875
21910  *
21911  *         with cython.cdivision(True):
21912  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
21913  *
21914  *             if (stop - start) - step * new_shape:
21915  */
21916     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
21917 
21918     /* "View.MemoryView":877
21919  *             new_shape = (stop - start) // step
21920  *
21921  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
21922  *                 new_shape += 1
21923  *
21924  */
21925     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
21926     if (__pyx_t_2) {
21927 
21928       /* "View.MemoryView":878
21929  *
21930  *             if (stop - start) - step * new_shape:
21931  *                 new_shape += 1             # <<<<<<<<<<<<<<
21932  *
21933  *         if new_shape < 0:
21934  */
21935       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
21936 
21937       /* "View.MemoryView":877
21938  *             new_shape = (stop - start) // step
21939  *
21940  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
21941  *                 new_shape += 1
21942  *
21943  */
21944     }
21945 
21946     /* "View.MemoryView":880
21947  *                 new_shape += 1
21948  *
21949  *         if new_shape < 0:             # <<<<<<<<<<<<<<
21950  *             new_shape = 0
21951  *
21952  */
21953     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
21954     if (__pyx_t_2) {
21955 
21956       /* "View.MemoryView":881
21957  *
21958  *         if new_shape < 0:
21959  *             new_shape = 0             # <<<<<<<<<<<<<<
21960  *
21961  *
21962  */
21963       __pyx_v_new_shape = 0;
21964 
21965       /* "View.MemoryView":880
21966  *                 new_shape += 1
21967  *
21968  *         if new_shape < 0:             # <<<<<<<<<<<<<<
21969  *             new_shape = 0
21970  *
21971  */
21972     }
21973 
21974     /* "View.MemoryView":884
21975  *
21976  *
21977  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
21978  *         dst.shape[new_ndim] = new_shape
21979  *         dst.suboffsets[new_ndim] = suboffset
21980  */
21981     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
21982 
21983     /* "View.MemoryView":885
21984  *
21985  *         dst.strides[new_ndim] = stride * step
21986  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
21987  *         dst.suboffsets[new_ndim] = suboffset
21988  *
21989  */
21990     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
21991 
21992     /* "View.MemoryView":886
21993  *         dst.strides[new_ndim] = stride * step
21994  *         dst.shape[new_ndim] = new_shape
21995  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
21996  *
21997  *
21998  */
21999     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
22000   }
22001   __pyx_L3:;
22002 
22003   /* "View.MemoryView":889
22004  *
22005  *
22006  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
22007  *         dst.data += start * stride
22008  *     else:
22009  */
22010   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
22011   if (__pyx_t_2) {
22012 
22013     /* "View.MemoryView":890
22014  *
22015  *     if suboffset_dim[0] < 0:
22016  *         dst.data += start * stride             # <<<<<<<<<<<<<<
22017  *     else:
22018  *         dst.suboffsets[suboffset_dim[0]] += start * stride
22019  */
22020     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
22021 
22022     /* "View.MemoryView":889
22023  *
22024  *
22025  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
22026  *         dst.data += start * stride
22027  *     else:
22028  */
22029     goto __pyx_L23;
22030   }
22031 
22032   /* "View.MemoryView":892
22033  *         dst.data += start * stride
22034  *     else:
22035  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
22036  *
22037  *     if suboffset >= 0:
22038  */
22039   /*else*/ {
22040     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
22041     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
22042   }
22043   __pyx_L23:;
22044 
22045   /* "View.MemoryView":894
22046  *         dst.suboffsets[suboffset_dim[0]] += start * stride
22047  *
22048  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
22049  *         if not is_slice:
22050  *             if new_ndim == 0:
22051  */
22052   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
22053   if (__pyx_t_2) {
22054 
22055     /* "View.MemoryView":895
22056  *
22057  *     if suboffset >= 0:
22058  *         if not is_slice:             # <<<<<<<<<<<<<<
22059  *             if new_ndim == 0:
22060  *                 dst.data = (<char **> dst.data)[0] + suboffset
22061  */
22062     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
22063     if (__pyx_t_2) {
22064 
22065       /* "View.MemoryView":896
22066  *     if suboffset >= 0:
22067  *         if not is_slice:
22068  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
22069  *                 dst.data = (<char **> dst.data)[0] + suboffset
22070  *             else:
22071  */
22072       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
22073       if (__pyx_t_2) {
22074 
22075         /* "View.MemoryView":897
22076  *         if not is_slice:
22077  *             if new_ndim == 0:
22078  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
22079  *             else:
22080  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
22081  */
22082         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
22083 
22084         /* "View.MemoryView":896
22085  *     if suboffset >= 0:
22086  *         if not is_slice:
22087  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
22088  *                 dst.data = (<char **> dst.data)[0] + suboffset
22089  *             else:
22090  */
22091         goto __pyx_L26;
22092       }
22093 
22094       /* "View.MemoryView":899
22095  *                 dst.data = (<char **> dst.data)[0] + suboffset
22096  *             else:
22097  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
22098  *                                      "must be indexed and not sliced", dim)
22099  *         else:
22100  */
22101       /*else*/ {
22102 
22103         /* "View.MemoryView":900
22104  *             else:
22105  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
22106  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
22107  *         else:
22108  *             suboffset_dim[0] = new_ndim
22109  */
22110         __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error)
22111       }
22112       __pyx_L26:;
22113 
22114       /* "View.MemoryView":895
22115  *
22116  *     if suboffset >= 0:
22117  *         if not is_slice:             # <<<<<<<<<<<<<<
22118  *             if new_ndim == 0:
22119  *                 dst.data = (<char **> dst.data)[0] + suboffset
22120  */
22121       goto __pyx_L25;
22122     }
22123 
22124     /* "View.MemoryView":902
22125  *                                      "must be indexed and not sliced", dim)
22126  *         else:
22127  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
22128  *
22129  *     return 0
22130  */
22131     /*else*/ {
22132       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
22133     }
22134     __pyx_L25:;
22135 
22136     /* "View.MemoryView":894
22137  *         dst.suboffsets[suboffset_dim[0]] += start * stride
22138  *
22139  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
22140  *         if not is_slice:
22141  *             if new_ndim == 0:
22142  */
22143   }
22144 
22145   /* "View.MemoryView":904
22146  *             suboffset_dim[0] = new_ndim
22147  *
22148  *     return 0             # <<<<<<<<<<<<<<
22149  *
22150  *
22151  */
22152   __pyx_r = 0;
22153   goto __pyx_L0;
22154 
22155   /* "View.MemoryView":807
22156  *
22157  * @cname('__pyx_memoryview_slice_memviewslice')
22158  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
22159  *         __Pyx_memviewslice *dst,
22160  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
22161  */
22162 
22163   /* function exit code */
22164   __pyx_L1_error:;
22165   {
22166     #ifdef WITH_THREAD
22167     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22168     #endif
22169     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22170     #ifdef WITH_THREAD
22171     __Pyx_PyGILState_Release(__pyx_gilstate_save);
22172     #endif
22173   }
22174   __pyx_r = -1;
22175   __pyx_L0:;
22176   return __pyx_r;
22177 }
22178 
22179 /* "View.MemoryView":910
22180  *
22181  * @cname('__pyx_pybuffer_index')
22182  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
22183  *                           Py_ssize_t dim) except NULL:
22184  *     cdef Py_ssize_t shape, stride, suboffset = -1
22185  */
22186 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)22187 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
22188   Py_ssize_t __pyx_v_shape;
22189   Py_ssize_t __pyx_v_stride;
22190   Py_ssize_t __pyx_v_suboffset;
22191   Py_ssize_t __pyx_v_itemsize;
22192   char *__pyx_v_resultp;
22193   char *__pyx_r;
22194   __Pyx_RefNannyDeclarations
22195   Py_ssize_t __pyx_t_1;
22196   int __pyx_t_2;
22197   PyObject *__pyx_t_3 = NULL;
22198   PyObject *__pyx_t_4 = NULL;
22199   int __pyx_lineno = 0;
22200   const char *__pyx_filename = NULL;
22201   int __pyx_clineno = 0;
22202   __Pyx_RefNannySetupContext("pybuffer_index", 0);
22203 
22204   /* "View.MemoryView":912
22205  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
22206  *                           Py_ssize_t dim) except NULL:
22207  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
22208  *     cdef Py_ssize_t itemsize = view.itemsize
22209  *     cdef char *resultp
22210  */
22211   __pyx_v_suboffset = -1L;
22212 
22213   /* "View.MemoryView":913
22214  *                           Py_ssize_t dim) except NULL:
22215  *     cdef Py_ssize_t shape, stride, suboffset = -1
22216  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
22217  *     cdef char *resultp
22218  *
22219  */
22220   __pyx_t_1 = __pyx_v_view->itemsize;
22221   __pyx_v_itemsize = __pyx_t_1;
22222 
22223   /* "View.MemoryView":916
22224  *     cdef char *resultp
22225  *
22226  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
22227  *         shape = view.len / itemsize
22228  *         stride = itemsize
22229  */
22230   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
22231   if (__pyx_t_2) {
22232 
22233     /* "View.MemoryView":917
22234  *
22235  *     if view.ndim == 0:
22236  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
22237  *         stride = itemsize
22238  *     else:
22239  */
22240     if (unlikely(__pyx_v_itemsize == 0)) {
22241       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
22242       __PYX_ERR(2, 917, __pyx_L1_error)
22243     }
22244     else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
22245       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
22246       __PYX_ERR(2, 917, __pyx_L1_error)
22247     }
22248     __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
22249 
22250     /* "View.MemoryView":918
22251  *     if view.ndim == 0:
22252  *         shape = view.len / itemsize
22253  *         stride = itemsize             # <<<<<<<<<<<<<<
22254  *     else:
22255  *         shape = view.shape[dim]
22256  */
22257     __pyx_v_stride = __pyx_v_itemsize;
22258 
22259     /* "View.MemoryView":916
22260  *     cdef char *resultp
22261  *
22262  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
22263  *         shape = view.len / itemsize
22264  *         stride = itemsize
22265  */
22266     goto __pyx_L3;
22267   }
22268 
22269   /* "View.MemoryView":920
22270  *         stride = itemsize
22271  *     else:
22272  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
22273  *         stride = view.strides[dim]
22274  *         if view.suboffsets != NULL:
22275  */
22276   /*else*/ {
22277     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
22278 
22279     /* "View.MemoryView":921
22280  *     else:
22281  *         shape = view.shape[dim]
22282  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
22283  *         if view.suboffsets != NULL:
22284  *             suboffset = view.suboffsets[dim]
22285  */
22286     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
22287 
22288     /* "View.MemoryView":922
22289  *         shape = view.shape[dim]
22290  *         stride = view.strides[dim]
22291  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
22292  *             suboffset = view.suboffsets[dim]
22293  *
22294  */
22295     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
22296     if (__pyx_t_2) {
22297 
22298       /* "View.MemoryView":923
22299  *         stride = view.strides[dim]
22300  *         if view.suboffsets != NULL:
22301  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
22302  *
22303  *     if index < 0:
22304  */
22305       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
22306 
22307       /* "View.MemoryView":922
22308  *         shape = view.shape[dim]
22309  *         stride = view.strides[dim]
22310  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
22311  *             suboffset = view.suboffsets[dim]
22312  *
22313  */
22314     }
22315   }
22316   __pyx_L3:;
22317 
22318   /* "View.MemoryView":925
22319  *             suboffset = view.suboffsets[dim]
22320  *
22321  *     if index < 0:             # <<<<<<<<<<<<<<
22322  *         index += view.shape[dim]
22323  *         if index < 0:
22324  */
22325   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
22326   if (__pyx_t_2) {
22327 
22328     /* "View.MemoryView":926
22329  *
22330  *     if index < 0:
22331  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
22332  *         if index < 0:
22333  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
22334  */
22335     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
22336 
22337     /* "View.MemoryView":927
22338  *     if index < 0:
22339  *         index += view.shape[dim]
22340  *         if index < 0:             # <<<<<<<<<<<<<<
22341  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
22342  *
22343  */
22344     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
22345     if (unlikely(__pyx_t_2)) {
22346 
22347       /* "View.MemoryView":928
22348  *         index += view.shape[dim]
22349  *         if index < 0:
22350  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
22351  *
22352  *     if index >= shape:
22353  */
22354       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
22355       __Pyx_GOTREF(__pyx_t_3);
22356       __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error)
22357       __Pyx_GOTREF(__pyx_t_4);
22358       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22359       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
22360       __Pyx_GOTREF(__pyx_t_3);
22361       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22362       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22363       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22364       __PYX_ERR(2, 928, __pyx_L1_error)
22365 
22366       /* "View.MemoryView":927
22367  *     if index < 0:
22368  *         index += view.shape[dim]
22369  *         if index < 0:             # <<<<<<<<<<<<<<
22370  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
22371  *
22372  */
22373     }
22374 
22375     /* "View.MemoryView":925
22376  *             suboffset = view.suboffsets[dim]
22377  *
22378  *     if index < 0:             # <<<<<<<<<<<<<<
22379  *         index += view.shape[dim]
22380  *         if index < 0:
22381  */
22382   }
22383 
22384   /* "View.MemoryView":930
22385  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
22386  *
22387  *     if index >= shape:             # <<<<<<<<<<<<<<
22388  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
22389  *
22390  */
22391   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
22392   if (unlikely(__pyx_t_2)) {
22393 
22394     /* "View.MemoryView":931
22395  *
22396  *     if index >= shape:
22397  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
22398  *
22399  *     resultp = bufp + index * stride
22400  */
22401     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
22402     __Pyx_GOTREF(__pyx_t_3);
22403     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error)
22404     __Pyx_GOTREF(__pyx_t_4);
22405     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22406     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
22407     __Pyx_GOTREF(__pyx_t_3);
22408     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22409     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22410     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22411     __PYX_ERR(2, 931, __pyx_L1_error)
22412 
22413     /* "View.MemoryView":930
22414  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
22415  *
22416  *     if index >= shape:             # <<<<<<<<<<<<<<
22417  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
22418  *
22419  */
22420   }
22421 
22422   /* "View.MemoryView":933
22423  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
22424  *
22425  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
22426  *     if suboffset >= 0:
22427  *         resultp = (<char **> resultp)[0] + suboffset
22428  */
22429   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
22430 
22431   /* "View.MemoryView":934
22432  *
22433  *     resultp = bufp + index * stride
22434  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
22435  *         resultp = (<char **> resultp)[0] + suboffset
22436  *
22437  */
22438   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
22439   if (__pyx_t_2) {
22440 
22441     /* "View.MemoryView":935
22442  *     resultp = bufp + index * stride
22443  *     if suboffset >= 0:
22444  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
22445  *
22446  *     return resultp
22447  */
22448     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
22449 
22450     /* "View.MemoryView":934
22451  *
22452  *     resultp = bufp + index * stride
22453  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
22454  *         resultp = (<char **> resultp)[0] + suboffset
22455  *
22456  */
22457   }
22458 
22459   /* "View.MemoryView":937
22460  *         resultp = (<char **> resultp)[0] + suboffset
22461  *
22462  *     return resultp             # <<<<<<<<<<<<<<
22463  *
22464  *
22465  */
22466   __pyx_r = __pyx_v_resultp;
22467   goto __pyx_L0;
22468 
22469   /* "View.MemoryView":910
22470  *
22471  * @cname('__pyx_pybuffer_index')
22472  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
22473  *                           Py_ssize_t dim) except NULL:
22474  *     cdef Py_ssize_t shape, stride, suboffset = -1
22475  */
22476 
22477   /* function exit code */
22478   __pyx_L1_error:;
22479   __Pyx_XDECREF(__pyx_t_3);
22480   __Pyx_XDECREF(__pyx_t_4);
22481   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
22482   __pyx_r = NULL;
22483   __pyx_L0:;
22484   __Pyx_RefNannyFinishContext();
22485   return __pyx_r;
22486 }
22487 
22488 /* "View.MemoryView":943
22489  *
22490  * @cname('__pyx_memslice_transpose')
22491  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
22492  *     cdef int ndim = memslice.memview.view.ndim
22493  *
22494  */
22495 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)22496 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
22497   int __pyx_v_ndim;
22498   Py_ssize_t *__pyx_v_shape;
22499   Py_ssize_t *__pyx_v_strides;
22500   int __pyx_v_i;
22501   int __pyx_v_j;
22502   int __pyx_r;
22503   int __pyx_t_1;
22504   Py_ssize_t *__pyx_t_2;
22505   long __pyx_t_3;
22506   long __pyx_t_4;
22507   Py_ssize_t __pyx_t_5;
22508   Py_ssize_t __pyx_t_6;
22509   int __pyx_t_7;
22510   int __pyx_t_8;
22511   int __pyx_t_9;
22512   int __pyx_lineno = 0;
22513   const char *__pyx_filename = NULL;
22514   int __pyx_clineno = 0;
22515 
22516   /* "View.MemoryView":944
22517  * @cname('__pyx_memslice_transpose')
22518  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
22519  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
22520  *
22521  *     cdef Py_ssize_t *shape = memslice.shape
22522  */
22523   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
22524   __pyx_v_ndim = __pyx_t_1;
22525 
22526   /* "View.MemoryView":946
22527  *     cdef int ndim = memslice.memview.view.ndim
22528  *
22529  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
22530  *     cdef Py_ssize_t *strides = memslice.strides
22531  *
22532  */
22533   __pyx_t_2 = __pyx_v_memslice->shape;
22534   __pyx_v_shape = __pyx_t_2;
22535 
22536   /* "View.MemoryView":947
22537  *
22538  *     cdef Py_ssize_t *shape = memslice.shape
22539  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
22540  *
22541  *
22542  */
22543   __pyx_t_2 = __pyx_v_memslice->strides;
22544   __pyx_v_strides = __pyx_t_2;
22545 
22546   /* "View.MemoryView":951
22547  *
22548  *     cdef int i, j
22549  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
22550  *         j = ndim - 1 - i
22551  *         strides[i], strides[j] = strides[j], strides[i]
22552  */
22553   __pyx_t_3 = (__pyx_v_ndim / 2);
22554   __pyx_t_4 = __pyx_t_3;
22555   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
22556     __pyx_v_i = __pyx_t_1;
22557 
22558     /* "View.MemoryView":952
22559  *     cdef int i, j
22560  *     for i in range(ndim / 2):
22561  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
22562  *         strides[i], strides[j] = strides[j], strides[i]
22563  *         shape[i], shape[j] = shape[j], shape[i]
22564  */
22565     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
22566 
22567     /* "View.MemoryView":953
22568  *     for i in range(ndim / 2):
22569  *         j = ndim - 1 - i
22570  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
22571  *         shape[i], shape[j] = shape[j], shape[i]
22572  *
22573  */
22574     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
22575     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
22576     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
22577     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
22578 
22579     /* "View.MemoryView":954
22580  *         j = ndim - 1 - i
22581  *         strides[i], strides[j] = strides[j], strides[i]
22582  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
22583  *
22584  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
22585  */
22586     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
22587     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
22588     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
22589     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
22590 
22591     /* "View.MemoryView":956
22592  *         shape[i], shape[j] = shape[j], shape[i]
22593  *
22594  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
22595  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
22596  *
22597  */
22598     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
22599     if (!__pyx_t_8) {
22600     } else {
22601       __pyx_t_7 = __pyx_t_8;
22602       goto __pyx_L6_bool_binop_done;
22603     }
22604     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
22605     __pyx_t_7 = __pyx_t_8;
22606     __pyx_L6_bool_binop_done:;
22607     if (__pyx_t_7) {
22608 
22609       /* "View.MemoryView":957
22610  *
22611  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
22612  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
22613  *
22614  *     return 1
22615  */
22616       __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error)
22617 
22618       /* "View.MemoryView":956
22619  *         shape[i], shape[j] = shape[j], shape[i]
22620  *
22621  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
22622  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
22623  *
22624  */
22625     }
22626   }
22627 
22628   /* "View.MemoryView":959
22629  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
22630  *
22631  *     return 1             # <<<<<<<<<<<<<<
22632  *
22633  *
22634  */
22635   __pyx_r = 1;
22636   goto __pyx_L0;
22637 
22638   /* "View.MemoryView":943
22639  *
22640  * @cname('__pyx_memslice_transpose')
22641  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
22642  *     cdef int ndim = memslice.memview.view.ndim
22643  *
22644  */
22645 
22646   /* function exit code */
22647   __pyx_L1_error:;
22648   {
22649     #ifdef WITH_THREAD
22650     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22651     #endif
22652     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22653     #ifdef WITH_THREAD
22654     __Pyx_PyGILState_Release(__pyx_gilstate_save);
22655     #endif
22656   }
22657   __pyx_r = 0;
22658   __pyx_L0:;
22659   return __pyx_r;
22660 }
22661 
22662 /* "View.MemoryView":976
22663  *     cdef int (*to_dtype_func)(char *, object) except 0
22664  *
22665  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
22666  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
22667  *
22668  */
22669 
22670 /* Python wrapper */
22671 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)22672 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
22673   __Pyx_RefNannyDeclarations
22674   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
22675   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
22676 
22677   /* function exit code */
22678   __Pyx_RefNannyFinishContext();
22679 }
22680 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)22681 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
22682   __Pyx_RefNannyDeclarations
22683   __Pyx_RefNannySetupContext("__dealloc__", 0);
22684 
22685   /* "View.MemoryView":977
22686  *
22687  *     def __dealloc__(self):
22688  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
22689  *
22690  *     cdef convert_item_to_object(self, char *itemp):
22691  */
22692   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
22693 
22694   /* "View.MemoryView":976
22695  *     cdef int (*to_dtype_func)(char *, object) except 0
22696  *
22697  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
22698  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
22699  *
22700  */
22701 
22702   /* function exit code */
22703   __Pyx_RefNannyFinishContext();
22704 }
22705 
22706 /* "View.MemoryView":979
22707  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
22708  *
22709  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
22710  *         if self.to_object_func != NULL:
22711  *             return self.to_object_func(itemp)
22712  */
22713 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)22714 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
22715   PyObject *__pyx_r = NULL;
22716   __Pyx_RefNannyDeclarations
22717   int __pyx_t_1;
22718   PyObject *__pyx_t_2 = NULL;
22719   int __pyx_lineno = 0;
22720   const char *__pyx_filename = NULL;
22721   int __pyx_clineno = 0;
22722   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
22723 
22724   /* "View.MemoryView":980
22725  *
22726  *     cdef convert_item_to_object(self, char *itemp):
22727  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
22728  *             return self.to_object_func(itemp)
22729  *         else:
22730  */
22731   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
22732   if (__pyx_t_1) {
22733 
22734     /* "View.MemoryView":981
22735  *     cdef convert_item_to_object(self, char *itemp):
22736  *         if self.to_object_func != NULL:
22737  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
22738  *         else:
22739  *             return memoryview.convert_item_to_object(self, itemp)
22740  */
22741     __Pyx_XDECREF(__pyx_r);
22742     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
22743     __Pyx_GOTREF(__pyx_t_2);
22744     __pyx_r = __pyx_t_2;
22745     __pyx_t_2 = 0;
22746     goto __pyx_L0;
22747 
22748     /* "View.MemoryView":980
22749  *
22750  *     cdef convert_item_to_object(self, char *itemp):
22751  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
22752  *             return self.to_object_func(itemp)
22753  *         else:
22754  */
22755   }
22756 
22757   /* "View.MemoryView":983
22758  *             return self.to_object_func(itemp)
22759  *         else:
22760  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
22761  *
22762  *     cdef assign_item_from_object(self, char *itemp, object value):
22763  */
22764   /*else*/ {
22765     __Pyx_XDECREF(__pyx_r);
22766     __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
22767     __Pyx_GOTREF(__pyx_t_2);
22768     __pyx_r = __pyx_t_2;
22769     __pyx_t_2 = 0;
22770     goto __pyx_L0;
22771   }
22772 
22773   /* "View.MemoryView":979
22774  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
22775  *
22776  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
22777  *         if self.to_object_func != NULL:
22778  *             return self.to_object_func(itemp)
22779  */
22780 
22781   /* function exit code */
22782   __pyx_L1_error:;
22783   __Pyx_XDECREF(__pyx_t_2);
22784   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
22785   __pyx_r = 0;
22786   __pyx_L0:;
22787   __Pyx_XGIVEREF(__pyx_r);
22788   __Pyx_RefNannyFinishContext();
22789   return __pyx_r;
22790 }
22791 
22792 /* "View.MemoryView":985
22793  *             return memoryview.convert_item_to_object(self, itemp)
22794  *
22795  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
22796  *         if self.to_dtype_func != NULL:
22797  *             self.to_dtype_func(itemp, value)
22798  */
22799 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)22800 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
22801   PyObject *__pyx_r = NULL;
22802   __Pyx_RefNannyDeclarations
22803   int __pyx_t_1;
22804   int __pyx_t_2;
22805   PyObject *__pyx_t_3 = NULL;
22806   int __pyx_lineno = 0;
22807   const char *__pyx_filename = NULL;
22808   int __pyx_clineno = 0;
22809   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
22810 
22811   /* "View.MemoryView":986
22812  *
22813  *     cdef assign_item_from_object(self, char *itemp, object value):
22814  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
22815  *             self.to_dtype_func(itemp, value)
22816  *         else:
22817  */
22818   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
22819   if (__pyx_t_1) {
22820 
22821     /* "View.MemoryView":987
22822  *     cdef assign_item_from_object(self, char *itemp, object value):
22823  *         if self.to_dtype_func != NULL:
22824  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
22825  *         else:
22826  *             memoryview.assign_item_from_object(self, itemp, value)
22827  */
22828     __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error)
22829 
22830     /* "View.MemoryView":986
22831  *
22832  *     cdef assign_item_from_object(self, char *itemp, object value):
22833  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
22834  *             self.to_dtype_func(itemp, value)
22835  *         else:
22836  */
22837     goto __pyx_L3;
22838   }
22839 
22840   /* "View.MemoryView":989
22841  *             self.to_dtype_func(itemp, value)
22842  *         else:
22843  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
22844  *
22845  *     @property
22846  */
22847   /*else*/ {
22848     __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error)
22849     __Pyx_GOTREF(__pyx_t_3);
22850     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22851   }
22852   __pyx_L3:;
22853 
22854   /* "View.MemoryView":985
22855  *             return memoryview.convert_item_to_object(self, itemp)
22856  *
22857  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
22858  *         if self.to_dtype_func != NULL:
22859  *             self.to_dtype_func(itemp, value)
22860  */
22861 
22862   /* function exit code */
22863   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22864   goto __pyx_L0;
22865   __pyx_L1_error:;
22866   __Pyx_XDECREF(__pyx_t_3);
22867   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
22868   __pyx_r = 0;
22869   __pyx_L0:;
22870   __Pyx_XGIVEREF(__pyx_r);
22871   __Pyx_RefNannyFinishContext();
22872   return __pyx_r;
22873 }
22874 
22875 /* "View.MemoryView":992
22876  *
22877  *     @property
22878  *     def base(self):             # <<<<<<<<<<<<<<
22879  *         return self.from_object
22880  *
22881  */
22882 
22883 /* Python wrapper */
22884 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject * __pyx_v_self)22885 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
22886   PyObject *__pyx_r = 0;
22887   __Pyx_RefNannyDeclarations
22888   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22889   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
22890 
22891   /* function exit code */
22892   __Pyx_RefNannyFinishContext();
22893   return __pyx_r;
22894 }
22895 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)22896 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
22897   PyObject *__pyx_r = NULL;
22898   __Pyx_RefNannyDeclarations
22899   __Pyx_RefNannySetupContext("__get__", 0);
22900 
22901   /* "View.MemoryView":993
22902  *     @property
22903  *     def base(self):
22904  *         return self.from_object             # <<<<<<<<<<<<<<
22905  *
22906  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
22907  */
22908   __Pyx_XDECREF(__pyx_r);
22909   __Pyx_INCREF(__pyx_v_self->from_object);
22910   __pyx_r = __pyx_v_self->from_object;
22911   goto __pyx_L0;
22912 
22913   /* "View.MemoryView":992
22914  *
22915  *     @property
22916  *     def base(self):             # <<<<<<<<<<<<<<
22917  *         return self.from_object
22918  *
22919  */
22920 
22921   /* function exit code */
22922   __pyx_L0:;
22923   __Pyx_XGIVEREF(__pyx_r);
22924   __Pyx_RefNannyFinishContext();
22925   return __pyx_r;
22926 }
22927 
22928 /* "(tree fragment)":1
22929  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
22930  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22931  * def __setstate_cython__(self, __pyx_state):
22932  */
22933 
22934 /* Python wrapper */
22935 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)22936 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22937   PyObject *__pyx_r = 0;
22938   __Pyx_RefNannyDeclarations
22939   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
22940   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
22941 
22942   /* function exit code */
22943   __Pyx_RefNannyFinishContext();
22944   return __pyx_r;
22945 }
22946 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)22947 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
22948   PyObject *__pyx_r = NULL;
22949   __Pyx_RefNannyDeclarations
22950   PyObject *__pyx_t_1 = NULL;
22951   int __pyx_lineno = 0;
22952   const char *__pyx_filename = NULL;
22953   int __pyx_clineno = 0;
22954   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
22955 
22956   /* "(tree fragment)":2
22957  * def __reduce_cython__(self):
22958  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
22959  * def __setstate_cython__(self, __pyx_state):
22960  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22961  */
22962   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
22963   __Pyx_GOTREF(__pyx_t_1);
22964   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22965   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22966   __PYX_ERR(2, 2, __pyx_L1_error)
22967 
22968   /* "(tree fragment)":1
22969  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
22970  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22971  * def __setstate_cython__(self, __pyx_state):
22972  */
22973 
22974   /* function exit code */
22975   __pyx_L1_error:;
22976   __Pyx_XDECREF(__pyx_t_1);
22977   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22978   __pyx_r = NULL;
22979   __Pyx_XGIVEREF(__pyx_r);
22980   __Pyx_RefNannyFinishContext();
22981   return __pyx_r;
22982 }
22983 
22984 /* "(tree fragment)":3
22985  * def __reduce_cython__(self):
22986  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22987  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
22988  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22989  */
22990 
22991 /* Python wrapper */
22992 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)22993 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22994   PyObject *__pyx_r = 0;
22995   __Pyx_RefNannyDeclarations
22996   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
22997   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
22998 
22999   /* function exit code */
23000   __Pyx_RefNannyFinishContext();
23001   return __pyx_r;
23002 }
23003 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)23004 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
23005   PyObject *__pyx_r = NULL;
23006   __Pyx_RefNannyDeclarations
23007   PyObject *__pyx_t_1 = NULL;
23008   int __pyx_lineno = 0;
23009   const char *__pyx_filename = NULL;
23010   int __pyx_clineno = 0;
23011   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
23012 
23013   /* "(tree fragment)":4
23014  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23015  * def __setstate_cython__(self, __pyx_state):
23016  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
23017  */
23018   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
23019   __Pyx_GOTREF(__pyx_t_1);
23020   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23021   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23022   __PYX_ERR(2, 4, __pyx_L1_error)
23023 
23024   /* "(tree fragment)":3
23025  * def __reduce_cython__(self):
23026  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23027  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
23028  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23029  */
23030 
23031   /* function exit code */
23032   __pyx_L1_error:;
23033   __Pyx_XDECREF(__pyx_t_1);
23034   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23035   __pyx_r = NULL;
23036   __Pyx_XGIVEREF(__pyx_r);
23037   __Pyx_RefNannyFinishContext();
23038   return __pyx_r;
23039 }
23040 
23041 /* "View.MemoryView":999
23042  *
23043  * @cname('__pyx_memoryview_fromslice')
23044  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
23045  *                           int ndim,
23046  *                           object (*to_object_func)(char *),
23047  */
23048 
__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,int __pyx_v_ndim,PyObject * (* __pyx_v_to_object_func)(char *),int (* __pyx_v_to_dtype_func)(char *,PyObject *),int __pyx_v_dtype_is_object)23049 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
23050   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
23051   Py_ssize_t __pyx_v_suboffset;
23052   PyObject *__pyx_v_length = NULL;
23053   PyObject *__pyx_r = NULL;
23054   __Pyx_RefNannyDeclarations
23055   int __pyx_t_1;
23056   PyObject *__pyx_t_2 = NULL;
23057   PyObject *__pyx_t_3 = NULL;
23058   __Pyx_TypeInfo *__pyx_t_4;
23059   Py_buffer __pyx_t_5;
23060   Py_ssize_t *__pyx_t_6;
23061   Py_ssize_t *__pyx_t_7;
23062   Py_ssize_t *__pyx_t_8;
23063   Py_ssize_t __pyx_t_9;
23064   int __pyx_lineno = 0;
23065   const char *__pyx_filename = NULL;
23066   int __pyx_clineno = 0;
23067   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
23068 
23069   /* "View.MemoryView":1007
23070  *     cdef _memoryviewslice result
23071  *
23072  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
23073  *         return None
23074  *
23075  */
23076   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
23077   if (__pyx_t_1) {
23078 
23079     /* "View.MemoryView":1008
23080  *
23081  *     if <PyObject *> memviewslice.memview == Py_None:
23082  *         return None             # <<<<<<<<<<<<<<
23083  *
23084  *
23085  */
23086     __Pyx_XDECREF(__pyx_r);
23087     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23088     goto __pyx_L0;
23089 
23090     /* "View.MemoryView":1007
23091  *     cdef _memoryviewslice result
23092  *
23093  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
23094  *         return None
23095  *
23096  */
23097   }
23098 
23099   /* "View.MemoryView":1013
23100  *
23101  *
23102  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
23103  *
23104  *     result.from_slice = memviewslice
23105  */
23106   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
23107   __Pyx_GOTREF(__pyx_t_2);
23108   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
23109   __Pyx_GOTREF(__pyx_t_3);
23110   __Pyx_INCREF(Py_None);
23111   __Pyx_GIVEREF(Py_None);
23112   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
23113   __Pyx_INCREF(__pyx_int_0);
23114   __Pyx_GIVEREF(__pyx_int_0);
23115   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
23116   __Pyx_GIVEREF(__pyx_t_2);
23117   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
23118   __pyx_t_2 = 0;
23119   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
23120   __Pyx_GOTREF(__pyx_t_2);
23121   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23122   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
23123   __pyx_t_2 = 0;
23124 
23125   /* "View.MemoryView":1015
23126  *     result = _memoryviewslice(None, 0, dtype_is_object)
23127  *
23128  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
23129  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
23130  *
23131  */
23132   __pyx_v_result->from_slice = __pyx_v_memviewslice;
23133 
23134   /* "View.MemoryView":1016
23135  *
23136  *     result.from_slice = memviewslice
23137  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
23138  *
23139  *     result.from_object = (<memoryview> memviewslice.memview).base
23140  */
23141   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
23142 
23143   /* "View.MemoryView":1018
23144  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
23145  *
23146  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
23147  *     result.typeinfo = memviewslice.memview.typeinfo
23148  *
23149  */
23150   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
23151   __Pyx_GOTREF(__pyx_t_2);
23152   __Pyx_GIVEREF(__pyx_t_2);
23153   __Pyx_GOTREF(__pyx_v_result->from_object);
23154   __Pyx_DECREF(__pyx_v_result->from_object);
23155   __pyx_v_result->from_object = __pyx_t_2;
23156   __pyx_t_2 = 0;
23157 
23158   /* "View.MemoryView":1019
23159  *
23160  *     result.from_object = (<memoryview> memviewslice.memview).base
23161  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
23162  *
23163  *     result.view = memviewslice.memview.view
23164  */
23165   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
23166   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
23167 
23168   /* "View.MemoryView":1021
23169  *     result.typeinfo = memviewslice.memview.typeinfo
23170  *
23171  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
23172  *     result.view.buf = <void *> memviewslice.data
23173  *     result.view.ndim = ndim
23174  */
23175   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
23176   __pyx_v_result->__pyx_base.view = __pyx_t_5;
23177 
23178   /* "View.MemoryView":1022
23179  *
23180  *     result.view = memviewslice.memview.view
23181  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
23182  *     result.view.ndim = ndim
23183  *     (<__pyx_buffer *> &result.view).obj = Py_None
23184  */
23185   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
23186 
23187   /* "View.MemoryView":1023
23188  *     result.view = memviewslice.memview.view
23189  *     result.view.buf = <void *> memviewslice.data
23190  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
23191  *     (<__pyx_buffer *> &result.view).obj = Py_None
23192  *     Py_INCREF(Py_None)
23193  */
23194   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
23195 
23196   /* "View.MemoryView":1024
23197  *     result.view.buf = <void *> memviewslice.data
23198  *     result.view.ndim = ndim
23199  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
23200  *     Py_INCREF(Py_None)
23201  *
23202  */
23203   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
23204 
23205   /* "View.MemoryView":1025
23206  *     result.view.ndim = ndim
23207  *     (<__pyx_buffer *> &result.view).obj = Py_None
23208  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
23209  *
23210  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
23211  */
23212   Py_INCREF(Py_None);
23213 
23214   /* "View.MemoryView":1027
23215  *     Py_INCREF(Py_None)
23216  *
23217  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
23218  *         result.flags = PyBUF_RECORDS
23219  *     else:
23220  */
23221   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
23222   if (__pyx_t_1) {
23223 
23224     /* "View.MemoryView":1028
23225  *
23226  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
23227  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
23228  *     else:
23229  *         result.flags = PyBUF_RECORDS_RO
23230  */
23231     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
23232 
23233     /* "View.MemoryView":1027
23234  *     Py_INCREF(Py_None)
23235  *
23236  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
23237  *         result.flags = PyBUF_RECORDS
23238  *     else:
23239  */
23240     goto __pyx_L4;
23241   }
23242 
23243   /* "View.MemoryView":1030
23244  *         result.flags = PyBUF_RECORDS
23245  *     else:
23246  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
23247  *
23248  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
23249  */
23250   /*else*/ {
23251     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
23252   }
23253   __pyx_L4:;
23254 
23255   /* "View.MemoryView":1032
23256  *         result.flags = PyBUF_RECORDS_RO
23257  *
23258  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
23259  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
23260  *
23261  */
23262   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
23263 
23264   /* "View.MemoryView":1033
23265  *
23266  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
23267  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
23268  *
23269  *
23270  */
23271   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
23272 
23273   /* "View.MemoryView":1036
23274  *
23275  *
23276  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
23277  *     for suboffset in result.from_slice.suboffsets[:ndim]:
23278  *         if suboffset >= 0:
23279  */
23280   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
23281 
23282   /* "View.MemoryView":1037
23283  *
23284  *     result.view.suboffsets = NULL
23285  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
23286  *         if suboffset >= 0:
23287  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
23288  */
23289   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
23290   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
23291     __pyx_t_6 = __pyx_t_8;
23292     __pyx_v_suboffset = (__pyx_t_6[0]);
23293 
23294     /* "View.MemoryView":1038
23295  *     result.view.suboffsets = NULL
23296  *     for suboffset in result.from_slice.suboffsets[:ndim]:
23297  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
23298  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
23299  *             break
23300  */
23301     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
23302     if (__pyx_t_1) {
23303 
23304       /* "View.MemoryView":1039
23305  *     for suboffset in result.from_slice.suboffsets[:ndim]:
23306  *         if suboffset >= 0:
23307  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
23308  *             break
23309  *
23310  */
23311       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
23312 
23313       /* "View.MemoryView":1040
23314  *         if suboffset >= 0:
23315  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
23316  *             break             # <<<<<<<<<<<<<<
23317  *
23318  *     result.view.len = result.view.itemsize
23319  */
23320       goto __pyx_L6_break;
23321 
23322       /* "View.MemoryView":1038
23323  *     result.view.suboffsets = NULL
23324  *     for suboffset in result.from_slice.suboffsets[:ndim]:
23325  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
23326  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
23327  *             break
23328  */
23329     }
23330   }
23331   __pyx_L6_break:;
23332 
23333   /* "View.MemoryView":1042
23334  *             break
23335  *
23336  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
23337  *     for length in result.view.shape[:ndim]:
23338  *         result.view.len *= length
23339  */
23340   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
23341   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
23342 
23343   /* "View.MemoryView":1043
23344  *
23345  *     result.view.len = result.view.itemsize
23346  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
23347  *         result.view.len *= length
23348  *
23349  */
23350   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
23351   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
23352     __pyx_t_6 = __pyx_t_8;
23353     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
23354     __Pyx_GOTREF(__pyx_t_2);
23355     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
23356     __pyx_t_2 = 0;
23357 
23358     /* "View.MemoryView":1044
23359  *     result.view.len = result.view.itemsize
23360  *     for length in result.view.shape[:ndim]:
23361  *         result.view.len *= length             # <<<<<<<<<<<<<<
23362  *
23363  *     result.to_object_func = to_object_func
23364  */
23365     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
23366     __Pyx_GOTREF(__pyx_t_2);
23367     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
23368     __Pyx_GOTREF(__pyx_t_3);
23369     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23370     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
23371     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23372     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
23373   }
23374 
23375   /* "View.MemoryView":1046
23376  *         result.view.len *= length
23377  *
23378  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
23379  *     result.to_dtype_func = to_dtype_func
23380  *
23381  */
23382   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
23383 
23384   /* "View.MemoryView":1047
23385  *
23386  *     result.to_object_func = to_object_func
23387  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
23388  *
23389  *     return result
23390  */
23391   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
23392 
23393   /* "View.MemoryView":1049
23394  *     result.to_dtype_func = to_dtype_func
23395  *
23396  *     return result             # <<<<<<<<<<<<<<
23397  *
23398  * @cname('__pyx_memoryview_get_slice_from_memoryview')
23399  */
23400   __Pyx_XDECREF(__pyx_r);
23401   __Pyx_INCREF(((PyObject *)__pyx_v_result));
23402   __pyx_r = ((PyObject *)__pyx_v_result);
23403   goto __pyx_L0;
23404 
23405   /* "View.MemoryView":999
23406  *
23407  * @cname('__pyx_memoryview_fromslice')
23408  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
23409  *                           int ndim,
23410  *                           object (*to_object_func)(char *),
23411  */
23412 
23413   /* function exit code */
23414   __pyx_L1_error:;
23415   __Pyx_XDECREF(__pyx_t_2);
23416   __Pyx_XDECREF(__pyx_t_3);
23417   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
23418   __pyx_r = 0;
23419   __pyx_L0:;
23420   __Pyx_XDECREF((PyObject *)__pyx_v_result);
23421   __Pyx_XDECREF(__pyx_v_length);
23422   __Pyx_XGIVEREF(__pyx_r);
23423   __Pyx_RefNannyFinishContext();
23424   return __pyx_r;
23425 }
23426 
23427 /* "View.MemoryView":1052
23428  *
23429  * @cname('__pyx_memoryview_get_slice_from_memoryview')
23430  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
23431  *                                                    __Pyx_memviewslice *mslice) except NULL:
23432  *     cdef _memoryviewslice obj
23433  */
23434 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)23435 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
23436   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
23437   __Pyx_memviewslice *__pyx_r;
23438   __Pyx_RefNannyDeclarations
23439   int __pyx_t_1;
23440   int __pyx_t_2;
23441   PyObject *__pyx_t_3 = NULL;
23442   int __pyx_lineno = 0;
23443   const char *__pyx_filename = NULL;
23444   int __pyx_clineno = 0;
23445   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
23446 
23447   /* "View.MemoryView":1055
23448  *                                                    __Pyx_memviewslice *mslice) except NULL:
23449  *     cdef _memoryviewslice obj
23450  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
23451  *         obj = memview
23452  *         return &obj.from_slice
23453  */
23454   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
23455   __pyx_t_2 = (__pyx_t_1 != 0);
23456   if (__pyx_t_2) {
23457 
23458     /* "View.MemoryView":1056
23459  *     cdef _memoryviewslice obj
23460  *     if isinstance(memview, _memoryviewslice):
23461  *         obj = memview             # <<<<<<<<<<<<<<
23462  *         return &obj.from_slice
23463  *     else:
23464  */
23465     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
23466     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
23467     __Pyx_INCREF(__pyx_t_3);
23468     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
23469     __pyx_t_3 = 0;
23470 
23471     /* "View.MemoryView":1057
23472  *     if isinstance(memview, _memoryviewslice):
23473  *         obj = memview
23474  *         return &obj.from_slice             # <<<<<<<<<<<<<<
23475  *     else:
23476  *         slice_copy(memview, mslice)
23477  */
23478     __pyx_r = (&__pyx_v_obj->from_slice);
23479     goto __pyx_L0;
23480 
23481     /* "View.MemoryView":1055
23482  *                                                    __Pyx_memviewslice *mslice) except NULL:
23483  *     cdef _memoryviewslice obj
23484  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
23485  *         obj = memview
23486  *         return &obj.from_slice
23487  */
23488   }
23489 
23490   /* "View.MemoryView":1059
23491  *         return &obj.from_slice
23492  *     else:
23493  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
23494  *         return mslice
23495  *
23496  */
23497   /*else*/ {
23498     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
23499 
23500     /* "View.MemoryView":1060
23501  *     else:
23502  *         slice_copy(memview, mslice)
23503  *         return mslice             # <<<<<<<<<<<<<<
23504  *
23505  * @cname('__pyx_memoryview_slice_copy')
23506  */
23507     __pyx_r = __pyx_v_mslice;
23508     goto __pyx_L0;
23509   }
23510 
23511   /* "View.MemoryView":1052
23512  *
23513  * @cname('__pyx_memoryview_get_slice_from_memoryview')
23514  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
23515  *                                                    __Pyx_memviewslice *mslice) except NULL:
23516  *     cdef _memoryviewslice obj
23517  */
23518 
23519   /* function exit code */
23520   __pyx_L1_error:;
23521   __Pyx_XDECREF(__pyx_t_3);
23522   __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
23523   __pyx_r = NULL;
23524   __pyx_L0:;
23525   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
23526   __Pyx_RefNannyFinishContext();
23527   return __pyx_r;
23528 }
23529 
23530 /* "View.MemoryView":1063
23531  *
23532  * @cname('__pyx_memoryview_slice_copy')
23533  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
23534  *     cdef int dim
23535  *     cdef (Py_ssize_t*) shape, strides, suboffsets
23536  */
23537 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)23538 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
23539   int __pyx_v_dim;
23540   Py_ssize_t *__pyx_v_shape;
23541   Py_ssize_t *__pyx_v_strides;
23542   Py_ssize_t *__pyx_v_suboffsets;
23543   __Pyx_RefNannyDeclarations
23544   Py_ssize_t *__pyx_t_1;
23545   int __pyx_t_2;
23546   int __pyx_t_3;
23547   int __pyx_t_4;
23548   Py_ssize_t __pyx_t_5;
23549   __Pyx_RefNannySetupContext("slice_copy", 0);
23550 
23551   /* "View.MemoryView":1067
23552  *     cdef (Py_ssize_t*) shape, strides, suboffsets
23553  *
23554  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
23555  *     strides = memview.view.strides
23556  *     suboffsets = memview.view.suboffsets
23557  */
23558   __pyx_t_1 = __pyx_v_memview->view.shape;
23559   __pyx_v_shape = __pyx_t_1;
23560 
23561   /* "View.MemoryView":1068
23562  *
23563  *     shape = memview.view.shape
23564  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
23565  *     suboffsets = memview.view.suboffsets
23566  *
23567  */
23568   __pyx_t_1 = __pyx_v_memview->view.strides;
23569   __pyx_v_strides = __pyx_t_1;
23570 
23571   /* "View.MemoryView":1069
23572  *     shape = memview.view.shape
23573  *     strides = memview.view.strides
23574  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
23575  *
23576  *     dst.memview = <__pyx_memoryview *> memview
23577  */
23578   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
23579   __pyx_v_suboffsets = __pyx_t_1;
23580 
23581   /* "View.MemoryView":1071
23582  *     suboffsets = memview.view.suboffsets
23583  *
23584  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
23585  *     dst.data = <char *> memview.view.buf
23586  *
23587  */
23588   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
23589 
23590   /* "View.MemoryView":1072
23591  *
23592  *     dst.memview = <__pyx_memoryview *> memview
23593  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
23594  *
23595  *     for dim in range(memview.view.ndim):
23596  */
23597   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
23598 
23599   /* "View.MemoryView":1074
23600  *     dst.data = <char *> memview.view.buf
23601  *
23602  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
23603  *         dst.shape[dim] = shape[dim]
23604  *         dst.strides[dim] = strides[dim]
23605  */
23606   __pyx_t_2 = __pyx_v_memview->view.ndim;
23607   __pyx_t_3 = __pyx_t_2;
23608   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23609     __pyx_v_dim = __pyx_t_4;
23610 
23611     /* "View.MemoryView":1075
23612  *
23613  *     for dim in range(memview.view.ndim):
23614  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
23615  *         dst.strides[dim] = strides[dim]
23616  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
23617  */
23618     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
23619 
23620     /* "View.MemoryView":1076
23621  *     for dim in range(memview.view.ndim):
23622  *         dst.shape[dim] = shape[dim]
23623  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
23624  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
23625  *
23626  */
23627     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
23628 
23629     /* "View.MemoryView":1077
23630  *         dst.shape[dim] = shape[dim]
23631  *         dst.strides[dim] = strides[dim]
23632  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
23633  *
23634  * @cname('__pyx_memoryview_copy_object')
23635  */
23636     if ((__pyx_v_suboffsets != 0)) {
23637       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
23638     } else {
23639       __pyx_t_5 = -1L;
23640     }
23641     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
23642   }
23643 
23644   /* "View.MemoryView":1063
23645  *
23646  * @cname('__pyx_memoryview_slice_copy')
23647  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
23648  *     cdef int dim
23649  *     cdef (Py_ssize_t*) shape, strides, suboffsets
23650  */
23651 
23652   /* function exit code */
23653   __Pyx_RefNannyFinishContext();
23654 }
23655 
23656 /* "View.MemoryView":1080
23657  *
23658  * @cname('__pyx_memoryview_copy_object')
23659  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
23660  *     "Create a new memoryview object"
23661  *     cdef __Pyx_memviewslice memviewslice
23662  */
23663 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)23664 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
23665   __Pyx_memviewslice __pyx_v_memviewslice;
23666   PyObject *__pyx_r = NULL;
23667   __Pyx_RefNannyDeclarations
23668   PyObject *__pyx_t_1 = NULL;
23669   int __pyx_lineno = 0;
23670   const char *__pyx_filename = NULL;
23671   int __pyx_clineno = 0;
23672   __Pyx_RefNannySetupContext("memoryview_copy", 0);
23673 
23674   /* "View.MemoryView":1083
23675  *     "Create a new memoryview object"
23676  *     cdef __Pyx_memviewslice memviewslice
23677  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
23678  *     return memoryview_copy_from_slice(memview, &memviewslice)
23679  *
23680  */
23681   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
23682 
23683   /* "View.MemoryView":1084
23684  *     cdef __Pyx_memviewslice memviewslice
23685  *     slice_copy(memview, &memviewslice)
23686  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
23687  *
23688  * @cname('__pyx_memoryview_copy_object_from_slice')
23689  */
23690   __Pyx_XDECREF(__pyx_r);
23691   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
23692   __Pyx_GOTREF(__pyx_t_1);
23693   __pyx_r = __pyx_t_1;
23694   __pyx_t_1 = 0;
23695   goto __pyx_L0;
23696 
23697   /* "View.MemoryView":1080
23698  *
23699  * @cname('__pyx_memoryview_copy_object')
23700  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
23701  *     "Create a new memoryview object"
23702  *     cdef __Pyx_memviewslice memviewslice
23703  */
23704 
23705   /* function exit code */
23706   __pyx_L1_error:;
23707   __Pyx_XDECREF(__pyx_t_1);
23708   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
23709   __pyx_r = 0;
23710   __pyx_L0:;
23711   __Pyx_XGIVEREF(__pyx_r);
23712   __Pyx_RefNannyFinishContext();
23713   return __pyx_r;
23714 }
23715 
23716 /* "View.MemoryView":1087
23717  *
23718  * @cname('__pyx_memoryview_copy_object_from_slice')
23719  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
23720  *     """
23721  *     Create a new memoryview object from a given memoryview object and slice.
23722  */
23723 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)23724 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
23725   PyObject *(*__pyx_v_to_object_func)(char *);
23726   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
23727   PyObject *__pyx_r = NULL;
23728   __Pyx_RefNannyDeclarations
23729   int __pyx_t_1;
23730   int __pyx_t_2;
23731   PyObject *(*__pyx_t_3)(char *);
23732   int (*__pyx_t_4)(char *, PyObject *);
23733   PyObject *__pyx_t_5 = NULL;
23734   int __pyx_lineno = 0;
23735   const char *__pyx_filename = NULL;
23736   int __pyx_clineno = 0;
23737   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
23738 
23739   /* "View.MemoryView":1094
23740  *     cdef int (*to_dtype_func)(char *, object) except 0
23741  *
23742  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
23743  *         to_object_func = (<_memoryviewslice> memview).to_object_func
23744  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
23745  */
23746   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
23747   __pyx_t_2 = (__pyx_t_1 != 0);
23748   if (__pyx_t_2) {
23749 
23750     /* "View.MemoryView":1095
23751  *
23752  *     if isinstance(memview, _memoryviewslice):
23753  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
23754  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
23755  *     else:
23756  */
23757     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
23758     __pyx_v_to_object_func = __pyx_t_3;
23759 
23760     /* "View.MemoryView":1096
23761  *     if isinstance(memview, _memoryviewslice):
23762  *         to_object_func = (<_memoryviewslice> memview).to_object_func
23763  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
23764  *     else:
23765  *         to_object_func = NULL
23766  */
23767     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
23768     __pyx_v_to_dtype_func = __pyx_t_4;
23769 
23770     /* "View.MemoryView":1094
23771  *     cdef int (*to_dtype_func)(char *, object) except 0
23772  *
23773  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
23774  *         to_object_func = (<_memoryviewslice> memview).to_object_func
23775  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
23776  */
23777     goto __pyx_L3;
23778   }
23779 
23780   /* "View.MemoryView":1098
23781  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
23782  *     else:
23783  *         to_object_func = NULL             # <<<<<<<<<<<<<<
23784  *         to_dtype_func = NULL
23785  *
23786  */
23787   /*else*/ {
23788     __pyx_v_to_object_func = NULL;
23789 
23790     /* "View.MemoryView":1099
23791  *     else:
23792  *         to_object_func = NULL
23793  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
23794  *
23795  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
23796  */
23797     __pyx_v_to_dtype_func = NULL;
23798   }
23799   __pyx_L3:;
23800 
23801   /* "View.MemoryView":1101
23802  *         to_dtype_func = NULL
23803  *
23804  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
23805  *                                 to_object_func, to_dtype_func,
23806  *                                 memview.dtype_is_object)
23807  */
23808   __Pyx_XDECREF(__pyx_r);
23809 
23810   /* "View.MemoryView":1103
23811  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
23812  *                                 to_object_func, to_dtype_func,
23813  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
23814  *
23815  *
23816  */
23817   __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error)
23818   __Pyx_GOTREF(__pyx_t_5);
23819   __pyx_r = __pyx_t_5;
23820   __pyx_t_5 = 0;
23821   goto __pyx_L0;
23822 
23823   /* "View.MemoryView":1087
23824  *
23825  * @cname('__pyx_memoryview_copy_object_from_slice')
23826  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
23827  *     """
23828  *     Create a new memoryview object from a given memoryview object and slice.
23829  */
23830 
23831   /* function exit code */
23832   __pyx_L1_error:;
23833   __Pyx_XDECREF(__pyx_t_5);
23834   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
23835   __pyx_r = 0;
23836   __pyx_L0:;
23837   __Pyx_XGIVEREF(__pyx_r);
23838   __Pyx_RefNannyFinishContext();
23839   return __pyx_r;
23840 }
23841 
23842 /* "View.MemoryView":1109
23843  *
23844  *
23845  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
23846  *     if arg < 0:
23847  *         return -arg
23848  */
23849 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)23850 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
23851   Py_ssize_t __pyx_r;
23852   int __pyx_t_1;
23853 
23854   /* "View.MemoryView":1110
23855  *
23856  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
23857  *     if arg < 0:             # <<<<<<<<<<<<<<
23858  *         return -arg
23859  *     else:
23860  */
23861   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
23862   if (__pyx_t_1) {
23863 
23864     /* "View.MemoryView":1111
23865  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
23866  *     if arg < 0:
23867  *         return -arg             # <<<<<<<<<<<<<<
23868  *     else:
23869  *         return arg
23870  */
23871     __pyx_r = (-__pyx_v_arg);
23872     goto __pyx_L0;
23873 
23874     /* "View.MemoryView":1110
23875  *
23876  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
23877  *     if arg < 0:             # <<<<<<<<<<<<<<
23878  *         return -arg
23879  *     else:
23880  */
23881   }
23882 
23883   /* "View.MemoryView":1113
23884  *         return -arg
23885  *     else:
23886  *         return arg             # <<<<<<<<<<<<<<
23887  *
23888  * @cname('__pyx_get_best_slice_order')
23889  */
23890   /*else*/ {
23891     __pyx_r = __pyx_v_arg;
23892     goto __pyx_L0;
23893   }
23894 
23895   /* "View.MemoryView":1109
23896  *
23897  *
23898  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
23899  *     if arg < 0:
23900  *         return -arg
23901  */
23902 
23903   /* function exit code */
23904   __pyx_L0:;
23905   return __pyx_r;
23906 }
23907 
23908 /* "View.MemoryView":1116
23909  *
23910  * @cname('__pyx_get_best_slice_order')
23911  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
23912  *     """
23913  *     Figure out the best memory access order for a given slice.
23914  */
23915 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)23916 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
23917   int __pyx_v_i;
23918   Py_ssize_t __pyx_v_c_stride;
23919   Py_ssize_t __pyx_v_f_stride;
23920   char __pyx_r;
23921   int __pyx_t_1;
23922   int __pyx_t_2;
23923   int __pyx_t_3;
23924   int __pyx_t_4;
23925 
23926   /* "View.MemoryView":1121
23927  *     """
23928  *     cdef int i
23929  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
23930  *     cdef Py_ssize_t f_stride = 0
23931  *
23932  */
23933   __pyx_v_c_stride = 0;
23934 
23935   /* "View.MemoryView":1122
23936  *     cdef int i
23937  *     cdef Py_ssize_t c_stride = 0
23938  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
23939  *
23940  *     for i in range(ndim - 1, -1, -1):
23941  */
23942   __pyx_v_f_stride = 0;
23943 
23944   /* "View.MemoryView":1124
23945  *     cdef Py_ssize_t f_stride = 0
23946  *
23947  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
23948  *         if mslice.shape[i] > 1:
23949  *             c_stride = mslice.strides[i]
23950  */
23951   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
23952     __pyx_v_i = __pyx_t_1;
23953 
23954     /* "View.MemoryView":1125
23955  *
23956  *     for i in range(ndim - 1, -1, -1):
23957  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
23958  *             c_stride = mslice.strides[i]
23959  *             break
23960  */
23961     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
23962     if (__pyx_t_2) {
23963 
23964       /* "View.MemoryView":1126
23965  *     for i in range(ndim - 1, -1, -1):
23966  *         if mslice.shape[i] > 1:
23967  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
23968  *             break
23969  *
23970  */
23971       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
23972 
23973       /* "View.MemoryView":1127
23974  *         if mslice.shape[i] > 1:
23975  *             c_stride = mslice.strides[i]
23976  *             break             # <<<<<<<<<<<<<<
23977  *
23978  *     for i in range(ndim):
23979  */
23980       goto __pyx_L4_break;
23981 
23982       /* "View.MemoryView":1125
23983  *
23984  *     for i in range(ndim - 1, -1, -1):
23985  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
23986  *             c_stride = mslice.strides[i]
23987  *             break
23988  */
23989     }
23990   }
23991   __pyx_L4_break:;
23992 
23993   /* "View.MemoryView":1129
23994  *             break
23995  *
23996  *     for i in range(ndim):             # <<<<<<<<<<<<<<
23997  *         if mslice.shape[i] > 1:
23998  *             f_stride = mslice.strides[i]
23999  */
24000   __pyx_t_1 = __pyx_v_ndim;
24001   __pyx_t_3 = __pyx_t_1;
24002   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24003     __pyx_v_i = __pyx_t_4;
24004 
24005     /* "View.MemoryView":1130
24006  *
24007  *     for i in range(ndim):
24008  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
24009  *             f_stride = mslice.strides[i]
24010  *             break
24011  */
24012     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
24013     if (__pyx_t_2) {
24014 
24015       /* "View.MemoryView":1131
24016  *     for i in range(ndim):
24017  *         if mslice.shape[i] > 1:
24018  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
24019  *             break
24020  *
24021  */
24022       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
24023 
24024       /* "View.MemoryView":1132
24025  *         if mslice.shape[i] > 1:
24026  *             f_stride = mslice.strides[i]
24027  *             break             # <<<<<<<<<<<<<<
24028  *
24029  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
24030  */
24031       goto __pyx_L7_break;
24032 
24033       /* "View.MemoryView":1130
24034  *
24035  *     for i in range(ndim):
24036  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
24037  *             f_stride = mslice.strides[i]
24038  *             break
24039  */
24040     }
24041   }
24042   __pyx_L7_break:;
24043 
24044   /* "View.MemoryView":1134
24045  *             break
24046  *
24047  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
24048  *         return 'C'
24049  *     else:
24050  */
24051   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
24052   if (__pyx_t_2) {
24053 
24054     /* "View.MemoryView":1135
24055  *
24056  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
24057  *         return 'C'             # <<<<<<<<<<<<<<
24058  *     else:
24059  *         return 'F'
24060  */
24061     __pyx_r = 'C';
24062     goto __pyx_L0;
24063 
24064     /* "View.MemoryView":1134
24065  *             break
24066  *
24067  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
24068  *         return 'C'
24069  *     else:
24070  */
24071   }
24072 
24073   /* "View.MemoryView":1137
24074  *         return 'C'
24075  *     else:
24076  *         return 'F'             # <<<<<<<<<<<<<<
24077  *
24078  * @cython.cdivision(True)
24079  */
24080   /*else*/ {
24081     __pyx_r = 'F';
24082     goto __pyx_L0;
24083   }
24084 
24085   /* "View.MemoryView":1116
24086  *
24087  * @cname('__pyx_get_best_slice_order')
24088  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
24089  *     """
24090  *     Figure out the best memory access order for a given slice.
24091  */
24092 
24093   /* function exit code */
24094   __pyx_L0:;
24095   return __pyx_r;
24096 }
24097 
24098 /* "View.MemoryView":1140
24099  *
24100  * @cython.cdivision(True)
24101  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
24102  *                                    char *dst_data, Py_ssize_t *dst_strides,
24103  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
24104  */
24105 
_copy_strided_to_strided(char * __pyx_v_src_data,Py_ssize_t * __pyx_v_src_strides,char * __pyx_v_dst_data,Py_ssize_t * __pyx_v_dst_strides,Py_ssize_t * __pyx_v_src_shape,Py_ssize_t * __pyx_v_dst_shape,int __pyx_v_ndim,size_t __pyx_v_itemsize)24106 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
24107   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
24108   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
24109   Py_ssize_t __pyx_v_dst_extent;
24110   Py_ssize_t __pyx_v_src_stride;
24111   Py_ssize_t __pyx_v_dst_stride;
24112   int __pyx_t_1;
24113   int __pyx_t_2;
24114   int __pyx_t_3;
24115   Py_ssize_t __pyx_t_4;
24116   Py_ssize_t __pyx_t_5;
24117   Py_ssize_t __pyx_t_6;
24118 
24119   /* "View.MemoryView":1147
24120  *
24121  *     cdef Py_ssize_t i
24122  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
24123  *     cdef Py_ssize_t dst_extent = dst_shape[0]
24124  *     cdef Py_ssize_t src_stride = src_strides[0]
24125  */
24126   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
24127 
24128   /* "View.MemoryView":1148
24129  *     cdef Py_ssize_t i
24130  *     cdef Py_ssize_t src_extent = src_shape[0]
24131  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
24132  *     cdef Py_ssize_t src_stride = src_strides[0]
24133  *     cdef Py_ssize_t dst_stride = dst_strides[0]
24134  */
24135   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
24136 
24137   /* "View.MemoryView":1149
24138  *     cdef Py_ssize_t src_extent = src_shape[0]
24139  *     cdef Py_ssize_t dst_extent = dst_shape[0]
24140  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
24141  *     cdef Py_ssize_t dst_stride = dst_strides[0]
24142  *
24143  */
24144   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
24145 
24146   /* "View.MemoryView":1150
24147  *     cdef Py_ssize_t dst_extent = dst_shape[0]
24148  *     cdef Py_ssize_t src_stride = src_strides[0]
24149  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
24150  *
24151  *     if ndim == 1:
24152  */
24153   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
24154 
24155   /* "View.MemoryView":1152
24156  *     cdef Py_ssize_t dst_stride = dst_strides[0]
24157  *
24158  *     if ndim == 1:             # <<<<<<<<<<<<<<
24159  *        if (src_stride > 0 and dst_stride > 0 and
24160  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
24161  */
24162   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
24163   if (__pyx_t_1) {
24164 
24165     /* "View.MemoryView":1153
24166  *
24167  *     if ndim == 1:
24168  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
24169  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
24170  *            memcpy(dst_data, src_data, itemsize * dst_extent)
24171  */
24172     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
24173     if (__pyx_t_2) {
24174     } else {
24175       __pyx_t_1 = __pyx_t_2;
24176       goto __pyx_L5_bool_binop_done;
24177     }
24178     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
24179     if (__pyx_t_2) {
24180     } else {
24181       __pyx_t_1 = __pyx_t_2;
24182       goto __pyx_L5_bool_binop_done;
24183     }
24184 
24185     /* "View.MemoryView":1154
24186  *     if ndim == 1:
24187  *        if (src_stride > 0 and dst_stride > 0 and
24188  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
24189  *            memcpy(dst_data, src_data, itemsize * dst_extent)
24190  *        else:
24191  */
24192     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
24193     if (__pyx_t_2) {
24194       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
24195     }
24196     __pyx_t_3 = (__pyx_t_2 != 0);
24197     __pyx_t_1 = __pyx_t_3;
24198     __pyx_L5_bool_binop_done:;
24199 
24200     /* "View.MemoryView":1153
24201  *
24202  *     if ndim == 1:
24203  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
24204  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
24205  *            memcpy(dst_data, src_data, itemsize * dst_extent)
24206  */
24207     if (__pyx_t_1) {
24208 
24209       /* "View.MemoryView":1155
24210  *        if (src_stride > 0 and dst_stride > 0 and
24211  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
24212  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
24213  *        else:
24214  *            for i in range(dst_extent):
24215  */
24216       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
24217 
24218       /* "View.MemoryView":1153
24219  *
24220  *     if ndim == 1:
24221  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
24222  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
24223  *            memcpy(dst_data, src_data, itemsize * dst_extent)
24224  */
24225       goto __pyx_L4;
24226     }
24227 
24228     /* "View.MemoryView":1157
24229  *            memcpy(dst_data, src_data, itemsize * dst_extent)
24230  *        else:
24231  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
24232  *                memcpy(dst_data, src_data, itemsize)
24233  *                src_data += src_stride
24234  */
24235     /*else*/ {
24236       __pyx_t_4 = __pyx_v_dst_extent;
24237       __pyx_t_5 = __pyx_t_4;
24238       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
24239         __pyx_v_i = __pyx_t_6;
24240 
24241         /* "View.MemoryView":1158
24242  *        else:
24243  *            for i in range(dst_extent):
24244  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
24245  *                src_data += src_stride
24246  *                dst_data += dst_stride
24247  */
24248         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
24249 
24250         /* "View.MemoryView":1159
24251  *            for i in range(dst_extent):
24252  *                memcpy(dst_data, src_data, itemsize)
24253  *                src_data += src_stride             # <<<<<<<<<<<<<<
24254  *                dst_data += dst_stride
24255  *     else:
24256  */
24257         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
24258 
24259         /* "View.MemoryView":1160
24260  *                memcpy(dst_data, src_data, itemsize)
24261  *                src_data += src_stride
24262  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
24263  *     else:
24264  *         for i in range(dst_extent):
24265  */
24266         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
24267       }
24268     }
24269     __pyx_L4:;
24270 
24271     /* "View.MemoryView":1152
24272  *     cdef Py_ssize_t dst_stride = dst_strides[0]
24273  *
24274  *     if ndim == 1:             # <<<<<<<<<<<<<<
24275  *        if (src_stride > 0 and dst_stride > 0 and
24276  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
24277  */
24278     goto __pyx_L3;
24279   }
24280 
24281   /* "View.MemoryView":1162
24282  *                dst_data += dst_stride
24283  *     else:
24284  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
24285  *             _copy_strided_to_strided(src_data, src_strides + 1,
24286  *                                      dst_data, dst_strides + 1,
24287  */
24288   /*else*/ {
24289     __pyx_t_4 = __pyx_v_dst_extent;
24290     __pyx_t_5 = __pyx_t_4;
24291     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
24292       __pyx_v_i = __pyx_t_6;
24293 
24294       /* "View.MemoryView":1163
24295  *     else:
24296  *         for i in range(dst_extent):
24297  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
24298  *                                      dst_data, dst_strides + 1,
24299  *                                      src_shape + 1, dst_shape + 1,
24300  */
24301       _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
24302 
24303       /* "View.MemoryView":1167
24304  *                                      src_shape + 1, dst_shape + 1,
24305  *                                      ndim - 1, itemsize)
24306  *             src_data += src_stride             # <<<<<<<<<<<<<<
24307  *             dst_data += dst_stride
24308  *
24309  */
24310       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
24311 
24312       /* "View.MemoryView":1168
24313  *                                      ndim - 1, itemsize)
24314  *             src_data += src_stride
24315  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
24316  *
24317  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
24318  */
24319       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
24320     }
24321   }
24322   __pyx_L3:;
24323 
24324   /* "View.MemoryView":1140
24325  *
24326  * @cython.cdivision(True)
24327  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
24328  *                                    char *dst_data, Py_ssize_t *dst_strides,
24329  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
24330  */
24331 
24332   /* function exit code */
24333 }
24334 
24335 /* "View.MemoryView":1170
24336  *             dst_data += dst_stride
24337  *
24338  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
24339  *                                   __Pyx_memviewslice *dst,
24340  *                                   int ndim, size_t itemsize) nogil:
24341  */
24342 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)24343 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
24344 
24345   /* "View.MemoryView":1173
24346  *                                   __Pyx_memviewslice *dst,
24347  *                                   int ndim, size_t itemsize) nogil:
24348  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
24349  *                              src.shape, dst.shape, ndim, itemsize)
24350  *
24351  */
24352   _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
24353 
24354   /* "View.MemoryView":1170
24355  *             dst_data += dst_stride
24356  *
24357  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
24358  *                                   __Pyx_memviewslice *dst,
24359  *                                   int ndim, size_t itemsize) nogil:
24360  */
24361 
24362   /* function exit code */
24363 }
24364 
24365 /* "View.MemoryView":1177
24366  *
24367  * @cname('__pyx_memoryview_slice_get_size')
24368  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
24369  *     "Return the size of the memory occupied by the slice in number of bytes"
24370  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
24371  */
24372 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)24373 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
24374   Py_ssize_t __pyx_v_shape;
24375   Py_ssize_t __pyx_v_size;
24376   Py_ssize_t __pyx_r;
24377   Py_ssize_t __pyx_t_1;
24378   Py_ssize_t *__pyx_t_2;
24379   Py_ssize_t *__pyx_t_3;
24380   Py_ssize_t *__pyx_t_4;
24381 
24382   /* "View.MemoryView":1179
24383  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
24384  *     "Return the size of the memory occupied by the slice in number of bytes"
24385  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
24386  *
24387  *     for shape in src.shape[:ndim]:
24388  */
24389   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
24390   __pyx_v_size = __pyx_t_1;
24391 
24392   /* "View.MemoryView":1181
24393  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
24394  *
24395  *     for shape in src.shape[:ndim]:             # <<<<<<<<<<<<<<
24396  *         size *= shape
24397  *
24398  */
24399   __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
24400   for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
24401     __pyx_t_2 = __pyx_t_4;
24402     __pyx_v_shape = (__pyx_t_2[0]);
24403 
24404     /* "View.MemoryView":1182
24405  *
24406  *     for shape in src.shape[:ndim]:
24407  *         size *= shape             # <<<<<<<<<<<<<<
24408  *
24409  *     return size
24410  */
24411     __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
24412   }
24413 
24414   /* "View.MemoryView":1184
24415  *         size *= shape
24416  *
24417  *     return size             # <<<<<<<<<<<<<<
24418  *
24419  * @cname('__pyx_fill_contig_strides_array')
24420  */
24421   __pyx_r = __pyx_v_size;
24422   goto __pyx_L0;
24423 
24424   /* "View.MemoryView":1177
24425  *
24426  * @cname('__pyx_memoryview_slice_get_size')
24427  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
24428  *     "Return the size of the memory occupied by the slice in number of bytes"
24429  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
24430  */
24431 
24432   /* function exit code */
24433   __pyx_L0:;
24434   return __pyx_r;
24435 }
24436 
24437 /* "View.MemoryView":1187
24438  *
24439  * @cname('__pyx_fill_contig_strides_array')
24440  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
24441  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
24442  *                 int ndim, char order) nogil:
24443  */
24444 
__pyx_fill_contig_strides_array(Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,Py_ssize_t __pyx_v_stride,int __pyx_v_ndim,char __pyx_v_order)24445 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
24446   int __pyx_v_idx;
24447   Py_ssize_t __pyx_r;
24448   int __pyx_t_1;
24449   int __pyx_t_2;
24450   int __pyx_t_3;
24451   int __pyx_t_4;
24452 
24453   /* "View.MemoryView":1196
24454  *     cdef int idx
24455  *
24456  *     if order == 'F':             # <<<<<<<<<<<<<<
24457  *         for idx in range(ndim):
24458  *             strides[idx] = stride
24459  */
24460   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
24461   if (__pyx_t_1) {
24462 
24463     /* "View.MemoryView":1197
24464  *
24465  *     if order == 'F':
24466  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
24467  *             strides[idx] = stride
24468  *             stride *= shape[idx]
24469  */
24470     __pyx_t_2 = __pyx_v_ndim;
24471     __pyx_t_3 = __pyx_t_2;
24472     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24473       __pyx_v_idx = __pyx_t_4;
24474 
24475       /* "View.MemoryView":1198
24476  *     if order == 'F':
24477  *         for idx in range(ndim):
24478  *             strides[idx] = stride             # <<<<<<<<<<<<<<
24479  *             stride *= shape[idx]
24480  *     else:
24481  */
24482       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
24483 
24484       /* "View.MemoryView":1199
24485  *         for idx in range(ndim):
24486  *             strides[idx] = stride
24487  *             stride *= shape[idx]             # <<<<<<<<<<<<<<
24488  *     else:
24489  *         for idx in range(ndim - 1, -1, -1):
24490  */
24491       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
24492     }
24493 
24494     /* "View.MemoryView":1196
24495  *     cdef int idx
24496  *
24497  *     if order == 'F':             # <<<<<<<<<<<<<<
24498  *         for idx in range(ndim):
24499  *             strides[idx] = stride
24500  */
24501     goto __pyx_L3;
24502   }
24503 
24504   /* "View.MemoryView":1201
24505  *             stride *= shape[idx]
24506  *     else:
24507  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
24508  *             strides[idx] = stride
24509  *             stride *= shape[idx]
24510  */
24511   /*else*/ {
24512     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
24513       __pyx_v_idx = __pyx_t_2;
24514 
24515       /* "View.MemoryView":1202
24516  *     else:
24517  *         for idx in range(ndim - 1, -1, -1):
24518  *             strides[idx] = stride             # <<<<<<<<<<<<<<
24519  *             stride *= shape[idx]
24520  *
24521  */
24522       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
24523 
24524       /* "View.MemoryView":1203
24525  *         for idx in range(ndim - 1, -1, -1):
24526  *             strides[idx] = stride
24527  *             stride *= shape[idx]             # <<<<<<<<<<<<<<
24528  *
24529  *     return stride
24530  */
24531       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
24532     }
24533   }
24534   __pyx_L3:;
24535 
24536   /* "View.MemoryView":1205
24537  *             stride *= shape[idx]
24538  *
24539  *     return stride             # <<<<<<<<<<<<<<
24540  *
24541  * @cname('__pyx_memoryview_copy_data_to_temp')
24542  */
24543   __pyx_r = __pyx_v_stride;
24544   goto __pyx_L0;
24545 
24546   /* "View.MemoryView":1187
24547  *
24548  * @cname('__pyx_fill_contig_strides_array')
24549  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
24550  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
24551  *                 int ndim, char order) nogil:
24552  */
24553 
24554   /* function exit code */
24555   __pyx_L0:;
24556   return __pyx_r;
24557 }
24558 
24559 /* "View.MemoryView":1208
24560  *
24561  * @cname('__pyx_memoryview_copy_data_to_temp')
24562  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
24563  *                              __Pyx_memviewslice *tmpslice,
24564  *                              char order,
24565  */
24566 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)24567 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
24568   int __pyx_v_i;
24569   void *__pyx_v_result;
24570   size_t __pyx_v_itemsize;
24571   size_t __pyx_v_size;
24572   void *__pyx_r;
24573   Py_ssize_t __pyx_t_1;
24574   int __pyx_t_2;
24575   int __pyx_t_3;
24576   struct __pyx_memoryview_obj *__pyx_t_4;
24577   int __pyx_t_5;
24578   int __pyx_t_6;
24579   int __pyx_lineno = 0;
24580   const char *__pyx_filename = NULL;
24581   int __pyx_clineno = 0;
24582 
24583   /* "View.MemoryView":1219
24584  *     cdef void *result
24585  *
24586  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
24587  *     cdef size_t size = slice_get_size(src, ndim)
24588  *
24589  */
24590   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
24591   __pyx_v_itemsize = __pyx_t_1;
24592 
24593   /* "View.MemoryView":1220
24594  *
24595  *     cdef size_t itemsize = src.memview.view.itemsize
24596  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
24597  *
24598  *     result = malloc(size)
24599  */
24600   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
24601 
24602   /* "View.MemoryView":1222
24603  *     cdef size_t size = slice_get_size(src, ndim)
24604  *
24605  *     result = malloc(size)             # <<<<<<<<<<<<<<
24606  *     if not result:
24607  *         _err(MemoryError, NULL)
24608  */
24609   __pyx_v_result = malloc(__pyx_v_size);
24610 
24611   /* "View.MemoryView":1223
24612  *
24613  *     result = malloc(size)
24614  *     if not result:             # <<<<<<<<<<<<<<
24615  *         _err(MemoryError, NULL)
24616  *
24617  */
24618   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
24619   if (__pyx_t_2) {
24620 
24621     /* "View.MemoryView":1224
24622  *     result = malloc(size)
24623  *     if not result:
24624  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
24625  *
24626  *
24627  */
24628     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)
24629 
24630     /* "View.MemoryView":1223
24631  *
24632  *     result = malloc(size)
24633  *     if not result:             # <<<<<<<<<<<<<<
24634  *         _err(MemoryError, NULL)
24635  *
24636  */
24637   }
24638 
24639   /* "View.MemoryView":1227
24640  *
24641  *
24642  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
24643  *     tmpslice.memview = src.memview
24644  *     for i in range(ndim):
24645  */
24646   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
24647 
24648   /* "View.MemoryView":1228
24649  *
24650  *     tmpslice.data = <char *> result
24651  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
24652  *     for i in range(ndim):
24653  *         tmpslice.shape[i] = src.shape[i]
24654  */
24655   __pyx_t_4 = __pyx_v_src->memview;
24656   __pyx_v_tmpslice->memview = __pyx_t_4;
24657 
24658   /* "View.MemoryView":1229
24659  *     tmpslice.data = <char *> result
24660  *     tmpslice.memview = src.memview
24661  *     for i in range(ndim):             # <<<<<<<<<<<<<<
24662  *         tmpslice.shape[i] = src.shape[i]
24663  *         tmpslice.suboffsets[i] = -1
24664  */
24665   __pyx_t_3 = __pyx_v_ndim;
24666   __pyx_t_5 = __pyx_t_3;
24667   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
24668     __pyx_v_i = __pyx_t_6;
24669 
24670     /* "View.MemoryView":1230
24671  *     tmpslice.memview = src.memview
24672  *     for i in range(ndim):
24673  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
24674  *         tmpslice.suboffsets[i] = -1
24675  *
24676  */
24677     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
24678 
24679     /* "View.MemoryView":1231
24680  *     for i in range(ndim):
24681  *         tmpslice.shape[i] = src.shape[i]
24682  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
24683  *
24684  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
24685  */
24686     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
24687   }
24688 
24689   /* "View.MemoryView":1233
24690  *         tmpslice.suboffsets[i] = -1
24691  *
24692  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
24693  *                               ndim, order)
24694  *
24695  */
24696   (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
24697 
24698   /* "View.MemoryView":1237
24699  *
24700  *
24701  *     for i in range(ndim):             # <<<<<<<<<<<<<<
24702  *         if tmpslice.shape[i] == 1:
24703  *             tmpslice.strides[i] = 0
24704  */
24705   __pyx_t_3 = __pyx_v_ndim;
24706   __pyx_t_5 = __pyx_t_3;
24707   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
24708     __pyx_v_i = __pyx_t_6;
24709 
24710     /* "View.MemoryView":1238
24711  *
24712  *     for i in range(ndim):
24713  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
24714  *             tmpslice.strides[i] = 0
24715  *
24716  */
24717     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
24718     if (__pyx_t_2) {
24719 
24720       /* "View.MemoryView":1239
24721  *     for i in range(ndim):
24722  *         if tmpslice.shape[i] == 1:
24723  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
24724  *
24725  *     if slice_is_contig(src[0], order, ndim):
24726  */
24727       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
24728 
24729       /* "View.MemoryView":1238
24730  *
24731  *     for i in range(ndim):
24732  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
24733  *             tmpslice.strides[i] = 0
24734  *
24735  */
24736     }
24737   }
24738 
24739   /* "View.MemoryView":1241
24740  *             tmpslice.strides[i] = 0
24741  *
24742  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
24743  *         memcpy(result, src.data, size)
24744  *     else:
24745  */
24746   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
24747   if (__pyx_t_2) {
24748 
24749     /* "View.MemoryView":1242
24750  *
24751  *     if slice_is_contig(src[0], order, ndim):
24752  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
24753  *     else:
24754  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
24755  */
24756     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
24757 
24758     /* "View.MemoryView":1241
24759  *             tmpslice.strides[i] = 0
24760  *
24761  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
24762  *         memcpy(result, src.data, size)
24763  *     else:
24764  */
24765     goto __pyx_L9;
24766   }
24767 
24768   /* "View.MemoryView":1244
24769  *         memcpy(result, src.data, size)
24770  *     else:
24771  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
24772  *
24773  *     return result
24774  */
24775   /*else*/ {
24776     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
24777   }
24778   __pyx_L9:;
24779 
24780   /* "View.MemoryView":1246
24781  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
24782  *
24783  *     return result             # <<<<<<<<<<<<<<
24784  *
24785  *
24786  */
24787   __pyx_r = __pyx_v_result;
24788   goto __pyx_L0;
24789 
24790   /* "View.MemoryView":1208
24791  *
24792  * @cname('__pyx_memoryview_copy_data_to_temp')
24793  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
24794  *                              __Pyx_memviewslice *tmpslice,
24795  *                              char order,
24796  */
24797 
24798   /* function exit code */
24799   __pyx_L1_error:;
24800   {
24801     #ifdef WITH_THREAD
24802     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24803     #endif
24804     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
24805     #ifdef WITH_THREAD
24806     __Pyx_PyGILState_Release(__pyx_gilstate_save);
24807     #endif
24808   }
24809   __pyx_r = NULL;
24810   __pyx_L0:;
24811   return __pyx_r;
24812 }
24813 
24814 /* "View.MemoryView":1251
24815  *
24816  * @cname('__pyx_memoryview_err_extents')
24817  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
24818  *                              Py_ssize_t extent2) except -1 with gil:
24819  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
24820  */
24821 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)24822 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
24823   int __pyx_r;
24824   __Pyx_RefNannyDeclarations
24825   PyObject *__pyx_t_1 = NULL;
24826   PyObject *__pyx_t_2 = NULL;
24827   PyObject *__pyx_t_3 = NULL;
24828   PyObject *__pyx_t_4 = NULL;
24829   int __pyx_lineno = 0;
24830   const char *__pyx_filename = NULL;
24831   int __pyx_clineno = 0;
24832   #ifdef WITH_THREAD
24833   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24834   #endif
24835   __Pyx_RefNannySetupContext("_err_extents", 0);
24836 
24837   /* "View.MemoryView":1254
24838  *                              Py_ssize_t extent2) except -1 with gil:
24839  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
24840  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
24841  *
24842  * @cname('__pyx_memoryview_err_dim')
24843  */
24844   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
24845   __Pyx_GOTREF(__pyx_t_1);
24846   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
24847   __Pyx_GOTREF(__pyx_t_2);
24848   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
24849   __Pyx_GOTREF(__pyx_t_3);
24850   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
24851   __Pyx_GOTREF(__pyx_t_4);
24852   __Pyx_GIVEREF(__pyx_t_1);
24853   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
24854   __Pyx_GIVEREF(__pyx_t_2);
24855   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
24856   __Pyx_GIVEREF(__pyx_t_3);
24857   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
24858   __pyx_t_1 = 0;
24859   __pyx_t_2 = 0;
24860   __pyx_t_3 = 0;
24861 
24862   /* "View.MemoryView":1253
24863  * cdef int _err_extents(int i, Py_ssize_t extent1,
24864  *                              Py_ssize_t extent2) except -1 with gil:
24865  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
24866  *                                                         (i, extent1, extent2))
24867  *
24868  */
24869   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
24870   __Pyx_GOTREF(__pyx_t_3);
24871   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24872   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
24873   __Pyx_GOTREF(__pyx_t_4);
24874   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24875   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
24876   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24877   __PYX_ERR(2, 1253, __pyx_L1_error)
24878 
24879   /* "View.MemoryView":1251
24880  *
24881  * @cname('__pyx_memoryview_err_extents')
24882  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
24883  *                              Py_ssize_t extent2) except -1 with gil:
24884  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
24885  */
24886 
24887   /* function exit code */
24888   __pyx_L1_error:;
24889   __Pyx_XDECREF(__pyx_t_1);
24890   __Pyx_XDECREF(__pyx_t_2);
24891   __Pyx_XDECREF(__pyx_t_3);
24892   __Pyx_XDECREF(__pyx_t_4);
24893   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
24894   __pyx_r = -1;
24895   __Pyx_RefNannyFinishContext();
24896   #ifdef WITH_THREAD
24897   __Pyx_PyGILState_Release(__pyx_gilstate_save);
24898   #endif
24899   return __pyx_r;
24900 }
24901 
24902 /* "View.MemoryView":1257
24903  *
24904  * @cname('__pyx_memoryview_err_dim')
24905  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
24906  *     raise error(msg.decode('ascii') % dim)
24907  *
24908  */
24909 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)24910 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
24911   int __pyx_r;
24912   __Pyx_RefNannyDeclarations
24913   PyObject *__pyx_t_1 = NULL;
24914   PyObject *__pyx_t_2 = NULL;
24915   PyObject *__pyx_t_3 = NULL;
24916   PyObject *__pyx_t_4 = NULL;
24917   int __pyx_lineno = 0;
24918   const char *__pyx_filename = NULL;
24919   int __pyx_clineno = 0;
24920   #ifdef WITH_THREAD
24921   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24922   #endif
24923   __Pyx_RefNannySetupContext("_err_dim", 0);
24924   __Pyx_INCREF(__pyx_v_error);
24925 
24926   /* "View.MemoryView":1258
24927  * @cname('__pyx_memoryview_err_dim')
24928  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
24929  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
24930  *
24931  * @cname('__pyx_memoryview_err')
24932  */
24933   __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error)
24934   __Pyx_GOTREF(__pyx_t_2);
24935   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
24936   __Pyx_GOTREF(__pyx_t_3);
24937   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
24938   __Pyx_GOTREF(__pyx_t_4);
24939   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24940   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24941   __Pyx_INCREF(__pyx_v_error);
24942   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
24943   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
24944     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
24945     if (likely(__pyx_t_2)) {
24946       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
24947       __Pyx_INCREF(__pyx_t_2);
24948       __Pyx_INCREF(function);
24949       __Pyx_DECREF_SET(__pyx_t_3, function);
24950     }
24951   }
24952   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
24953   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24954   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24955   if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
24956   __Pyx_GOTREF(__pyx_t_1);
24957   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24958   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
24959   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24960   __PYX_ERR(2, 1258, __pyx_L1_error)
24961 
24962   /* "View.MemoryView":1257
24963  *
24964  * @cname('__pyx_memoryview_err_dim')
24965  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
24966  *     raise error(msg.decode('ascii') % dim)
24967  *
24968  */
24969 
24970   /* function exit code */
24971   __pyx_L1_error:;
24972   __Pyx_XDECREF(__pyx_t_1);
24973   __Pyx_XDECREF(__pyx_t_2);
24974   __Pyx_XDECREF(__pyx_t_3);
24975   __Pyx_XDECREF(__pyx_t_4);
24976   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
24977   __pyx_r = -1;
24978   __Pyx_XDECREF(__pyx_v_error);
24979   __Pyx_RefNannyFinishContext();
24980   #ifdef WITH_THREAD
24981   __Pyx_PyGILState_Release(__pyx_gilstate_save);
24982   #endif
24983   return __pyx_r;
24984 }
24985 
24986 /* "View.MemoryView":1261
24987  *
24988  * @cname('__pyx_memoryview_err')
24989  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
24990  *     if msg != NULL:
24991  *         raise error(msg.decode('ascii'))
24992  */
24993 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)24994 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
24995   int __pyx_r;
24996   __Pyx_RefNannyDeclarations
24997   int __pyx_t_1;
24998   PyObject *__pyx_t_2 = NULL;
24999   PyObject *__pyx_t_3 = NULL;
25000   PyObject *__pyx_t_4 = NULL;
25001   PyObject *__pyx_t_5 = NULL;
25002   int __pyx_lineno = 0;
25003   const char *__pyx_filename = NULL;
25004   int __pyx_clineno = 0;
25005   #ifdef WITH_THREAD
25006   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
25007   #endif
25008   __Pyx_RefNannySetupContext("_err", 0);
25009   __Pyx_INCREF(__pyx_v_error);
25010 
25011   /* "View.MemoryView":1262
25012  * @cname('__pyx_memoryview_err')
25013  * cdef int _err(object error, char *msg) except -1 with gil:
25014  *     if msg != NULL:             # <<<<<<<<<<<<<<
25015  *         raise error(msg.decode('ascii'))
25016  *     else:
25017  */
25018   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
25019   if (unlikely(__pyx_t_1)) {
25020 
25021     /* "View.MemoryView":1263
25022  * cdef int _err(object error, char *msg) except -1 with gil:
25023  *     if msg != NULL:
25024  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
25025  *     else:
25026  *         raise error
25027  */
25028     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error)
25029     __Pyx_GOTREF(__pyx_t_3);
25030     __Pyx_INCREF(__pyx_v_error);
25031     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
25032     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
25033       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
25034       if (likely(__pyx_t_5)) {
25035         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
25036         __Pyx_INCREF(__pyx_t_5);
25037         __Pyx_INCREF(function);
25038         __Pyx_DECREF_SET(__pyx_t_4, function);
25039       }
25040     }
25041     __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
25042     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25043     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25044     if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
25045     __Pyx_GOTREF(__pyx_t_2);
25046     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25047     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
25048     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25049     __PYX_ERR(2, 1263, __pyx_L1_error)
25050 
25051     /* "View.MemoryView":1262
25052  * @cname('__pyx_memoryview_err')
25053  * cdef int _err(object error, char *msg) except -1 with gil:
25054  *     if msg != NULL:             # <<<<<<<<<<<<<<
25055  *         raise error(msg.decode('ascii'))
25056  *     else:
25057  */
25058   }
25059 
25060   /* "View.MemoryView":1265
25061  *         raise error(msg.decode('ascii'))
25062  *     else:
25063  *         raise error             # <<<<<<<<<<<<<<
25064  *
25065  * @cname('__pyx_memoryview_copy_contents')
25066  */
25067   /*else*/ {
25068     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
25069     __PYX_ERR(2, 1265, __pyx_L1_error)
25070   }
25071 
25072   /* "View.MemoryView":1261
25073  *
25074  * @cname('__pyx_memoryview_err')
25075  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
25076  *     if msg != NULL:
25077  *         raise error(msg.decode('ascii'))
25078  */
25079 
25080   /* function exit code */
25081   __pyx_L1_error:;
25082   __Pyx_XDECREF(__pyx_t_2);
25083   __Pyx_XDECREF(__pyx_t_3);
25084   __Pyx_XDECREF(__pyx_t_4);
25085   __Pyx_XDECREF(__pyx_t_5);
25086   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
25087   __pyx_r = -1;
25088   __Pyx_XDECREF(__pyx_v_error);
25089   __Pyx_RefNannyFinishContext();
25090   #ifdef WITH_THREAD
25091   __Pyx_PyGILState_Release(__pyx_gilstate_save);
25092   #endif
25093   return __pyx_r;
25094 }
25095 
25096 /* "View.MemoryView":1268
25097  *
25098  * @cname('__pyx_memoryview_copy_contents')
25099  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
25100  *                                   __Pyx_memviewslice dst,
25101  *                                   int src_ndim, int dst_ndim,
25102  */
25103 
__pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src,__Pyx_memviewslice __pyx_v_dst,int __pyx_v_src_ndim,int __pyx_v_dst_ndim,int __pyx_v_dtype_is_object)25104 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
25105   void *__pyx_v_tmpdata;
25106   size_t __pyx_v_itemsize;
25107   int __pyx_v_i;
25108   char __pyx_v_order;
25109   int __pyx_v_broadcasting;
25110   int __pyx_v_direct_copy;
25111   __Pyx_memviewslice __pyx_v_tmp;
25112   int __pyx_v_ndim;
25113   int __pyx_r;
25114   Py_ssize_t __pyx_t_1;
25115   int __pyx_t_2;
25116   int __pyx_t_3;
25117   int __pyx_t_4;
25118   int __pyx_t_5;
25119   int __pyx_t_6;
25120   void *__pyx_t_7;
25121   int __pyx_t_8;
25122   int __pyx_lineno = 0;
25123   const char *__pyx_filename = NULL;
25124   int __pyx_clineno = 0;
25125 
25126   /* "View.MemoryView":1276
25127  *     Check for overlapping memory and verify the shapes.
25128  *     """
25129  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
25130  *     cdef size_t itemsize = src.memview.view.itemsize
25131  *     cdef int i
25132  */
25133   __pyx_v_tmpdata = NULL;
25134 
25135   /* "View.MemoryView":1277
25136  *     """
25137  *     cdef void *tmpdata = NULL
25138  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
25139  *     cdef int i
25140  *     cdef char order = get_best_order(&src, src_ndim)
25141  */
25142   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
25143   __pyx_v_itemsize = __pyx_t_1;
25144 
25145   /* "View.MemoryView":1279
25146  *     cdef size_t itemsize = src.memview.view.itemsize
25147  *     cdef int i
25148  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
25149  *     cdef bint broadcasting = False
25150  *     cdef bint direct_copy = False
25151  */
25152   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
25153 
25154   /* "View.MemoryView":1280
25155  *     cdef int i
25156  *     cdef char order = get_best_order(&src, src_ndim)
25157  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
25158  *     cdef bint direct_copy = False
25159  *     cdef __Pyx_memviewslice tmp
25160  */
25161   __pyx_v_broadcasting = 0;
25162 
25163   /* "View.MemoryView":1281
25164  *     cdef char order = get_best_order(&src, src_ndim)
25165  *     cdef bint broadcasting = False
25166  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
25167  *     cdef __Pyx_memviewslice tmp
25168  *
25169  */
25170   __pyx_v_direct_copy = 0;
25171 
25172   /* "View.MemoryView":1284
25173  *     cdef __Pyx_memviewslice tmp
25174  *
25175  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
25176  *         broadcast_leading(&src, src_ndim, dst_ndim)
25177  *     elif dst_ndim < src_ndim:
25178  */
25179   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
25180   if (__pyx_t_2) {
25181 
25182     /* "View.MemoryView":1285
25183  *
25184  *     if src_ndim < dst_ndim:
25185  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
25186  *     elif dst_ndim < src_ndim:
25187  *         broadcast_leading(&dst, dst_ndim, src_ndim)
25188  */
25189     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
25190 
25191     /* "View.MemoryView":1284
25192  *     cdef __Pyx_memviewslice tmp
25193  *
25194  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
25195  *         broadcast_leading(&src, src_ndim, dst_ndim)
25196  *     elif dst_ndim < src_ndim:
25197  */
25198     goto __pyx_L3;
25199   }
25200 
25201   /* "View.MemoryView":1286
25202  *     if src_ndim < dst_ndim:
25203  *         broadcast_leading(&src, src_ndim, dst_ndim)
25204  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
25205  *         broadcast_leading(&dst, dst_ndim, src_ndim)
25206  *
25207  */
25208   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
25209   if (__pyx_t_2) {
25210 
25211     /* "View.MemoryView":1287
25212  *         broadcast_leading(&src, src_ndim, dst_ndim)
25213  *     elif dst_ndim < src_ndim:
25214  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
25215  *
25216  *     cdef int ndim = max(src_ndim, dst_ndim)
25217  */
25218     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
25219 
25220     /* "View.MemoryView":1286
25221  *     if src_ndim < dst_ndim:
25222  *         broadcast_leading(&src, src_ndim, dst_ndim)
25223  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
25224  *         broadcast_leading(&dst, dst_ndim, src_ndim)
25225  *
25226  */
25227   }
25228   __pyx_L3:;
25229 
25230   /* "View.MemoryView":1289
25231  *         broadcast_leading(&dst, dst_ndim, src_ndim)
25232  *
25233  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
25234  *
25235  *     for i in range(ndim):
25236  */
25237   __pyx_t_3 = __pyx_v_dst_ndim;
25238   __pyx_t_4 = __pyx_v_src_ndim;
25239   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
25240     __pyx_t_5 = __pyx_t_3;
25241   } else {
25242     __pyx_t_5 = __pyx_t_4;
25243   }
25244   __pyx_v_ndim = __pyx_t_5;
25245 
25246   /* "View.MemoryView":1291
25247  *     cdef int ndim = max(src_ndim, dst_ndim)
25248  *
25249  *     for i in range(ndim):             # <<<<<<<<<<<<<<
25250  *         if src.shape[i] != dst.shape[i]:
25251  *             if src.shape[i] == 1:
25252  */
25253   __pyx_t_5 = __pyx_v_ndim;
25254   __pyx_t_3 = __pyx_t_5;
25255   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
25256     __pyx_v_i = __pyx_t_4;
25257 
25258     /* "View.MemoryView":1292
25259  *
25260  *     for i in range(ndim):
25261  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
25262  *             if src.shape[i] == 1:
25263  *                 broadcasting = True
25264  */
25265     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
25266     if (__pyx_t_2) {
25267 
25268       /* "View.MemoryView":1293
25269  *     for i in range(ndim):
25270  *         if src.shape[i] != dst.shape[i]:
25271  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
25272  *                 broadcasting = True
25273  *                 src.strides[i] = 0
25274  */
25275       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
25276       if (__pyx_t_2) {
25277 
25278         /* "View.MemoryView":1294
25279  *         if src.shape[i] != dst.shape[i]:
25280  *             if src.shape[i] == 1:
25281  *                 broadcasting = True             # <<<<<<<<<<<<<<
25282  *                 src.strides[i] = 0
25283  *             else:
25284  */
25285         __pyx_v_broadcasting = 1;
25286 
25287         /* "View.MemoryView":1295
25288  *             if src.shape[i] == 1:
25289  *                 broadcasting = True
25290  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
25291  *             else:
25292  *                 _err_extents(i, dst.shape[i], src.shape[i])
25293  */
25294         (__pyx_v_src.strides[__pyx_v_i]) = 0;
25295 
25296         /* "View.MemoryView":1293
25297  *     for i in range(ndim):
25298  *         if src.shape[i] != dst.shape[i]:
25299  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
25300  *                 broadcasting = True
25301  *                 src.strides[i] = 0
25302  */
25303         goto __pyx_L7;
25304       }
25305 
25306       /* "View.MemoryView":1297
25307  *                 src.strides[i] = 0
25308  *             else:
25309  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
25310  *
25311  *         if src.suboffsets[i] >= 0:
25312  */
25313       /*else*/ {
25314         __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)
25315       }
25316       __pyx_L7:;
25317 
25318       /* "View.MemoryView":1292
25319  *
25320  *     for i in range(ndim):
25321  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
25322  *             if src.shape[i] == 1:
25323  *                 broadcasting = True
25324  */
25325     }
25326 
25327     /* "View.MemoryView":1299
25328  *                 _err_extents(i, dst.shape[i], src.shape[i])
25329  *
25330  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
25331  *             _err_dim(ValueError, "Dimension %d is not direct", i)
25332  *
25333  */
25334     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
25335     if (__pyx_t_2) {
25336 
25337       /* "View.MemoryView":1300
25338  *
25339  *         if src.suboffsets[i] >= 0:
25340  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
25341  *
25342  *     if slices_overlap(&src, &dst, ndim, itemsize):
25343  */
25344       __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error)
25345 
25346       /* "View.MemoryView":1299
25347  *                 _err_extents(i, dst.shape[i], src.shape[i])
25348  *
25349  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
25350  *             _err_dim(ValueError, "Dimension %d is not direct", i)
25351  *
25352  */
25353     }
25354   }
25355 
25356   /* "View.MemoryView":1302
25357  *             _err_dim(ValueError, "Dimension %d is not direct", i)
25358  *
25359  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
25360  *
25361  *         if not slice_is_contig(src, order, ndim):
25362  */
25363   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
25364   if (__pyx_t_2) {
25365 
25366     /* "View.MemoryView":1304
25367  *     if slices_overlap(&src, &dst, ndim, itemsize):
25368  *
25369  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
25370  *             order = get_best_order(&dst, ndim)
25371  *
25372  */
25373     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
25374     if (__pyx_t_2) {
25375 
25376       /* "View.MemoryView":1305
25377  *
25378  *         if not slice_is_contig(src, order, ndim):
25379  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
25380  *
25381  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
25382  */
25383       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
25384 
25385       /* "View.MemoryView":1304
25386  *     if slices_overlap(&src, &dst, ndim, itemsize):
25387  *
25388  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
25389  *             order = get_best_order(&dst, ndim)
25390  *
25391  */
25392     }
25393 
25394     /* "View.MemoryView":1307
25395  *             order = get_best_order(&dst, ndim)
25396  *
25397  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
25398  *         src = tmp
25399  *
25400  */
25401     __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error)
25402     __pyx_v_tmpdata = __pyx_t_7;
25403 
25404     /* "View.MemoryView":1308
25405  *
25406  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
25407  *         src = tmp             # <<<<<<<<<<<<<<
25408  *
25409  *     if not broadcasting:
25410  */
25411     __pyx_v_src = __pyx_v_tmp;
25412 
25413     /* "View.MemoryView":1302
25414  *             _err_dim(ValueError, "Dimension %d is not direct", i)
25415  *
25416  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
25417  *
25418  *         if not slice_is_contig(src, order, ndim):
25419  */
25420   }
25421 
25422   /* "View.MemoryView":1310
25423  *         src = tmp
25424  *
25425  *     if not broadcasting:             # <<<<<<<<<<<<<<
25426  *
25427  *
25428  */
25429   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
25430   if (__pyx_t_2) {
25431 
25432     /* "View.MemoryView":1313
25433  *
25434  *
25435  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
25436  *             direct_copy = slice_is_contig(dst, 'C', ndim)
25437  *         elif slice_is_contig(src, 'F', ndim):
25438  */
25439     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
25440     if (__pyx_t_2) {
25441 
25442       /* "View.MemoryView":1314
25443  *
25444  *         if slice_is_contig(src, 'C', ndim):
25445  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
25446  *         elif slice_is_contig(src, 'F', ndim):
25447  *             direct_copy = slice_is_contig(dst, 'F', ndim)
25448  */
25449       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
25450 
25451       /* "View.MemoryView":1313
25452  *
25453  *
25454  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
25455  *             direct_copy = slice_is_contig(dst, 'C', ndim)
25456  *         elif slice_is_contig(src, 'F', ndim):
25457  */
25458       goto __pyx_L12;
25459     }
25460 
25461     /* "View.MemoryView":1315
25462  *         if slice_is_contig(src, 'C', ndim):
25463  *             direct_copy = slice_is_contig(dst, 'C', ndim)
25464  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
25465  *             direct_copy = slice_is_contig(dst, 'F', ndim)
25466  *
25467  */
25468     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
25469     if (__pyx_t_2) {
25470 
25471       /* "View.MemoryView":1316
25472  *             direct_copy = slice_is_contig(dst, 'C', ndim)
25473  *         elif slice_is_contig(src, 'F', ndim):
25474  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
25475  *
25476  *         if direct_copy:
25477  */
25478       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
25479 
25480       /* "View.MemoryView":1315
25481  *         if slice_is_contig(src, 'C', ndim):
25482  *             direct_copy = slice_is_contig(dst, 'C', ndim)
25483  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
25484  *             direct_copy = slice_is_contig(dst, 'F', ndim)
25485  *
25486  */
25487     }
25488     __pyx_L12:;
25489 
25490     /* "View.MemoryView":1318
25491  *             direct_copy = slice_is_contig(dst, 'F', ndim)
25492  *
25493  *         if direct_copy:             # <<<<<<<<<<<<<<
25494  *
25495  *             refcount_copying(&dst, dtype_is_object, ndim, False)
25496  */
25497     __pyx_t_2 = (__pyx_v_direct_copy != 0);
25498     if (__pyx_t_2) {
25499 
25500       /* "View.MemoryView":1320
25501  *         if direct_copy:
25502  *
25503  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
25504  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
25505  *             refcount_copying(&dst, dtype_is_object, ndim, True)
25506  */
25507       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
25508 
25509       /* "View.MemoryView":1321
25510  *
25511  *             refcount_copying(&dst, dtype_is_object, ndim, False)
25512  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
25513  *             refcount_copying(&dst, dtype_is_object, ndim, True)
25514  *             free(tmpdata)
25515  */
25516       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
25517 
25518       /* "View.MemoryView":1322
25519  *             refcount_copying(&dst, dtype_is_object, ndim, False)
25520  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
25521  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
25522  *             free(tmpdata)
25523  *             return 0
25524  */
25525       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
25526 
25527       /* "View.MemoryView":1323
25528  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
25529  *             refcount_copying(&dst, dtype_is_object, ndim, True)
25530  *             free(tmpdata)             # <<<<<<<<<<<<<<
25531  *             return 0
25532  *
25533  */
25534       free(__pyx_v_tmpdata);
25535 
25536       /* "View.MemoryView":1324
25537  *             refcount_copying(&dst, dtype_is_object, ndim, True)
25538  *             free(tmpdata)
25539  *             return 0             # <<<<<<<<<<<<<<
25540  *
25541  *     if order == 'F' == get_best_order(&dst, ndim):
25542  */
25543       __pyx_r = 0;
25544       goto __pyx_L0;
25545 
25546       /* "View.MemoryView":1318
25547  *             direct_copy = slice_is_contig(dst, 'F', ndim)
25548  *
25549  *         if direct_copy:             # <<<<<<<<<<<<<<
25550  *
25551  *             refcount_copying(&dst, dtype_is_object, ndim, False)
25552  */
25553     }
25554 
25555     /* "View.MemoryView":1310
25556  *         src = tmp
25557  *
25558  *     if not broadcasting:             # <<<<<<<<<<<<<<
25559  *
25560  *
25561  */
25562   }
25563 
25564   /* "View.MemoryView":1326
25565  *             return 0
25566  *
25567  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
25568  *
25569  *
25570  */
25571   __pyx_t_2 = (__pyx_v_order == 'F');
25572   if (__pyx_t_2) {
25573     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
25574   }
25575   __pyx_t_8 = (__pyx_t_2 != 0);
25576   if (__pyx_t_8) {
25577 
25578     /* "View.MemoryView":1329
25579  *
25580  *
25581  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
25582  *         transpose_memslice(&dst)
25583  *
25584  */
25585     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)
25586 
25587     /* "View.MemoryView":1330
25588  *
25589  *         transpose_memslice(&src)
25590  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
25591  *
25592  *     refcount_copying(&dst, dtype_is_object, ndim, False)
25593  */
25594     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)
25595 
25596     /* "View.MemoryView":1326
25597  *             return 0
25598  *
25599  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
25600  *
25601  *
25602  */
25603   }
25604 
25605   /* "View.MemoryView":1332
25606  *         transpose_memslice(&dst)
25607  *
25608  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
25609  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
25610  *     refcount_copying(&dst, dtype_is_object, ndim, True)
25611  */
25612   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
25613 
25614   /* "View.MemoryView":1333
25615  *
25616  *     refcount_copying(&dst, dtype_is_object, ndim, False)
25617  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
25618  *     refcount_copying(&dst, dtype_is_object, ndim, True)
25619  *
25620  */
25621   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
25622 
25623   /* "View.MemoryView":1334
25624  *     refcount_copying(&dst, dtype_is_object, ndim, False)
25625  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
25626  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
25627  *
25628  *     free(tmpdata)
25629  */
25630   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
25631 
25632   /* "View.MemoryView":1336
25633  *     refcount_copying(&dst, dtype_is_object, ndim, True)
25634  *
25635  *     free(tmpdata)             # <<<<<<<<<<<<<<
25636  *     return 0
25637  *
25638  */
25639   free(__pyx_v_tmpdata);
25640 
25641   /* "View.MemoryView":1337
25642  *
25643  *     free(tmpdata)
25644  *     return 0             # <<<<<<<<<<<<<<
25645  *
25646  * @cname('__pyx_memoryview_broadcast_leading')
25647  */
25648   __pyx_r = 0;
25649   goto __pyx_L0;
25650 
25651   /* "View.MemoryView":1268
25652  *
25653  * @cname('__pyx_memoryview_copy_contents')
25654  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
25655  *                                   __Pyx_memviewslice dst,
25656  *                                   int src_ndim, int dst_ndim,
25657  */
25658 
25659   /* function exit code */
25660   __pyx_L1_error:;
25661   {
25662     #ifdef WITH_THREAD
25663     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
25664     #endif
25665     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
25666     #ifdef WITH_THREAD
25667     __Pyx_PyGILState_Release(__pyx_gilstate_save);
25668     #endif
25669   }
25670   __pyx_r = -1;
25671   __pyx_L0:;
25672   return __pyx_r;
25673 }
25674 
25675 /* "View.MemoryView":1340
25676  *
25677  * @cname('__pyx_memoryview_broadcast_leading')
25678  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
25679  *                             int ndim,
25680  *                             int ndim_other) nogil:
25681  */
25682 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)25683 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
25684   int __pyx_v_i;
25685   int __pyx_v_offset;
25686   int __pyx_t_1;
25687   int __pyx_t_2;
25688   int __pyx_t_3;
25689 
25690   /* "View.MemoryView":1344
25691  *                             int ndim_other) nogil:
25692  *     cdef int i
25693  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
25694  *
25695  *     for i in range(ndim - 1, -1, -1):
25696  */
25697   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
25698 
25699   /* "View.MemoryView":1346
25700  *     cdef int offset = ndim_other - ndim
25701  *
25702  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
25703  *         mslice.shape[i + offset] = mslice.shape[i]
25704  *         mslice.strides[i + offset] = mslice.strides[i]
25705  */
25706   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
25707     __pyx_v_i = __pyx_t_1;
25708 
25709     /* "View.MemoryView":1347
25710  *
25711  *     for i in range(ndim - 1, -1, -1):
25712  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
25713  *         mslice.strides[i + offset] = mslice.strides[i]
25714  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
25715  */
25716     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
25717 
25718     /* "View.MemoryView":1348
25719  *     for i in range(ndim - 1, -1, -1):
25720  *         mslice.shape[i + offset] = mslice.shape[i]
25721  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
25722  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
25723  *
25724  */
25725     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
25726 
25727     /* "View.MemoryView":1349
25728  *         mslice.shape[i + offset] = mslice.shape[i]
25729  *         mslice.strides[i + offset] = mslice.strides[i]
25730  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
25731  *
25732  *     for i in range(offset):
25733  */
25734     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
25735   }
25736 
25737   /* "View.MemoryView":1351
25738  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
25739  *
25740  *     for i in range(offset):             # <<<<<<<<<<<<<<
25741  *         mslice.shape[i] = 1
25742  *         mslice.strides[i] = mslice.strides[0]
25743  */
25744   __pyx_t_1 = __pyx_v_offset;
25745   __pyx_t_2 = __pyx_t_1;
25746   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
25747     __pyx_v_i = __pyx_t_3;
25748 
25749     /* "View.MemoryView":1352
25750  *
25751  *     for i in range(offset):
25752  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
25753  *         mslice.strides[i] = mslice.strides[0]
25754  *         mslice.suboffsets[i] = -1
25755  */
25756     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
25757 
25758     /* "View.MemoryView":1353
25759  *     for i in range(offset):
25760  *         mslice.shape[i] = 1
25761  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
25762  *         mslice.suboffsets[i] = -1
25763  *
25764  */
25765     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
25766 
25767     /* "View.MemoryView":1354
25768  *         mslice.shape[i] = 1
25769  *         mslice.strides[i] = mslice.strides[0]
25770  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
25771  *
25772  *
25773  */
25774     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
25775   }
25776 
25777   /* "View.MemoryView":1340
25778  *
25779  * @cname('__pyx_memoryview_broadcast_leading')
25780  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
25781  *                             int ndim,
25782  *                             int ndim_other) nogil:
25783  */
25784 
25785   /* function exit code */
25786 }
25787 
25788 /* "View.MemoryView":1362
25789  *
25790  * @cname('__pyx_memoryview_refcount_copying')
25791  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
25792  *                            int ndim, bint inc) nogil:
25793  *
25794  */
25795 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)25796 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
25797   int __pyx_t_1;
25798 
25799   /* "View.MemoryView":1366
25800  *
25801  *
25802  *     if dtype_is_object:             # <<<<<<<<<<<<<<
25803  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
25804  *                                            dst.strides, ndim, inc)
25805  */
25806   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
25807   if (__pyx_t_1) {
25808 
25809     /* "View.MemoryView":1367
25810  *
25811  *     if dtype_is_object:
25812  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
25813  *                                            dst.strides, ndim, inc)
25814  *
25815  */
25816     __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
25817 
25818     /* "View.MemoryView":1366
25819  *
25820  *
25821  *     if dtype_is_object:             # <<<<<<<<<<<<<<
25822  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
25823  *                                            dst.strides, ndim, inc)
25824  */
25825   }
25826 
25827   /* "View.MemoryView":1362
25828  *
25829  * @cname('__pyx_memoryview_refcount_copying')
25830  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
25831  *                            int ndim, bint inc) nogil:
25832  *
25833  */
25834 
25835   /* function exit code */
25836 }
25837 
25838 /* "View.MemoryView":1371
25839  *
25840  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
25841  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
25842  *                                              Py_ssize_t *strides, int ndim,
25843  *                                              bint inc) with gil:
25844  */
25845 
__pyx_memoryview_refcount_objects_in_slice_with_gil(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,int __pyx_v_inc)25846 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
25847   __Pyx_RefNannyDeclarations
25848   #ifdef WITH_THREAD
25849   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
25850   #endif
25851   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
25852 
25853   /* "View.MemoryView":1374
25854  *                                              Py_ssize_t *strides, int ndim,
25855  *                                              bint inc) with gil:
25856  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
25857  *
25858  * @cname('__pyx_memoryview_refcount_objects_in_slice')
25859  */
25860   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
25861 
25862   /* "View.MemoryView":1371
25863  *
25864  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
25865  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
25866  *                                              Py_ssize_t *strides, int ndim,
25867  *                                              bint inc) with gil:
25868  */
25869 
25870   /* function exit code */
25871   __Pyx_RefNannyFinishContext();
25872   #ifdef WITH_THREAD
25873   __Pyx_PyGILState_Release(__pyx_gilstate_save);
25874   #endif
25875 }
25876 
25877 /* "View.MemoryView":1377
25878  *
25879  * @cname('__pyx_memoryview_refcount_objects_in_slice')
25880  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
25881  *                                     Py_ssize_t *strides, int ndim, bint inc):
25882  *     cdef Py_ssize_t i
25883  */
25884 
__pyx_memoryview_refcount_objects_in_slice(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,int __pyx_v_inc)25885 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
25886   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
25887   __Pyx_RefNannyDeclarations
25888   Py_ssize_t __pyx_t_1;
25889   Py_ssize_t __pyx_t_2;
25890   Py_ssize_t __pyx_t_3;
25891   int __pyx_t_4;
25892   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
25893 
25894   /* "View.MemoryView":1381
25895  *     cdef Py_ssize_t i
25896  *
25897  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
25898  *         if ndim == 1:
25899  *             if inc:
25900  */
25901   __pyx_t_1 = (__pyx_v_shape[0]);
25902   __pyx_t_2 = __pyx_t_1;
25903   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
25904     __pyx_v_i = __pyx_t_3;
25905 
25906     /* "View.MemoryView":1382
25907  *
25908  *     for i in range(shape[0]):
25909  *         if ndim == 1:             # <<<<<<<<<<<<<<
25910  *             if inc:
25911  *                 Py_INCREF((<PyObject **> data)[0])
25912  */
25913     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
25914     if (__pyx_t_4) {
25915 
25916       /* "View.MemoryView":1383
25917  *     for i in range(shape[0]):
25918  *         if ndim == 1:
25919  *             if inc:             # <<<<<<<<<<<<<<
25920  *                 Py_INCREF((<PyObject **> data)[0])
25921  *             else:
25922  */
25923       __pyx_t_4 = (__pyx_v_inc != 0);
25924       if (__pyx_t_4) {
25925 
25926         /* "View.MemoryView":1384
25927  *         if ndim == 1:
25928  *             if inc:
25929  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
25930  *             else:
25931  *                 Py_DECREF((<PyObject **> data)[0])
25932  */
25933         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
25934 
25935         /* "View.MemoryView":1383
25936  *     for i in range(shape[0]):
25937  *         if ndim == 1:
25938  *             if inc:             # <<<<<<<<<<<<<<
25939  *                 Py_INCREF((<PyObject **> data)[0])
25940  *             else:
25941  */
25942         goto __pyx_L6;
25943       }
25944 
25945       /* "View.MemoryView":1386
25946  *                 Py_INCREF((<PyObject **> data)[0])
25947  *             else:
25948  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
25949  *         else:
25950  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
25951  */
25952       /*else*/ {
25953         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
25954       }
25955       __pyx_L6:;
25956 
25957       /* "View.MemoryView":1382
25958  *
25959  *     for i in range(shape[0]):
25960  *         if ndim == 1:             # <<<<<<<<<<<<<<
25961  *             if inc:
25962  *                 Py_INCREF((<PyObject **> data)[0])
25963  */
25964       goto __pyx_L5;
25965     }
25966 
25967     /* "View.MemoryView":1388
25968  *                 Py_DECREF((<PyObject **> data)[0])
25969  *         else:
25970  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
25971  *                                       ndim - 1, inc)
25972  *
25973  */
25974     /*else*/ {
25975 
25976       /* "View.MemoryView":1389
25977  *         else:
25978  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
25979  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
25980  *
25981  *         data += strides[0]
25982  */
25983       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
25984     }
25985     __pyx_L5:;
25986 
25987     /* "View.MemoryView":1391
25988  *                                       ndim - 1, inc)
25989  *
25990  *         data += strides[0]             # <<<<<<<<<<<<<<
25991  *
25992  *
25993  */
25994     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
25995   }
25996 
25997   /* "View.MemoryView":1377
25998  *
25999  * @cname('__pyx_memoryview_refcount_objects_in_slice')
26000  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
26001  *                                     Py_ssize_t *strides, int ndim, bint inc):
26002  *     cdef Py_ssize_t i
26003  */
26004 
26005   /* function exit code */
26006   __Pyx_RefNannyFinishContext();
26007 }
26008 
26009 /* "View.MemoryView":1397
26010  *
26011  * @cname('__pyx_memoryview_slice_assign_scalar')
26012  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
26013  *                               size_t itemsize, void *item,
26014  *                               bint dtype_is_object) nogil:
26015  */
26016 
__pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize,void * __pyx_v_item,int __pyx_v_dtype_is_object)26017 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
26018 
26019   /* "View.MemoryView":1400
26020  *                               size_t itemsize, void *item,
26021  *                               bint dtype_is_object) nogil:
26022  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
26023  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
26024  *                          itemsize, item)
26025  */
26026   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
26027 
26028   /* "View.MemoryView":1401
26029  *                               bint dtype_is_object) nogil:
26030  *     refcount_copying(dst, dtype_is_object, ndim, False)
26031  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
26032  *                          itemsize, item)
26033  *     refcount_copying(dst, dtype_is_object, ndim, True)
26034  */
26035   __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
26036 
26037   /* "View.MemoryView":1403
26038  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
26039  *                          itemsize, item)
26040  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
26041  *
26042  *
26043  */
26044   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
26045 
26046   /* "View.MemoryView":1397
26047  *
26048  * @cname('__pyx_memoryview_slice_assign_scalar')
26049  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
26050  *                               size_t itemsize, void *item,
26051  *                               bint dtype_is_object) nogil:
26052  */
26053 
26054   /* function exit code */
26055 }
26056 
26057 /* "View.MemoryView":1407
26058  *
26059  * @cname('__pyx_memoryview__slice_assign_scalar')
26060  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
26061  *                               Py_ssize_t *strides, int ndim,
26062  *                               size_t itemsize, void *item) nogil:
26063  */
26064 
__pyx_memoryview__slice_assign_scalar(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,size_t __pyx_v_itemsize,void * __pyx_v_item)26065 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
26066   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
26067   Py_ssize_t __pyx_v_stride;
26068   Py_ssize_t __pyx_v_extent;
26069   int __pyx_t_1;
26070   Py_ssize_t __pyx_t_2;
26071   Py_ssize_t __pyx_t_3;
26072   Py_ssize_t __pyx_t_4;
26073 
26074   /* "View.MemoryView":1411
26075  *                               size_t itemsize, void *item) nogil:
26076  *     cdef Py_ssize_t i
26077  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
26078  *     cdef Py_ssize_t extent = shape[0]
26079  *
26080  */
26081   __pyx_v_stride = (__pyx_v_strides[0]);
26082 
26083   /* "View.MemoryView":1412
26084  *     cdef Py_ssize_t i
26085  *     cdef Py_ssize_t stride = strides[0]
26086  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
26087  *
26088  *     if ndim == 1:
26089  */
26090   __pyx_v_extent = (__pyx_v_shape[0]);
26091 
26092   /* "View.MemoryView":1414
26093  *     cdef Py_ssize_t extent = shape[0]
26094  *
26095  *     if ndim == 1:             # <<<<<<<<<<<<<<
26096  *         for i in range(extent):
26097  *             memcpy(data, item, itemsize)
26098  */
26099   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
26100   if (__pyx_t_1) {
26101 
26102     /* "View.MemoryView":1415
26103  *
26104  *     if ndim == 1:
26105  *         for i in range(extent):             # <<<<<<<<<<<<<<
26106  *             memcpy(data, item, itemsize)
26107  *             data += stride
26108  */
26109     __pyx_t_2 = __pyx_v_extent;
26110     __pyx_t_3 = __pyx_t_2;
26111     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
26112       __pyx_v_i = __pyx_t_4;
26113 
26114       /* "View.MemoryView":1416
26115  *     if ndim == 1:
26116  *         for i in range(extent):
26117  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
26118  *             data += stride
26119  *     else:
26120  */
26121       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
26122 
26123       /* "View.MemoryView":1417
26124  *         for i in range(extent):
26125  *             memcpy(data, item, itemsize)
26126  *             data += stride             # <<<<<<<<<<<<<<
26127  *     else:
26128  *         for i in range(extent):
26129  */
26130       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
26131     }
26132 
26133     /* "View.MemoryView":1414
26134  *     cdef Py_ssize_t extent = shape[0]
26135  *
26136  *     if ndim == 1:             # <<<<<<<<<<<<<<
26137  *         for i in range(extent):
26138  *             memcpy(data, item, itemsize)
26139  */
26140     goto __pyx_L3;
26141   }
26142 
26143   /* "View.MemoryView":1419
26144  *             data += stride
26145  *     else:
26146  *         for i in range(extent):             # <<<<<<<<<<<<<<
26147  *             _slice_assign_scalar(data, shape + 1, strides + 1,
26148  *                                 ndim - 1, itemsize, item)
26149  */
26150   /*else*/ {
26151     __pyx_t_2 = __pyx_v_extent;
26152     __pyx_t_3 = __pyx_t_2;
26153     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
26154       __pyx_v_i = __pyx_t_4;
26155 
26156       /* "View.MemoryView":1420
26157  *     else:
26158  *         for i in range(extent):
26159  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
26160  *                                 ndim - 1, itemsize, item)
26161  *             data += stride
26162  */
26163       __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
26164 
26165       /* "View.MemoryView":1422
26166  *             _slice_assign_scalar(data, shape + 1, strides + 1,
26167  *                                 ndim - 1, itemsize, item)
26168  *             data += stride             # <<<<<<<<<<<<<<
26169  *
26170  *
26171  */
26172       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
26173     }
26174   }
26175   __pyx_L3:;
26176 
26177   /* "View.MemoryView":1407
26178  *
26179  * @cname('__pyx_memoryview__slice_assign_scalar')
26180  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
26181  *                               Py_ssize_t *strides, int ndim,
26182  *                               size_t itemsize, void *item) nogil:
26183  */
26184 
26185   /* function exit code */
26186 }
26187 
26188 /* "(tree fragment)":1
26189  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26190  *     cdef object __pyx_PickleError
26191  *     cdef object __pyx_result
26192  */
26193 
26194 /* Python wrapper */
26195 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26196 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)26197 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26198   PyObject *__pyx_v___pyx_type = 0;
26199   long __pyx_v___pyx_checksum;
26200   PyObject *__pyx_v___pyx_state = 0;
26201   int __pyx_lineno = 0;
26202   const char *__pyx_filename = NULL;
26203   int __pyx_clineno = 0;
26204   PyObject *__pyx_r = 0;
26205   __Pyx_RefNannyDeclarations
26206   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
26207   {
26208     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
26209     PyObject* values[3] = {0,0,0};
26210     if (unlikely(__pyx_kwds)) {
26211       Py_ssize_t kw_args;
26212       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26213       switch (pos_args) {
26214         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26215         CYTHON_FALLTHROUGH;
26216         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26217         CYTHON_FALLTHROUGH;
26218         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26219         CYTHON_FALLTHROUGH;
26220         case  0: break;
26221         default: goto __pyx_L5_argtuple_error;
26222       }
26223       kw_args = PyDict_Size(__pyx_kwds);
26224       switch (pos_args) {
26225         case  0:
26226         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
26227         else goto __pyx_L5_argtuple_error;
26228         CYTHON_FALLTHROUGH;
26229         case  1:
26230         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
26231         else {
26232           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
26233         }
26234         CYTHON_FALLTHROUGH;
26235         case  2:
26236         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
26237         else {
26238           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
26239         }
26240       }
26241       if (unlikely(kw_args > 0)) {
26242         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
26243       }
26244     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
26245       goto __pyx_L5_argtuple_error;
26246     } else {
26247       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26248       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26249       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26250     }
26251     __pyx_v___pyx_type = values[0];
26252     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
26253     __pyx_v___pyx_state = values[2];
26254   }
26255   goto __pyx_L4_argument_unpacking_done;
26256   __pyx_L5_argtuple_error:;
26257   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
26258   __pyx_L3_error:;
26259   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
26260   __Pyx_RefNannyFinishContext();
26261   return NULL;
26262   __pyx_L4_argument_unpacking_done:;
26263   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
26264 
26265   /* function exit code */
26266   __Pyx_RefNannyFinishContext();
26267   return __pyx_r;
26268 }
26269 
__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)26270 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
26271   PyObject *__pyx_v___pyx_PickleError = 0;
26272   PyObject *__pyx_v___pyx_result = 0;
26273   PyObject *__pyx_r = NULL;
26274   __Pyx_RefNannyDeclarations
26275   int __pyx_t_1;
26276   PyObject *__pyx_t_2 = NULL;
26277   PyObject *__pyx_t_3 = NULL;
26278   PyObject *__pyx_t_4 = NULL;
26279   PyObject *__pyx_t_5 = NULL;
26280   int __pyx_t_6;
26281   int __pyx_lineno = 0;
26282   const char *__pyx_filename = NULL;
26283   int __pyx_clineno = 0;
26284   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
26285 
26286   /* "(tree fragment)":4
26287  *     cdef object __pyx_PickleError
26288  *     cdef object __pyx_result
26289  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
26290  *         from pickle import PickleError as __pyx_PickleError
26291  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
26292  */
26293   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
26294   if (__pyx_t_1) {
26295 
26296     /* "(tree fragment)":5
26297  *     cdef object __pyx_result
26298  *     if __pyx_checksum != 0xb068931:
26299  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
26300  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
26301  *     __pyx_result = Enum.__new__(__pyx_type)
26302  */
26303     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
26304     __Pyx_GOTREF(__pyx_t_2);
26305     __Pyx_INCREF(__pyx_n_s_PickleError);
26306     __Pyx_GIVEREF(__pyx_n_s_PickleError);
26307     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
26308     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
26309     __Pyx_GOTREF(__pyx_t_3);
26310     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26311     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
26312     __Pyx_GOTREF(__pyx_t_2);
26313     __Pyx_INCREF(__pyx_t_2);
26314     __pyx_v___pyx_PickleError = __pyx_t_2;
26315     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26316     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26317 
26318     /* "(tree fragment)":6
26319  *     if __pyx_checksum != 0xb068931:
26320  *         from pickle import PickleError as __pyx_PickleError
26321  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
26322  *     __pyx_result = Enum.__new__(__pyx_type)
26323  *     if __pyx_state is not None:
26324  */
26325     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
26326     __Pyx_GOTREF(__pyx_t_2);
26327     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
26328     __Pyx_GOTREF(__pyx_t_4);
26329     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26330     __Pyx_INCREF(__pyx_v___pyx_PickleError);
26331     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
26332     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
26333       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
26334       if (likely(__pyx_t_5)) {
26335         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
26336         __Pyx_INCREF(__pyx_t_5);
26337         __Pyx_INCREF(function);
26338         __Pyx_DECREF_SET(__pyx_t_2, function);
26339       }
26340     }
26341     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
26342     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
26343     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26344     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
26345     __Pyx_GOTREF(__pyx_t_3);
26346     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26347     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26348     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26349     __PYX_ERR(2, 6, __pyx_L1_error)
26350 
26351     /* "(tree fragment)":4
26352  *     cdef object __pyx_PickleError
26353  *     cdef object __pyx_result
26354  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
26355  *         from pickle import PickleError as __pyx_PickleError
26356  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
26357  */
26358   }
26359 
26360   /* "(tree fragment)":7
26361  *         from pickle import PickleError as __pyx_PickleError
26362  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
26363  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
26364  *     if __pyx_state is not None:
26365  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
26366  */
26367   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
26368   __Pyx_GOTREF(__pyx_t_2);
26369   __pyx_t_4 = NULL;
26370   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
26371     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
26372     if (likely(__pyx_t_4)) {
26373       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
26374       __Pyx_INCREF(__pyx_t_4);
26375       __Pyx_INCREF(function);
26376       __Pyx_DECREF_SET(__pyx_t_2, function);
26377     }
26378   }
26379   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
26380   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26381   if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
26382   __Pyx_GOTREF(__pyx_t_3);
26383   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26384   __pyx_v___pyx_result = __pyx_t_3;
26385   __pyx_t_3 = 0;
26386 
26387   /* "(tree fragment)":8
26388  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
26389  *     __pyx_result = Enum.__new__(__pyx_type)
26390  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
26391  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
26392  *     return __pyx_result
26393  */
26394   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
26395   __pyx_t_6 = (__pyx_t_1 != 0);
26396   if (__pyx_t_6) {
26397 
26398     /* "(tree fragment)":9
26399  *     __pyx_result = Enum.__new__(__pyx_type)
26400  *     if __pyx_state is not None:
26401  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
26402  *     return __pyx_result
26403  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
26404  */
26405     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
26406     __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
26407     __Pyx_GOTREF(__pyx_t_3);
26408     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26409 
26410     /* "(tree fragment)":8
26411  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
26412  *     __pyx_result = Enum.__new__(__pyx_type)
26413  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
26414  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
26415  *     return __pyx_result
26416  */
26417   }
26418 
26419   /* "(tree fragment)":10
26420  *     if __pyx_state is not None:
26421  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
26422  *     return __pyx_result             # <<<<<<<<<<<<<<
26423  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
26424  *     __pyx_result.name = __pyx_state[0]
26425  */
26426   __Pyx_XDECREF(__pyx_r);
26427   __Pyx_INCREF(__pyx_v___pyx_result);
26428   __pyx_r = __pyx_v___pyx_result;
26429   goto __pyx_L0;
26430 
26431   /* "(tree fragment)":1
26432  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26433  *     cdef object __pyx_PickleError
26434  *     cdef object __pyx_result
26435  */
26436 
26437   /* function exit code */
26438   __pyx_L1_error:;
26439   __Pyx_XDECREF(__pyx_t_2);
26440   __Pyx_XDECREF(__pyx_t_3);
26441   __Pyx_XDECREF(__pyx_t_4);
26442   __Pyx_XDECREF(__pyx_t_5);
26443   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
26444   __pyx_r = NULL;
26445   __pyx_L0:;
26446   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
26447   __Pyx_XDECREF(__pyx_v___pyx_result);
26448   __Pyx_XGIVEREF(__pyx_r);
26449   __Pyx_RefNannyFinishContext();
26450   return __pyx_r;
26451 }
26452 
26453 /* "(tree fragment)":11
26454  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
26455  *     return __pyx_result
26456  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
26457  *     __pyx_result.name = __pyx_state[0]
26458  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
26459  */
26460 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)26461 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
26462   PyObject *__pyx_r = NULL;
26463   __Pyx_RefNannyDeclarations
26464   PyObject *__pyx_t_1 = NULL;
26465   int __pyx_t_2;
26466   Py_ssize_t __pyx_t_3;
26467   int __pyx_t_4;
26468   int __pyx_t_5;
26469   PyObject *__pyx_t_6 = NULL;
26470   PyObject *__pyx_t_7 = NULL;
26471   PyObject *__pyx_t_8 = NULL;
26472   int __pyx_lineno = 0;
26473   const char *__pyx_filename = NULL;
26474   int __pyx_clineno = 0;
26475   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
26476 
26477   /* "(tree fragment)":12
26478  *     return __pyx_result
26479  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
26480  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
26481  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
26482  *         __pyx_result.__dict__.update(__pyx_state[1])
26483  */
26484   if (unlikely(__pyx_v___pyx_state == Py_None)) {
26485     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
26486     __PYX_ERR(2, 12, __pyx_L1_error)
26487   }
26488   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
26489   __Pyx_GOTREF(__pyx_t_1);
26490   __Pyx_GIVEREF(__pyx_t_1);
26491   __Pyx_GOTREF(__pyx_v___pyx_result->name);
26492   __Pyx_DECREF(__pyx_v___pyx_result->name);
26493   __pyx_v___pyx_result->name = __pyx_t_1;
26494   __pyx_t_1 = 0;
26495 
26496   /* "(tree fragment)":13
26497  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
26498  *     __pyx_result.name = __pyx_state[0]
26499  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
26500  *         __pyx_result.__dict__.update(__pyx_state[1])
26501  */
26502   if (unlikely(__pyx_v___pyx_state == Py_None)) {
26503     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
26504     __PYX_ERR(2, 13, __pyx_L1_error)
26505   }
26506   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
26507   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
26508   if (__pyx_t_4) {
26509   } else {
26510     __pyx_t_2 = __pyx_t_4;
26511     goto __pyx_L4_bool_binop_done;
26512   }
26513   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
26514   __pyx_t_5 = (__pyx_t_4 != 0);
26515   __pyx_t_2 = __pyx_t_5;
26516   __pyx_L4_bool_binop_done:;
26517   if (__pyx_t_2) {
26518 
26519     /* "(tree fragment)":14
26520  *     __pyx_result.name = __pyx_state[0]
26521  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
26522  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
26523  */
26524     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
26525     __Pyx_GOTREF(__pyx_t_6);
26526     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
26527     __Pyx_GOTREF(__pyx_t_7);
26528     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26529     if (unlikely(__pyx_v___pyx_state == Py_None)) {
26530       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
26531       __PYX_ERR(2, 14, __pyx_L1_error)
26532     }
26533     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
26534     __Pyx_GOTREF(__pyx_t_6);
26535     __pyx_t_8 = NULL;
26536     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
26537       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
26538       if (likely(__pyx_t_8)) {
26539         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
26540         __Pyx_INCREF(__pyx_t_8);
26541         __Pyx_INCREF(function);
26542         __Pyx_DECREF_SET(__pyx_t_7, function);
26543       }
26544     }
26545     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
26546     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
26547     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26548     if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
26549     __Pyx_GOTREF(__pyx_t_1);
26550     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26551     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26552 
26553     /* "(tree fragment)":13
26554  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
26555  *     __pyx_result.name = __pyx_state[0]
26556  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
26557  *         __pyx_result.__dict__.update(__pyx_state[1])
26558  */
26559   }
26560 
26561   /* "(tree fragment)":11
26562  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
26563  *     return __pyx_result
26564  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
26565  *     __pyx_result.name = __pyx_state[0]
26566  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
26567  */
26568 
26569   /* function exit code */
26570   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26571   goto __pyx_L0;
26572   __pyx_L1_error:;
26573   __Pyx_XDECREF(__pyx_t_1);
26574   __Pyx_XDECREF(__pyx_t_6);
26575   __Pyx_XDECREF(__pyx_t_7);
26576   __Pyx_XDECREF(__pyx_t_8);
26577   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
26578   __pyx_r = 0;
26579   __pyx_L0:;
26580   __Pyx_XGIVEREF(__pyx_r);
26581   __Pyx_RefNannyFinishContext();
26582   return __pyx_r;
26583 }
26584 static struct __pyx_vtabstruct_array __pyx_vtable_array;
26585 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)26586 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
26587   struct __pyx_array_obj *p;
26588   PyObject *o;
26589   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
26590     o = (*t->tp_alloc)(t, 0);
26591   } else {
26592     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
26593   }
26594   if (unlikely(!o)) return 0;
26595   p = ((struct __pyx_array_obj *)o);
26596   p->__pyx_vtab = __pyx_vtabptr_array;
26597   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
26598   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
26599   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
26600   return o;
26601   bad:
26602   Py_DECREF(o); o = 0;
26603   return NULL;
26604 }
26605 
__pyx_tp_dealloc_array(PyObject * o)26606 static void __pyx_tp_dealloc_array(PyObject *o) {
26607   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
26608   #if CYTHON_USE_TP_FINALIZE
26609   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
26610     if (PyObject_CallFinalizerFromDealloc(o)) return;
26611   }
26612   #endif
26613   {
26614     PyObject *etype, *eval, *etb;
26615     PyErr_Fetch(&etype, &eval, &etb);
26616     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26617     __pyx_array___dealloc__(o);
26618     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26619     PyErr_Restore(etype, eval, etb);
26620   }
26621   Py_CLEAR(p->mode);
26622   Py_CLEAR(p->_format);
26623   (*Py_TYPE(o)->tp_free)(o);
26624 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)26625 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
26626   PyObject *r;
26627   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
26628   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
26629   Py_DECREF(x);
26630   return r;
26631 }
26632 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)26633 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
26634   if (v) {
26635     return __pyx_array___setitem__(o, i, v);
26636   }
26637   else {
26638     PyErr_Format(PyExc_NotImplementedError,
26639       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
26640     return -1;
26641   }
26642 }
26643 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)26644 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
26645   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
26646   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
26647     PyErr_Clear();
26648     v = __pyx_array___getattr__(o, n);
26649   }
26650   return v;
26651 }
26652 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)26653 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
26654   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
26655 }
26656 
26657 static PyMethodDef __pyx_methods_array[] = {
26658   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
26659   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
26660   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
26661   {0, 0, 0, 0}
26662 };
26663 
26664 static struct PyGetSetDef __pyx_getsets_array[] = {
26665   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
26666   {0, 0, 0, 0, 0}
26667 };
26668 
26669 static PySequenceMethods __pyx_tp_as_sequence_array = {
26670   __pyx_array___len__, /*sq_length*/
26671   0, /*sq_concat*/
26672   0, /*sq_repeat*/
26673   __pyx_sq_item_array, /*sq_item*/
26674   0, /*sq_slice*/
26675   0, /*sq_ass_item*/
26676   0, /*sq_ass_slice*/
26677   0, /*sq_contains*/
26678   0, /*sq_inplace_concat*/
26679   0, /*sq_inplace_repeat*/
26680 };
26681 
26682 static PyMappingMethods __pyx_tp_as_mapping_array = {
26683   __pyx_array___len__, /*mp_length*/
26684   __pyx_array___getitem__, /*mp_subscript*/
26685   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
26686 };
26687 
26688 static PyBufferProcs __pyx_tp_as_buffer_array = {
26689   #if PY_MAJOR_VERSION < 3
26690   0, /*bf_getreadbuffer*/
26691   #endif
26692   #if PY_MAJOR_VERSION < 3
26693   0, /*bf_getwritebuffer*/
26694   #endif
26695   #if PY_MAJOR_VERSION < 3
26696   0, /*bf_getsegcount*/
26697   #endif
26698   #if PY_MAJOR_VERSION < 3
26699   0, /*bf_getcharbuffer*/
26700   #endif
26701   __pyx_array_getbuffer, /*bf_getbuffer*/
26702   0, /*bf_releasebuffer*/
26703 };
26704 
26705 static PyTypeObject __pyx_type___pyx_array = {
26706   PyVarObject_HEAD_INIT(0, 0)
26707   "urh.cythonext.path_creator.array", /*tp_name*/
26708   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
26709   0, /*tp_itemsize*/
26710   __pyx_tp_dealloc_array, /*tp_dealloc*/
26711   #if PY_VERSION_HEX < 0x030800b4
26712   0, /*tp_print*/
26713   #endif
26714   #if PY_VERSION_HEX >= 0x030800b4
26715   0, /*tp_vectorcall_offset*/
26716   #endif
26717   0, /*tp_getattr*/
26718   0, /*tp_setattr*/
26719   #if PY_MAJOR_VERSION < 3
26720   0, /*tp_compare*/
26721   #endif
26722   #if PY_MAJOR_VERSION >= 3
26723   0, /*tp_as_async*/
26724   #endif
26725   0, /*tp_repr*/
26726   0, /*tp_as_number*/
26727   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
26728   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
26729   0, /*tp_hash*/
26730   0, /*tp_call*/
26731   0, /*tp_str*/
26732   __pyx_tp_getattro_array, /*tp_getattro*/
26733   0, /*tp_setattro*/
26734   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
26735   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
26736   0, /*tp_doc*/
26737   0, /*tp_traverse*/
26738   0, /*tp_clear*/
26739   0, /*tp_richcompare*/
26740   0, /*tp_weaklistoffset*/
26741   0, /*tp_iter*/
26742   0, /*tp_iternext*/
26743   __pyx_methods_array, /*tp_methods*/
26744   0, /*tp_members*/
26745   __pyx_getsets_array, /*tp_getset*/
26746   0, /*tp_base*/
26747   0, /*tp_dict*/
26748   0, /*tp_descr_get*/
26749   0, /*tp_descr_set*/
26750   0, /*tp_dictoffset*/
26751   0, /*tp_init*/
26752   0, /*tp_alloc*/
26753   __pyx_tp_new_array, /*tp_new*/
26754   0, /*tp_free*/
26755   0, /*tp_is_gc*/
26756   0, /*tp_bases*/
26757   0, /*tp_mro*/
26758   0, /*tp_cache*/
26759   0, /*tp_subclasses*/
26760   0, /*tp_weaklist*/
26761   0, /*tp_del*/
26762   0, /*tp_version_tag*/
26763   #if PY_VERSION_HEX >= 0x030400a1
26764   0, /*tp_finalize*/
26765   #endif
26766   #if PY_VERSION_HEX >= 0x030800b1
26767   0, /*tp_vectorcall*/
26768   #endif
26769   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26770   0, /*tp_print*/
26771   #endif
26772 };
26773 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)26774 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
26775   struct __pyx_MemviewEnum_obj *p;
26776   PyObject *o;
26777   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
26778     o = (*t->tp_alloc)(t, 0);
26779   } else {
26780     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
26781   }
26782   if (unlikely(!o)) return 0;
26783   p = ((struct __pyx_MemviewEnum_obj *)o);
26784   p->name = Py_None; Py_INCREF(Py_None);
26785   return o;
26786 }
26787 
__pyx_tp_dealloc_Enum(PyObject * o)26788 static void __pyx_tp_dealloc_Enum(PyObject *o) {
26789   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26790   #if CYTHON_USE_TP_FINALIZE
26791   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
26792     if (PyObject_CallFinalizerFromDealloc(o)) return;
26793   }
26794   #endif
26795   PyObject_GC_UnTrack(o);
26796   Py_CLEAR(p->name);
26797   (*Py_TYPE(o)->tp_free)(o);
26798 }
26799 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)26800 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
26801   int e;
26802   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26803   if (p->name) {
26804     e = (*v)(p->name, a); if (e) return e;
26805   }
26806   return 0;
26807 }
26808 
__pyx_tp_clear_Enum(PyObject * o)26809 static int __pyx_tp_clear_Enum(PyObject *o) {
26810   PyObject* tmp;
26811   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26812   tmp = ((PyObject*)p->name);
26813   p->name = Py_None; Py_INCREF(Py_None);
26814   Py_XDECREF(tmp);
26815   return 0;
26816 }
26817 
26818 static PyMethodDef __pyx_methods_Enum[] = {
26819   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
26820   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
26821   {0, 0, 0, 0}
26822 };
26823 
26824 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
26825   PyVarObject_HEAD_INIT(0, 0)
26826   "urh.cythonext.path_creator.Enum", /*tp_name*/
26827   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
26828   0, /*tp_itemsize*/
26829   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
26830   #if PY_VERSION_HEX < 0x030800b4
26831   0, /*tp_print*/
26832   #endif
26833   #if PY_VERSION_HEX >= 0x030800b4
26834   0, /*tp_vectorcall_offset*/
26835   #endif
26836   0, /*tp_getattr*/
26837   0, /*tp_setattr*/
26838   #if PY_MAJOR_VERSION < 3
26839   0, /*tp_compare*/
26840   #endif
26841   #if PY_MAJOR_VERSION >= 3
26842   0, /*tp_as_async*/
26843   #endif
26844   __pyx_MemviewEnum___repr__, /*tp_repr*/
26845   0, /*tp_as_number*/
26846   0, /*tp_as_sequence*/
26847   0, /*tp_as_mapping*/
26848   0, /*tp_hash*/
26849   0, /*tp_call*/
26850   0, /*tp_str*/
26851   0, /*tp_getattro*/
26852   0, /*tp_setattro*/
26853   0, /*tp_as_buffer*/
26854   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26855   0, /*tp_doc*/
26856   __pyx_tp_traverse_Enum, /*tp_traverse*/
26857   __pyx_tp_clear_Enum, /*tp_clear*/
26858   0, /*tp_richcompare*/
26859   0, /*tp_weaklistoffset*/
26860   0, /*tp_iter*/
26861   0, /*tp_iternext*/
26862   __pyx_methods_Enum, /*tp_methods*/
26863   0, /*tp_members*/
26864   0, /*tp_getset*/
26865   0, /*tp_base*/
26866   0, /*tp_dict*/
26867   0, /*tp_descr_get*/
26868   0, /*tp_descr_set*/
26869   0, /*tp_dictoffset*/
26870   __pyx_MemviewEnum___init__, /*tp_init*/
26871   0, /*tp_alloc*/
26872   __pyx_tp_new_Enum, /*tp_new*/
26873   0, /*tp_free*/
26874   0, /*tp_is_gc*/
26875   0, /*tp_bases*/
26876   0, /*tp_mro*/
26877   0, /*tp_cache*/
26878   0, /*tp_subclasses*/
26879   0, /*tp_weaklist*/
26880   0, /*tp_del*/
26881   0, /*tp_version_tag*/
26882   #if PY_VERSION_HEX >= 0x030400a1
26883   0, /*tp_finalize*/
26884   #endif
26885   #if PY_VERSION_HEX >= 0x030800b1
26886   0, /*tp_vectorcall*/
26887   #endif
26888   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26889   0, /*tp_print*/
26890   #endif
26891 };
26892 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
26893 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)26894 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
26895   struct __pyx_memoryview_obj *p;
26896   PyObject *o;
26897   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
26898     o = (*t->tp_alloc)(t, 0);
26899   } else {
26900     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
26901   }
26902   if (unlikely(!o)) return 0;
26903   p = ((struct __pyx_memoryview_obj *)o);
26904   p->__pyx_vtab = __pyx_vtabptr_memoryview;
26905   p->obj = Py_None; Py_INCREF(Py_None);
26906   p->_size = Py_None; Py_INCREF(Py_None);
26907   p->_array_interface = Py_None; Py_INCREF(Py_None);
26908   p->view.obj = NULL;
26909   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
26910   return o;
26911   bad:
26912   Py_DECREF(o); o = 0;
26913   return NULL;
26914 }
26915 
__pyx_tp_dealloc_memoryview(PyObject * o)26916 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
26917   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26918   #if CYTHON_USE_TP_FINALIZE
26919   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
26920     if (PyObject_CallFinalizerFromDealloc(o)) return;
26921   }
26922   #endif
26923   PyObject_GC_UnTrack(o);
26924   {
26925     PyObject *etype, *eval, *etb;
26926     PyErr_Fetch(&etype, &eval, &etb);
26927     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26928     __pyx_memoryview___dealloc__(o);
26929     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26930     PyErr_Restore(etype, eval, etb);
26931   }
26932   Py_CLEAR(p->obj);
26933   Py_CLEAR(p->_size);
26934   Py_CLEAR(p->_array_interface);
26935   (*Py_TYPE(o)->tp_free)(o);
26936 }
26937 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)26938 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
26939   int e;
26940   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26941   if (p->obj) {
26942     e = (*v)(p->obj, a); if (e) return e;
26943   }
26944   if (p->_size) {
26945     e = (*v)(p->_size, a); if (e) return e;
26946   }
26947   if (p->_array_interface) {
26948     e = (*v)(p->_array_interface, a); if (e) return e;
26949   }
26950   if (p->view.obj) {
26951     e = (*v)(p->view.obj, a); if (e) return e;
26952   }
26953   return 0;
26954 }
26955 
__pyx_tp_clear_memoryview(PyObject * o)26956 static int __pyx_tp_clear_memoryview(PyObject *o) {
26957   PyObject* tmp;
26958   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26959   tmp = ((PyObject*)p->obj);
26960   p->obj = Py_None; Py_INCREF(Py_None);
26961   Py_XDECREF(tmp);
26962   tmp = ((PyObject*)p->_size);
26963   p->_size = Py_None; Py_INCREF(Py_None);
26964   Py_XDECREF(tmp);
26965   tmp = ((PyObject*)p->_array_interface);
26966   p->_array_interface = Py_None; Py_INCREF(Py_None);
26967   Py_XDECREF(tmp);
26968   Py_CLEAR(p->view.obj);
26969   return 0;
26970 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)26971 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26972   PyObject *r;
26973   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
26974   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
26975   Py_DECREF(x);
26976   return r;
26977 }
26978 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)26979 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
26980   if (v) {
26981     return __pyx_memoryview___setitem__(o, i, v);
26982   }
26983   else {
26984     PyErr_Format(PyExc_NotImplementedError,
26985       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
26986     return -1;
26987   }
26988 }
26989 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)26990 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
26991   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
26992 }
26993 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)26994 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
26995   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
26996 }
26997 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)26998 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
26999   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
27000 }
27001 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)27002 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
27003   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
27004 }
27005 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)27006 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
27007   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
27008 }
27009 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)27010 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
27011   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
27012 }
27013 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)27014 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
27015   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
27016 }
27017 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)27018 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
27019   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
27020 }
27021 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)27022 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
27023   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
27024 }
27025 
27026 static PyMethodDef __pyx_methods_memoryview[] = {
27027   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
27028   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
27029   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
27030   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
27031   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
27032   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
27033   {0, 0, 0, 0}
27034 };
27035 
27036 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
27037   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
27038   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
27039   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
27040   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
27041   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
27042   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
27043   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
27044   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
27045   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
27046   {0, 0, 0, 0, 0}
27047 };
27048 
27049 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
27050   __pyx_memoryview___len__, /*sq_length*/
27051   0, /*sq_concat*/
27052   0, /*sq_repeat*/
27053   __pyx_sq_item_memoryview, /*sq_item*/
27054   0, /*sq_slice*/
27055   0, /*sq_ass_item*/
27056   0, /*sq_ass_slice*/
27057   0, /*sq_contains*/
27058   0, /*sq_inplace_concat*/
27059   0, /*sq_inplace_repeat*/
27060 };
27061 
27062 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
27063   __pyx_memoryview___len__, /*mp_length*/
27064   __pyx_memoryview___getitem__, /*mp_subscript*/
27065   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
27066 };
27067 
27068 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27069   #if PY_MAJOR_VERSION < 3
27070   0, /*bf_getreadbuffer*/
27071   #endif
27072   #if PY_MAJOR_VERSION < 3
27073   0, /*bf_getwritebuffer*/
27074   #endif
27075   #if PY_MAJOR_VERSION < 3
27076   0, /*bf_getsegcount*/
27077   #endif
27078   #if PY_MAJOR_VERSION < 3
27079   0, /*bf_getcharbuffer*/
27080   #endif
27081   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
27082   0, /*bf_releasebuffer*/
27083 };
27084 
27085 static PyTypeObject __pyx_type___pyx_memoryview = {
27086   PyVarObject_HEAD_INIT(0, 0)
27087   "urh.cythonext.path_creator.memoryview", /*tp_name*/
27088   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
27089   0, /*tp_itemsize*/
27090   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
27091   #if PY_VERSION_HEX < 0x030800b4
27092   0, /*tp_print*/
27093   #endif
27094   #if PY_VERSION_HEX >= 0x030800b4
27095   0, /*tp_vectorcall_offset*/
27096   #endif
27097   0, /*tp_getattr*/
27098   0, /*tp_setattr*/
27099   #if PY_MAJOR_VERSION < 3
27100   0, /*tp_compare*/
27101   #endif
27102   #if PY_MAJOR_VERSION >= 3
27103   0, /*tp_as_async*/
27104   #endif
27105   __pyx_memoryview___repr__, /*tp_repr*/
27106   0, /*tp_as_number*/
27107   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
27108   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
27109   0, /*tp_hash*/
27110   0, /*tp_call*/
27111   __pyx_memoryview___str__, /*tp_str*/
27112   0, /*tp_getattro*/
27113   0, /*tp_setattro*/
27114   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
27115   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
27116   0, /*tp_doc*/
27117   __pyx_tp_traverse_memoryview, /*tp_traverse*/
27118   __pyx_tp_clear_memoryview, /*tp_clear*/
27119   0, /*tp_richcompare*/
27120   0, /*tp_weaklistoffset*/
27121   0, /*tp_iter*/
27122   0, /*tp_iternext*/
27123   __pyx_methods_memoryview, /*tp_methods*/
27124   0, /*tp_members*/
27125   __pyx_getsets_memoryview, /*tp_getset*/
27126   0, /*tp_base*/
27127   0, /*tp_dict*/
27128   0, /*tp_descr_get*/
27129   0, /*tp_descr_set*/
27130   0, /*tp_dictoffset*/
27131   0, /*tp_init*/
27132   0, /*tp_alloc*/
27133   __pyx_tp_new_memoryview, /*tp_new*/
27134   0, /*tp_free*/
27135   0, /*tp_is_gc*/
27136   0, /*tp_bases*/
27137   0, /*tp_mro*/
27138   0, /*tp_cache*/
27139   0, /*tp_subclasses*/
27140   0, /*tp_weaklist*/
27141   0, /*tp_del*/
27142   0, /*tp_version_tag*/
27143   #if PY_VERSION_HEX >= 0x030400a1
27144   0, /*tp_finalize*/
27145   #endif
27146   #if PY_VERSION_HEX >= 0x030800b1
27147   0, /*tp_vectorcall*/
27148   #endif
27149   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
27150   0, /*tp_print*/
27151   #endif
27152 };
27153 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
27154 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)27155 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
27156   struct __pyx_memoryviewslice_obj *p;
27157   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
27158   if (unlikely(!o)) return 0;
27159   p = ((struct __pyx_memoryviewslice_obj *)o);
27160   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
27161   p->from_object = Py_None; Py_INCREF(Py_None);
27162   p->from_slice.memview = NULL;
27163   return o;
27164 }
27165 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)27166 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
27167   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27168   #if CYTHON_USE_TP_FINALIZE
27169   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
27170     if (PyObject_CallFinalizerFromDealloc(o)) return;
27171   }
27172   #endif
27173   PyObject_GC_UnTrack(o);
27174   {
27175     PyObject *etype, *eval, *etb;
27176     PyErr_Fetch(&etype, &eval, &etb);
27177     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
27178     __pyx_memoryviewslice___dealloc__(o);
27179     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
27180     PyErr_Restore(etype, eval, etb);
27181   }
27182   Py_CLEAR(p->from_object);
27183   PyObject_GC_Track(o);
27184   __pyx_tp_dealloc_memoryview(o);
27185 }
27186 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)27187 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
27188   int e;
27189   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27190   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
27191   if (p->from_object) {
27192     e = (*v)(p->from_object, a); if (e) return e;
27193   }
27194   return 0;
27195 }
27196 
__pyx_tp_clear__memoryviewslice(PyObject * o)27197 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
27198   PyObject* tmp;
27199   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27200   __pyx_tp_clear_memoryview(o);
27201   tmp = ((PyObject*)p->from_object);
27202   p->from_object = Py_None; Py_INCREF(Py_None);
27203   Py_XDECREF(tmp);
27204   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
27205   return 0;
27206 }
27207 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)27208 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
27209   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
27210 }
27211 
27212 static PyMethodDef __pyx_methods__memoryviewslice[] = {
27213   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
27214   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
27215   {0, 0, 0, 0}
27216 };
27217 
27218 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
27219   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
27220   {0, 0, 0, 0, 0}
27221 };
27222 
27223 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
27224   PyVarObject_HEAD_INIT(0, 0)
27225   "urh.cythonext.path_creator._memoryviewslice", /*tp_name*/
27226   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
27227   0, /*tp_itemsize*/
27228   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
27229   #if PY_VERSION_HEX < 0x030800b4
27230   0, /*tp_print*/
27231   #endif
27232   #if PY_VERSION_HEX >= 0x030800b4
27233   0, /*tp_vectorcall_offset*/
27234   #endif
27235   0, /*tp_getattr*/
27236   0, /*tp_setattr*/
27237   #if PY_MAJOR_VERSION < 3
27238   0, /*tp_compare*/
27239   #endif
27240   #if PY_MAJOR_VERSION >= 3
27241   0, /*tp_as_async*/
27242   #endif
27243   #if CYTHON_COMPILING_IN_PYPY
27244   __pyx_memoryview___repr__, /*tp_repr*/
27245   #else
27246   0, /*tp_repr*/
27247   #endif
27248   0, /*tp_as_number*/
27249   0, /*tp_as_sequence*/
27250   0, /*tp_as_mapping*/
27251   0, /*tp_hash*/
27252   0, /*tp_call*/
27253   #if CYTHON_COMPILING_IN_PYPY
27254   __pyx_memoryview___str__, /*tp_str*/
27255   #else
27256   0, /*tp_str*/
27257   #endif
27258   0, /*tp_getattro*/
27259   0, /*tp_setattro*/
27260   0, /*tp_as_buffer*/
27261   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
27262   "Internal class for passing memoryview slices to Python", /*tp_doc*/
27263   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
27264   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
27265   0, /*tp_richcompare*/
27266   0, /*tp_weaklistoffset*/
27267   0, /*tp_iter*/
27268   0, /*tp_iternext*/
27269   __pyx_methods__memoryviewslice, /*tp_methods*/
27270   0, /*tp_members*/
27271   __pyx_getsets__memoryviewslice, /*tp_getset*/
27272   0, /*tp_base*/
27273   0, /*tp_dict*/
27274   0, /*tp_descr_get*/
27275   0, /*tp_descr_set*/
27276   0, /*tp_dictoffset*/
27277   0, /*tp_init*/
27278   0, /*tp_alloc*/
27279   __pyx_tp_new__memoryviewslice, /*tp_new*/
27280   0, /*tp_free*/
27281   0, /*tp_is_gc*/
27282   0, /*tp_bases*/
27283   0, /*tp_mro*/
27284   0, /*tp_cache*/
27285   0, /*tp_subclasses*/
27286   0, /*tp_weaklist*/
27287   0, /*tp_del*/
27288   0, /*tp_version_tag*/
27289   #if PY_VERSION_HEX >= 0x030400a1
27290   0, /*tp_finalize*/
27291   #endif
27292   #if PY_VERSION_HEX >= 0x030800b1
27293   0, /*tp_vectorcall*/
27294   #endif
27295   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
27296   0, /*tp_print*/
27297   #endif
27298 };
27299 
27300 static PyMethodDef __pyx_methods[] = {
27301   {"array_to_QPath", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3urh_9cythonext_12path_creator_5array_to_QPath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3urh_9cythonext_12path_creator_4array_to_QPath},
27302   {0, 0, 0, 0}
27303 };
27304 
27305 #if PY_MAJOR_VERSION >= 3
27306 #if CYTHON_PEP489_MULTI_PHASE_INIT
27307 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
27308 static int __pyx_pymod_exec_path_creator(PyObject* module); /*proto*/
27309 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
27310   {Py_mod_create, (void*)__pyx_pymod_create},
27311   {Py_mod_exec, (void*)__pyx_pymod_exec_path_creator},
27312   {0, NULL}
27313 };
27314 #endif
27315 
27316 static struct PyModuleDef __pyx_moduledef = {
27317     PyModuleDef_HEAD_INIT,
27318     "path_creator",
27319     0, /* m_doc */
27320   #if CYTHON_PEP489_MULTI_PHASE_INIT
27321     0, /* m_size */
27322   #else
27323     -1, /* m_size */
27324   #endif
27325     __pyx_methods /* m_methods */,
27326   #if CYTHON_PEP489_MULTI_PHASE_INIT
27327     __pyx_moduledef_slots, /* m_slots */
27328   #else
27329     NULL, /* m_reload */
27330   #endif
27331     NULL, /* m_traverse */
27332     NULL, /* m_clear */
27333     NULL /* m_free */
27334 };
27335 #endif
27336 #ifndef CYTHON_SMALL_CODE
27337 #if defined(__clang__)
27338     #define CYTHON_SMALL_CODE
27339 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
27340     #define CYTHON_SMALL_CODE __attribute__((cold))
27341 #else
27342     #define CYTHON_SMALL_CODE
27343 #endif
27344 #endif
27345 
27346 static __Pyx_StringTabEntry __pyx_string_tab[] = {
27347   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
27348   {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
27349   {&__pyx_n_u_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 1, 0, 1},
27350   {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
27351   {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
27352   {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
27353   {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
27354   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
27355   {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
27356   {&__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_k_Expected_at_least_d_argument_s_g, sizeof(__pyx_k_Expected_at_least_d_argument_s_g), 0, 0, 1, 0},
27357   {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0},
27358   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
27359   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
27360   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
27361   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
27362   {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
27363   {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
27364   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
27365   {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
27366   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
27367   {&__pyx_kp_s_No_matching_signature_found, __pyx_k_No_matching_signature_found, sizeof(__pyx_k_No_matching_signature_found), 0, 0, 1, 0},
27368   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
27369   {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
27370   {&__pyx_n_s_PIXELS_PER_PATH, __pyx_k_PIXELS_PER_PATH, sizeof(__pyx_k_PIXELS_PER_PATH), 0, 0, 1, 1},
27371   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
27372   {&__pyx_n_s_PyQt5_QtCore, __pyx_k_PyQt5_QtCore, sizeof(__pyx_k_PyQt5_QtCore), 0, 0, 1, 1},
27373   {&__pyx_n_s_PyQt5_QtGui, __pyx_k_PyQt5_QtGui, sizeof(__pyx_k_PyQt5_QtGui), 0, 0, 1, 1},
27374   {&__pyx_n_s_QByteArray, __pyx_k_QByteArray, sizeof(__pyx_k_QByteArray), 0, 0, 1, 1},
27375   {&__pyx_n_s_QDataStream, __pyx_k_QDataStream, sizeof(__pyx_k_QDataStream), 0, 0, 1, 1},
27376   {&__pyx_n_s_QPainterPath, __pyx_k_QPainterPath, sizeof(__pyx_k_QPainterPath), 0, 0, 1, 1},
27377   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
27378   {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
27379   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
27380   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
27381   {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
27382   {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
27383   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
27384   {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
27385   {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
27386   {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
27387   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
27388   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
27389   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
27390   {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
27391   {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
27392   {&__pyx_kp_s_char_2, __pyx_k_char_2, sizeof(__pyx_k_char_2), 0, 0, 1, 0},
27393   {&__pyx_kp_u_char_2, __pyx_k_char_2, sizeof(__pyx_k_char_2), 0, 1, 0, 0},
27394   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
27395   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
27396   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
27397   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
27398   {&__pyx_n_s_create_live_path, __pyx_k_create_live_path, sizeof(__pyx_k_create_live_path), 0, 0, 1, 1},
27399   {&__pyx_n_s_create_path, __pyx_k_create_path, sizeof(__pyx_k_create_path), 0, 0, 1, 1},
27400   {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
27401   {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1},
27402   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
27403   {&__pyx_kp_u_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 1, 0, 0},
27404   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
27405   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
27406   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
27407   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
27408   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
27409   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
27410   {&__pyx_kp_u_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 1, 0, 0},
27411   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
27412   {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
27413   {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
27414   {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
27415   {&__pyx_kp_s_float_2, __pyx_k_float_2, sizeof(__pyx_k_float_2), 0, 0, 1, 0},
27416   {&__pyx_kp_u_float_2, __pyx_k_float_2, sizeof(__pyx_k_float_2), 0, 1, 0, 0},
27417   {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1},
27418   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
27419   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
27420   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
27421   {&__pyx_n_s_fromRawData, __pyx_k_fromRawData, sizeof(__pyx_k_fromRawData), 0, 0, 1, 1},
27422   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
27423   {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
27424   {&__pyx_kp_u_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 1, 0, 0},
27425   {&__pyx_kp_u_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 1, 0, 0},
27426   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
27427   {&__pyx_kp_u_ii, __pyx_k_ii, sizeof(__pyx_k_ii), 0, 1, 0, 0},
27428   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
27429   {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
27430   {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
27431   {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
27432   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
27433   {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
27434   {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
27435   {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
27436   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
27437   {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
27438   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
27439   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
27440   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
27441   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
27442   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
27443   {&__pyx_n_s_negative, __pyx_k_negative, sizeof(__pyx_k_negative), 0, 0, 1, 1},
27444   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
27445   {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
27446   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
27447   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
27448   {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
27449   {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
27450   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
27451   {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
27452   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
27453   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
27454   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
27455   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
27456   {&__pyx_n_s_pyx_fuse_0create_live_path, __pyx_k_pyx_fuse_0create_live_path, sizeof(__pyx_k_pyx_fuse_0create_live_path), 0, 0, 1, 1},
27457   {&__pyx_n_s_pyx_fuse_0create_path, __pyx_k_pyx_fuse_0create_path, sizeof(__pyx_k_pyx_fuse_0create_path), 0, 0, 1, 1},
27458   {&__pyx_n_s_pyx_fuse_1create_live_path, __pyx_k_pyx_fuse_1create_live_path, sizeof(__pyx_k_pyx_fuse_1create_live_path), 0, 0, 1, 1},
27459   {&__pyx_n_s_pyx_fuse_1create_path, __pyx_k_pyx_fuse_1create_path, sizeof(__pyx_k_pyx_fuse_1create_path), 0, 0, 1, 1},
27460   {&__pyx_n_s_pyx_fuse_2create_live_path, __pyx_k_pyx_fuse_2create_live_path, sizeof(__pyx_k_pyx_fuse_2create_live_path), 0, 0, 1, 1},
27461   {&__pyx_n_s_pyx_fuse_2create_path, __pyx_k_pyx_fuse_2create_path, sizeof(__pyx_k_pyx_fuse_2create_path), 0, 0, 1, 1},
27462   {&__pyx_n_s_pyx_fuse_3create_live_path, __pyx_k_pyx_fuse_3create_live_path, sizeof(__pyx_k_pyx_fuse_3create_live_path), 0, 0, 1, 1},
27463   {&__pyx_n_s_pyx_fuse_3create_path, __pyx_k_pyx_fuse_3create_path, sizeof(__pyx_k_pyx_fuse_3create_path), 0, 0, 1, 1},
27464   {&__pyx_n_s_pyx_fuse_4create_live_path, __pyx_k_pyx_fuse_4create_live_path, sizeof(__pyx_k_pyx_fuse_4create_live_path), 0, 0, 1, 1},
27465   {&__pyx_n_s_pyx_fuse_4create_path, __pyx_k_pyx_fuse_4create_path, sizeof(__pyx_k_pyx_fuse_4create_path), 0, 0, 1, 1},
27466   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
27467   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
27468   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
27469   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
27470   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
27471   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
27472   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
27473   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
27474   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
27475   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
27476   {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1},
27477   {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
27478   {&__pyx_n_s_samples, __pyx_k_samples, sizeof(__pyx_k_samples), 0, 0, 1, 1},
27479   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
27480   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
27481   {&__pyx_n_s_settings, __pyx_k_settings, sizeof(__pyx_k_settings), 0, 0, 1, 1},
27482   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
27483   {&__pyx_n_s_short, __pyx_k_short, sizeof(__pyx_k_short), 0, 0, 1, 1},
27484   {&__pyx_kp_s_short_2, __pyx_k_short_2, sizeof(__pyx_k_short_2), 0, 0, 1, 0},
27485   {&__pyx_kp_u_short_2, __pyx_k_short_2, sizeof(__pyx_k_short_2), 0, 1, 0, 0},
27486   {&__pyx_n_s_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1},
27487   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
27488   {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
27489   {&__pyx_kp_s_src_urh_cythonext_path_creator_p, __pyx_k_src_urh_cythonext_path_creator_p, sizeof(__pyx_k_src_urh_cythonext_path_creator_p), 0, 0, 1, 0},
27490   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
27491   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
27492   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
27493   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
27494   {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
27495   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
27496   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
27497   {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
27498   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
27499   {&__pyx_n_s_subpath_ranges, __pyx_k_subpath_ranges, sizeof(__pyx_k_subpath_ranges), 0, 0, 1, 1},
27500   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
27501   {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1},
27502   {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
27503   {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
27504   {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
27505   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
27506   {&__pyx_kp_s_unsigned_char, __pyx_k_unsigned_char, sizeof(__pyx_k_unsigned_char), 0, 0, 1, 0},
27507   {&__pyx_kp_s_unsigned_char_2, __pyx_k_unsigned_char_2, sizeof(__pyx_k_unsigned_char_2), 0, 0, 1, 0},
27508   {&__pyx_kp_u_unsigned_char_2, __pyx_k_unsigned_char_2, sizeof(__pyx_k_unsigned_char_2), 0, 1, 0, 0},
27509   {&__pyx_kp_s_unsigned_short, __pyx_k_unsigned_short, sizeof(__pyx_k_unsigned_short), 0, 0, 1, 0},
27510   {&__pyx_kp_s_unsigned_short_2, __pyx_k_unsigned_short_2, sizeof(__pyx_k_unsigned_short_2), 0, 0, 1, 0},
27511   {&__pyx_kp_u_unsigned_short_2, __pyx_k_unsigned_short_2, sizeof(__pyx_k_unsigned_short_2), 0, 1, 0, 0},
27512   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
27513   {&__pyx_n_s_urh, __pyx_k_urh, sizeof(__pyx_k_urh), 0, 0, 1, 1},
27514   {&__pyx_n_s_urh_cythonext_path_creator, __pyx_k_urh_cythonext_path_creator, sizeof(__pyx_k_urh_cythonext_path_creator), 0, 0, 1, 1},
27515   {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
27516   {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
27517   {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1},
27518   {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
27519   {&__pyx_n_u_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 1, 0, 1},
27520   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
27521   {0, 0, 0, 0, 0, 0, 0}
27522 };
__Pyx_InitCachedBuiltins(void)27523 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
27524   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 19, __pyx_L1_error)
27525   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 19, __pyx_L1_error)
27526   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 947, __pyx_L1_error)
27527   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 133, __pyx_L1_error)
27528   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
27529   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
27530   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
27531   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
27532   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
27533   return 0;
27534   __pyx_L1_error:;
27535   return -1;
27536 }
27537 
__Pyx_InitCachedConstants(void)27538 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
27539   __Pyx_RefNannyDeclarations
27540   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
27541 
27542   /* "urh/cythonext/path_creator.pyx":19
27543  * import struct
27544  *
27545  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
27546  *     cdef iq[:] values
27547  *     cdef long long[::1] sample_rng
27548  */
27549   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 19, __pyx_L1_error)
27550   __Pyx_GOTREF(__pyx_tuple__4);
27551   __Pyx_GIVEREF(__pyx_tuple__4);
27552   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 19, __pyx_L1_error)
27553   __Pyx_GOTREF(__pyx_tuple__5);
27554   __Pyx_GIVEREF(__pyx_tuple__5);
27555 
27556   /* "urh/cythonext/path_creator.pyx":103
27557  *     """
27558  *     cdef long long n = x.shape[0]
27559  *     arr = np.zeros(n + 2, dtype=[('x', '>f8'), ('y', '>f8'), ('c', '>i4')])             # <<<<<<<<<<<<<<
27560  *
27561  *     byte_view = arr.view(dtype=np.uint8)
27562  */
27563   __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_u_x, __pyx_kp_u_f8); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 103, __pyx_L1_error)
27564   __Pyx_GOTREF(__pyx_tuple__11);
27565   __Pyx_GIVEREF(__pyx_tuple__11);
27566   __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_u_y, __pyx_kp_u_f8); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 103, __pyx_L1_error)
27567   __Pyx_GOTREF(__pyx_tuple__12);
27568   __Pyx_GIVEREF(__pyx_tuple__12);
27569   __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_u_c, __pyx_kp_u_i4); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 103, __pyx_L1_error)
27570   __Pyx_GOTREF(__pyx_tuple__13);
27571   __Pyx_GIVEREF(__pyx_tuple__13);
27572 
27573   /* "urh/cythonext/path_creator.pyx":106
27574  *
27575  *     byte_view = arr.view(dtype=np.uint8)
27576  *     byte_view[:12] = 0             # <<<<<<<<<<<<<<
27577  *     byte_view.data[12:20] = struct.pack('>ii', n, 0)
27578  *
27579  */
27580   __pyx_slice__14 = PySlice_New(Py_None, __pyx_int_12, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 106, __pyx_L1_error)
27581   __Pyx_GOTREF(__pyx_slice__14);
27582   __Pyx_GIVEREF(__pyx_slice__14);
27583 
27584   /* "urh/cythonext/path_creator.pyx":107
27585  *     byte_view = arr.view(dtype=np.uint8)
27586  *     byte_view[:12] = 0
27587  *     byte_view.data[12:20] = struct.pack('>ii', n, 0)             # <<<<<<<<<<<<<<
27588  *
27589  *     arr[1:n+1]['x'] = x
27590  */
27591   __pyx_slice__15 = PySlice_New(__pyx_int_12, __pyx_int_20, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 107, __pyx_L1_error)
27592   __Pyx_GOTREF(__pyx_slice__15);
27593   __Pyx_GIVEREF(__pyx_slice__15);
27594 
27595   /* "urh/cythonext/path_creator.pyx":114
27596  *
27597  *     cdef long long last_index = 20 * (n + 1)
27598  *     byte_view.data[last_index:last_index + 4] = struct.pack('>i', 0)             # <<<<<<<<<<<<<<
27599  *
27600  *     try:
27601  */
27602   __pyx_tuple__16 = PyTuple_Pack(2, __pyx_kp_u_i, __pyx_int_0); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 114, __pyx_L1_error)
27603   __Pyx_GOTREF(__pyx_tuple__16);
27604   __Pyx_GIVEREF(__pyx_tuple__16);
27605 
27606   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":947
27607  *         __pyx_import_array()
27608  *     except Exception:
27609  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
27610  *
27611  * cdef inline int import_umath() except -1:
27612  */
27613   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 947, __pyx_L1_error)
27614   __Pyx_GOTREF(__pyx_tuple__17);
27615   __Pyx_GIVEREF(__pyx_tuple__17);
27616 
27617   /* "../../../../../opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/numpy/__init__.pxd":953
27618  *         _import_umath()
27619  *     except Exception:
27620  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
27621  *
27622  * cdef inline int import_ufunc() except -1:
27623  */
27624   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 953, __pyx_L1_error)
27625   __Pyx_GOTREF(__pyx_tuple__18);
27626   __Pyx_GIVEREF(__pyx_tuple__18);
27627 
27628   /* "View.MemoryView":133
27629  *
27630  *         if not self.ndim:
27631  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
27632  *
27633  *         if itemsize <= 0:
27634  */
27635   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 133, __pyx_L1_error)
27636   __Pyx_GOTREF(__pyx_tuple__19);
27637   __Pyx_GIVEREF(__pyx_tuple__19);
27638 
27639   /* "View.MemoryView":136
27640  *
27641  *         if itemsize <= 0:
27642  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
27643  *
27644  *         if not isinstance(format, bytes):
27645  */
27646   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 136, __pyx_L1_error)
27647   __Pyx_GOTREF(__pyx_tuple__20);
27648   __Pyx_GIVEREF(__pyx_tuple__20);
27649 
27650   /* "View.MemoryView":148
27651  *
27652  *         if not self._shape:
27653  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
27654  *
27655  *
27656  */
27657   __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 148, __pyx_L1_error)
27658   __Pyx_GOTREF(__pyx_tuple__21);
27659   __Pyx_GIVEREF(__pyx_tuple__21);
27660 
27661   /* "View.MemoryView":176
27662  *             self.data = <char *>malloc(self.len)
27663  *             if not self.data:
27664  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
27665  *
27666  *             if self.dtype_is_object:
27667  */
27668   __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 176, __pyx_L1_error)
27669   __Pyx_GOTREF(__pyx_tuple__22);
27670   __Pyx_GIVEREF(__pyx_tuple__22);
27671 
27672   /* "View.MemoryView":192
27673  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27674  *         if not (flags & bufmode):
27675  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
27676  *         info.buf = self.data
27677  *         info.len = self.len
27678  */
27679   __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 192, __pyx_L1_error)
27680   __Pyx_GOTREF(__pyx_tuple__23);
27681   __Pyx_GIVEREF(__pyx_tuple__23);
27682 
27683   /* "(tree fragment)":2
27684  * def __reduce_cython__(self):
27685  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
27686  * def __setstate_cython__(self, __pyx_state):
27687  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27688  */
27689   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 2, __pyx_L1_error)
27690   __Pyx_GOTREF(__pyx_tuple__24);
27691   __Pyx_GIVEREF(__pyx_tuple__24);
27692 
27693   /* "(tree fragment)":4
27694  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27695  * def __setstate_cython__(self, __pyx_state):
27696  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
27697  */
27698   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 4, __pyx_L1_error)
27699   __Pyx_GOTREF(__pyx_tuple__25);
27700   __Pyx_GIVEREF(__pyx_tuple__25);
27701 
27702   /* "View.MemoryView":418
27703  *     def __setitem__(memoryview self, object index, object value):
27704  *         if self.view.readonly:
27705  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
27706  *
27707  *         have_slices, index = _unellipsify(index, self.view.ndim)
27708  */
27709   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 418, __pyx_L1_error)
27710   __Pyx_GOTREF(__pyx_tuple__26);
27711   __Pyx_GIVEREF(__pyx_tuple__26);
27712 
27713   /* "View.MemoryView":495
27714  *             result = struct.unpack(self.view.format, bytesitem)
27715  *         except struct.error:
27716  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
27717  *         else:
27718  *             if len(self.view.format) == 1:
27719  */
27720   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 495, __pyx_L1_error)
27721   __Pyx_GOTREF(__pyx_tuple__27);
27722   __Pyx_GIVEREF(__pyx_tuple__27);
27723 
27724   /* "View.MemoryView":520
27725  *     def __getbuffer__(self, Py_buffer *info, int flags):
27726  *         if flags & PyBUF_WRITABLE and self.view.readonly:
27727  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
27728  *
27729  *         if flags & PyBUF_ND:
27730  */
27731   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 520, __pyx_L1_error)
27732   __Pyx_GOTREF(__pyx_tuple__28);
27733   __Pyx_GIVEREF(__pyx_tuple__28);
27734 
27735   /* "View.MemoryView":570
27736  *         if self.view.strides == NULL:
27737  *
27738  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
27739  *
27740  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
27741  */
27742   __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 570, __pyx_L1_error)
27743   __Pyx_GOTREF(__pyx_tuple__29);
27744   __Pyx_GIVEREF(__pyx_tuple__29);
27745 
27746   /* "View.MemoryView":577
27747  *     def suboffsets(self):
27748  *         if self.view.suboffsets == NULL:
27749  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
27750  *
27751  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
27752  */
27753   __pyx_tuple__30 = PyTuple_New(1); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 577, __pyx_L1_error)
27754   __Pyx_GOTREF(__pyx_tuple__30);
27755   __Pyx_INCREF(__pyx_int_neg_1);
27756   __Pyx_GIVEREF(__pyx_int_neg_1);
27757   PyTuple_SET_ITEM(__pyx_tuple__30, 0, __pyx_int_neg_1);
27758   __Pyx_GIVEREF(__pyx_tuple__30);
27759 
27760   /* "(tree fragment)":2
27761  * def __reduce_cython__(self):
27762  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
27763  * def __setstate_cython__(self, __pyx_state):
27764  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27765  */
27766   __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 2, __pyx_L1_error)
27767   __Pyx_GOTREF(__pyx_tuple__31);
27768   __Pyx_GIVEREF(__pyx_tuple__31);
27769 
27770   /* "(tree fragment)":4
27771  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27772  * def __setstate_cython__(self, __pyx_state):
27773  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
27774  */
27775   __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 4, __pyx_L1_error)
27776   __Pyx_GOTREF(__pyx_tuple__32);
27777   __Pyx_GIVEREF(__pyx_tuple__32);
27778 
27779   /* "View.MemoryView":682
27780  *         if item is Ellipsis:
27781  *             if not seen_ellipsis:
27782  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
27783  *                 seen_ellipsis = True
27784  *             else:
27785  */
27786   __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(2, 682, __pyx_L1_error)
27787   __Pyx_GOTREF(__pyx_slice__33);
27788   __Pyx_GIVEREF(__pyx_slice__33);
27789 
27790   /* "View.MemoryView":703
27791  *     for suboffset in suboffsets[:ndim]:
27792  *         if suboffset >= 0:
27793  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
27794  *
27795  *
27796  */
27797   __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 703, __pyx_L1_error)
27798   __Pyx_GOTREF(__pyx_tuple__34);
27799   __Pyx_GIVEREF(__pyx_tuple__34);
27800 
27801   /* "(tree fragment)":2
27802  * def __reduce_cython__(self):
27803  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
27804  * def __setstate_cython__(self, __pyx_state):
27805  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27806  */
27807   __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 2, __pyx_L1_error)
27808   __Pyx_GOTREF(__pyx_tuple__35);
27809   __Pyx_GIVEREF(__pyx_tuple__35);
27810 
27811   /* "(tree fragment)":4
27812  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27813  * def __setstate_cython__(self, __pyx_state):
27814  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
27815  */
27816   __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 4, __pyx_L1_error)
27817   __Pyx_GOTREF(__pyx_tuple__36);
27818   __Pyx_GIVEREF(__pyx_tuple__36);
27819 
27820   /* "urh/cythonext/path_creator.pyx":19
27821  * import struct
27822  *
27823  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
27824  *     cdef iq[:] values
27825  *     cdef long long[::1] sample_rng
27826  */
27827   __pyx_tuple__37 = PyTuple_Pack(4, __pyx_n_s_samples, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_subpath_ranges); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 19, __pyx_L1_error)
27828   __Pyx_GOTREF(__pyx_tuple__37);
27829   __Pyx_GIVEREF(__pyx_tuple__37);
27830   __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_urh_cythonext_path_creator_p, __pyx_n_s_pyx_fuse_0create_path, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 19, __pyx_L1_error)
27831 
27832   /* "urh/cythonext/path_creator.pyx":85
27833  *
27834  *
27835  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):             # <<<<<<<<<<<<<<
27836  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
27837  *
27838  */
27839   __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_samples, __pyx_n_s_start, __pyx_n_s_end); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 85, __pyx_L1_error)
27840   __Pyx_GOTREF(__pyx_tuple__39);
27841   __Pyx_GIVEREF(__pyx_tuple__39);
27842   __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_urh_cythonext_path_creator_p, __pyx_n_s_pyx_fuse_0create_live_path, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 85, __pyx_L1_error)
27843 
27844   /* "View.MemoryView":286
27845  *         return self.name
27846  *
27847  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
27848  * cdef strided = Enum("<strided and direct>") # default
27849  * cdef indirect = Enum("<strided and indirect>")
27850  */
27851   __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 286, __pyx_L1_error)
27852   __Pyx_GOTREF(__pyx_tuple__41);
27853   __Pyx_GIVEREF(__pyx_tuple__41);
27854 
27855   /* "View.MemoryView":287
27856  *
27857  * cdef generic = Enum("<strided and direct or indirect>")
27858  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
27859  * cdef indirect = Enum("<strided and indirect>")
27860  *
27861  */
27862   __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 287, __pyx_L1_error)
27863   __Pyx_GOTREF(__pyx_tuple__42);
27864   __Pyx_GIVEREF(__pyx_tuple__42);
27865 
27866   /* "View.MemoryView":288
27867  * cdef generic = Enum("<strided and direct or indirect>")
27868  * cdef strided = Enum("<strided and direct>") # default
27869  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
27870  *
27871  *
27872  */
27873   __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 288, __pyx_L1_error)
27874   __Pyx_GOTREF(__pyx_tuple__43);
27875   __Pyx_GIVEREF(__pyx_tuple__43);
27876 
27877   /* "View.MemoryView":291
27878  *
27879  *
27880  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
27881  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27882  *
27883  */
27884   __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 291, __pyx_L1_error)
27885   __Pyx_GOTREF(__pyx_tuple__44);
27886   __Pyx_GIVEREF(__pyx_tuple__44);
27887 
27888   /* "View.MemoryView":292
27889  *
27890  * cdef contiguous = Enum("<contiguous and direct>")
27891  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
27892  *
27893  *
27894  */
27895   __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 292, __pyx_L1_error)
27896   __Pyx_GOTREF(__pyx_tuple__45);
27897   __Pyx_GIVEREF(__pyx_tuple__45);
27898 
27899   /* "(tree fragment)":1
27900  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
27901  *     cdef object __pyx_PickleError
27902  *     cdef object __pyx_result
27903  */
27904   __pyx_tuple__46 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 1, __pyx_L1_error)
27905   __Pyx_GOTREF(__pyx_tuple__46);
27906   __Pyx_GIVEREF(__pyx_tuple__46);
27907   __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(2, 1, __pyx_L1_error)
27908   __Pyx_RefNannyFinishContext();
27909   return 0;
27910   __pyx_L1_error:;
27911   __Pyx_RefNannyFinishContext();
27912   return -1;
27913 }
27914 
__Pyx_InitGlobals(void)27915 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
27916   /* InitThreads.init */
27917   #ifdef WITH_THREAD
27918 PyEval_InitThreads();
27919 #endif
27920 
27921 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27922 
27923   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
27924   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
27925   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27926   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27927   __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
27928   __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error)
27929   __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error)
27930   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
27931   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27932   return 0;
27933   __pyx_L1_error:;
27934   return -1;
27935 }
27936 
27937 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
27938 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
27939 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
27940 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
27941 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
27942 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
27943 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
27944 
__Pyx_modinit_global_init_code(void)27945 static int __Pyx_modinit_global_init_code(void) {
27946   __Pyx_RefNannyDeclarations
27947   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
27948   /*--- Global init code ---*/
27949   generic = Py_None; Py_INCREF(Py_None);
27950   strided = Py_None; Py_INCREF(Py_None);
27951   indirect = Py_None; Py_INCREF(Py_None);
27952   contiguous = Py_None; Py_INCREF(Py_None);
27953   indirect_contiguous = Py_None; Py_INCREF(Py_None);
27954   __Pyx_RefNannyFinishContext();
27955   return 0;
27956 }
27957 
__Pyx_modinit_variable_export_code(void)27958 static int __Pyx_modinit_variable_export_code(void) {
27959   __Pyx_RefNannyDeclarations
27960   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
27961   /*--- Variable export code ---*/
27962   __Pyx_RefNannyFinishContext();
27963   return 0;
27964 }
27965 
__Pyx_modinit_function_export_code(void)27966 static int __Pyx_modinit_function_export_code(void) {
27967   __Pyx_RefNannyDeclarations
27968   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
27969   /*--- Function export code ---*/
27970   __Pyx_RefNannyFinishContext();
27971   return 0;
27972 }
27973 
__Pyx_modinit_type_init_code(void)27974 static int __Pyx_modinit_type_init_code(void) {
27975   __Pyx_RefNannyDeclarations
27976   int __pyx_lineno = 0;
27977   const char *__pyx_filename = NULL;
27978   int __pyx_clineno = 0;
27979   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
27980   /*--- Type init code ---*/
27981   __pyx_vtabptr_array = &__pyx_vtable_array;
27982   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
27983   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
27984   #if PY_VERSION_HEX < 0x030800B1
27985   __pyx_type___pyx_array.tp_print = 0;
27986   #endif
27987   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
27988   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
27989   __pyx_array_type = &__pyx_type___pyx_array;
27990   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
27991   #if PY_VERSION_HEX < 0x030800B1
27992   __pyx_type___pyx_MemviewEnum.tp_print = 0;
27993   #endif
27994   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
27995     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27996   }
27997   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
27998   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27999   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
28000   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
28001   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
28002   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
28003   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
28004   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
28005   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
28006   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
28007   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
28008   #if PY_VERSION_HEX < 0x030800B1
28009   __pyx_type___pyx_memoryview.tp_print = 0;
28010   #endif
28011   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
28012     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
28013   }
28014   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
28015   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
28016   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
28017   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
28018   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
28019   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
28020   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
28021   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
28022   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
28023   #if PY_VERSION_HEX < 0x030800B1
28024   __pyx_type___pyx_memoryviewslice.tp_print = 0;
28025   #endif
28026   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
28027     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
28028   }
28029   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
28030   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
28031   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
28032   __Pyx_RefNannyFinishContext();
28033   return 0;
28034   __pyx_L1_error:;
28035   __Pyx_RefNannyFinishContext();
28036   return -1;
28037 }
28038 
__Pyx_modinit_type_import_code(void)28039 static int __Pyx_modinit_type_import_code(void) {
28040   __Pyx_RefNannyDeclarations
28041   PyObject *__pyx_t_1 = NULL;
28042   int __pyx_lineno = 0;
28043   const char *__pyx_filename = NULL;
28044   int __pyx_clineno = 0;
28045   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
28046   /*--- Type import code ---*/
28047   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
28048   __Pyx_GOTREF(__pyx_t_1);
28049   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
28050   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28051   sizeof(PyTypeObject),
28052   #else
28053   sizeof(PyHeapTypeObject),
28054   #endif
28055   __Pyx_ImportType_CheckSize_Warn);
28056    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
28057   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28058   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
28059   __Pyx_GOTREF(__pyx_t_1);
28060   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
28061    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
28062   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
28063    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
28064   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
28065    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
28066   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
28067    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
28068   __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28069    if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
28070   __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28071    if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
28072   __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28073    if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
28074   __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28075    if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
28076   __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28077    if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
28078   __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28079    if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
28080   __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28081    if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
28082   __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28083    if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
28084   __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28085    if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
28086   __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
28087    if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
28088   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
28089    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
28090   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28091   __Pyx_RefNannyFinishContext();
28092   return 0;
28093   __pyx_L1_error:;
28094   __Pyx_XDECREF(__pyx_t_1);
28095   __Pyx_RefNannyFinishContext();
28096   return -1;
28097 }
28098 
__Pyx_modinit_variable_import_code(void)28099 static int __Pyx_modinit_variable_import_code(void) {
28100   __Pyx_RefNannyDeclarations
28101   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
28102   /*--- Variable import code ---*/
28103   __Pyx_RefNannyFinishContext();
28104   return 0;
28105 }
28106 
__Pyx_modinit_function_import_code(void)28107 static int __Pyx_modinit_function_import_code(void) {
28108   __Pyx_RefNannyDeclarations
28109   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
28110   /*--- Function import code ---*/
28111   __Pyx_RefNannyFinishContext();
28112   return 0;
28113 }
28114 
28115 
28116 #ifndef CYTHON_NO_PYINIT_EXPORT
28117 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
28118 #elif PY_MAJOR_VERSION < 3
28119 #ifdef __cplusplus
28120 #define __Pyx_PyMODINIT_FUNC extern "C" void
28121 #else
28122 #define __Pyx_PyMODINIT_FUNC void
28123 #endif
28124 #else
28125 #ifdef __cplusplus
28126 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
28127 #else
28128 #define __Pyx_PyMODINIT_FUNC PyObject *
28129 #endif
28130 #endif
28131 
28132 
28133 #if PY_MAJOR_VERSION < 3
28134 __Pyx_PyMODINIT_FUNC initpath_creator(void) CYTHON_SMALL_CODE; /*proto*/
initpath_creator(void)28135 __Pyx_PyMODINIT_FUNC initpath_creator(void)
28136 #else
28137 __Pyx_PyMODINIT_FUNC PyInit_path_creator(void) CYTHON_SMALL_CODE; /*proto*/
28138 __Pyx_PyMODINIT_FUNC PyInit_path_creator(void)
28139 #if CYTHON_PEP489_MULTI_PHASE_INIT
28140 {
28141   return PyModuleDef_Init(&__pyx_moduledef);
28142 }
28143 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
28144     #if PY_VERSION_HEX >= 0x030700A1
28145     static PY_INT64_T main_interpreter_id = -1;
28146     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
28147     if (main_interpreter_id == -1) {
28148         main_interpreter_id = current_id;
28149         return (unlikely(current_id == -1)) ? -1 : 0;
28150     } else if (unlikely(main_interpreter_id != current_id))
28151     #else
28152     static PyInterpreterState *main_interpreter = NULL;
28153     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
28154     if (!main_interpreter) {
28155         main_interpreter = current_interpreter;
28156     } else if (unlikely(main_interpreter != current_interpreter))
28157     #endif
28158     {
28159         PyErr_SetString(
28160             PyExc_ImportError,
28161             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
28162         return -1;
28163     }
28164     return 0;
28165 }
28166 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) {
28167     PyObject *value = PyObject_GetAttrString(spec, from_name);
28168     int result = 0;
28169     if (likely(value)) {
28170         if (allow_none || value != Py_None) {
28171             result = PyDict_SetItemString(moddict, to_name, value);
28172         }
28173         Py_DECREF(value);
28174     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
28175         PyErr_Clear();
28176     } else {
28177         result = -1;
28178     }
28179     return result;
28180 }
28181 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
28182     PyObject *module = NULL, *moddict, *modname;
28183     if (__Pyx_check_single_interpreter())
28184         return NULL;
28185     if (__pyx_m)
28186         return __Pyx_NewRef(__pyx_m);
28187     modname = PyObject_GetAttrString(spec, "name");
28188     if (unlikely(!modname)) goto bad;
28189     module = PyModule_NewObject(modname);
28190     Py_DECREF(modname);
28191     if (unlikely(!module)) goto bad;
28192     moddict = PyModule_GetDict(module);
28193     if (unlikely(!moddict)) goto bad;
28194     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
28195     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
28196     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
28197     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
28198     return module;
28199 bad:
28200     Py_XDECREF(module);
28201     return NULL;
28202 }
28203 
28204 
28205 static CYTHON_SMALL_CODE int __pyx_pymod_exec_path_creator(PyObject *__pyx_pyinit_module)
28206 #endif
28207 #endif
28208 {
28209   PyObject *__pyx_t_1 = NULL;
28210   PyObject *__pyx_t_2 = NULL;
28211   PyObject *__pyx_t_3 = NULL;
28212   static PyThread_type_lock __pyx_t_4[8];
28213   int __pyx_lineno = 0;
28214   const char *__pyx_filename = NULL;
28215   int __pyx_clineno = 0;
28216   __Pyx_RefNannyDeclarations
28217   #if CYTHON_PEP489_MULTI_PHASE_INIT
28218   if (__pyx_m) {
28219     if (__pyx_m == __pyx_pyinit_module) return 0;
28220     PyErr_SetString(PyExc_RuntimeError, "Module 'path_creator' has already been imported. Re-initialisation is not supported.");
28221     return -1;
28222   }
28223   #elif PY_MAJOR_VERSION >= 3
28224   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
28225   #endif
28226   #if CYTHON_REFNANNY
28227 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
28228 if (!__Pyx_RefNanny) {
28229   PyErr_Clear();
28230   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
28231   if (!__Pyx_RefNanny)
28232       Py_FatalError("failed to import 'refnanny' module");
28233 }
28234 #endif
28235   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_path_creator(void)", 0);
28236   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28237   #ifdef __Pxy_PyFrame_Initialize_Offsets
28238   __Pxy_PyFrame_Initialize_Offsets();
28239   #endif
28240   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
28241   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
28242   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
28243   #ifdef __Pyx_CyFunction_USED
28244   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28245   #endif
28246   #ifdef __Pyx_FusedFunction_USED
28247   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28248   #endif
28249   #ifdef __Pyx_Coroutine_USED
28250   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28251   #endif
28252   #ifdef __Pyx_Generator_USED
28253   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28254   #endif
28255   #ifdef __Pyx_AsyncGen_USED
28256   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28257   #endif
28258   #ifdef __Pyx_StopAsyncIteration_USED
28259   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28260   #endif
28261   /*--- Library function declarations ---*/
28262   /*--- Threads initialization code ---*/
28263   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
28264   #ifdef WITH_THREAD /* Python build with threading support? */
28265   PyEval_InitThreads();
28266   #endif
28267   #endif
28268   /*--- Module creation code ---*/
28269   #if CYTHON_PEP489_MULTI_PHASE_INIT
28270   __pyx_m = __pyx_pyinit_module;
28271   Py_INCREF(__pyx_m);
28272   #else
28273   #if PY_MAJOR_VERSION < 3
28274   __pyx_m = Py_InitModule4("path_creator", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
28275   #else
28276   __pyx_m = PyModule_Create(&__pyx_moduledef);
28277   #endif
28278   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
28279   #endif
28280   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
28281   Py_INCREF(__pyx_d);
28282   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
28283   Py_INCREF(__pyx_b);
28284   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
28285   Py_INCREF(__pyx_cython_runtime);
28286   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
28287   /*--- Initialize various global constants etc. ---*/
28288   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28289   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
28290   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28291   #endif
28292   if (__pyx_module_is_main_urh__cythonext__path_creator) {
28293     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28294   }
28295   #if PY_MAJOR_VERSION >= 3
28296   {
28297     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
28298     if (!PyDict_GetItemString(modules, "urh.cythonext.path_creator")) {
28299       if (unlikely(PyDict_SetItemString(modules, "urh.cythonext.path_creator", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
28300     }
28301   }
28302   #endif
28303   /*--- Builtin init code ---*/
28304   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28305   /*--- Constants init code ---*/
28306   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28307   /*--- Global type/function init code ---*/
28308   (void)__Pyx_modinit_global_init_code();
28309   (void)__Pyx_modinit_variable_export_code();
28310   (void)__Pyx_modinit_function_export_code();
28311   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
28312   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
28313   (void)__Pyx_modinit_variable_import_code();
28314   (void)__Pyx_modinit_function_import_code();
28315   /*--- Execution code ---*/
28316   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
28317   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28318   #endif
28319 
28320   /* "urh/cythonext/path_creator.pyx":3
28321  * # noinspection PyUnresolvedReferences
28322  * cimport numpy as np
28323  * import numpy as np             # <<<<<<<<<<<<<<
28324  * from PyQt5.QtCore import QByteArray, QDataStream
28325  * from PyQt5.QtGui import QPainterPath
28326  */
28327   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
28328   __Pyx_GOTREF(__pyx_t_1);
28329   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
28330   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28331 
28332   /* "urh/cythonext/path_creator.pyx":4
28333  * cimport numpy as np
28334  * import numpy as np
28335  * from PyQt5.QtCore import QByteArray, QDataStream             # <<<<<<<<<<<<<<
28336  * from PyQt5.QtGui import QPainterPath
28337  *
28338  */
28339   __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
28340   __Pyx_GOTREF(__pyx_t_1);
28341   __Pyx_INCREF(__pyx_n_s_QByteArray);
28342   __Pyx_GIVEREF(__pyx_n_s_QByteArray);
28343   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_QByteArray);
28344   __Pyx_INCREF(__pyx_n_s_QDataStream);
28345   __Pyx_GIVEREF(__pyx_n_s_QDataStream);
28346   PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_QDataStream);
28347   __pyx_t_2 = __Pyx_Import(__pyx_n_s_PyQt5_QtCore, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
28348   __Pyx_GOTREF(__pyx_t_2);
28349   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28350   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_QByteArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
28351   __Pyx_GOTREF(__pyx_t_1);
28352   if (PyDict_SetItem(__pyx_d, __pyx_n_s_QByteArray, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
28353   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28354   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_QDataStream); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
28355   __Pyx_GOTREF(__pyx_t_1);
28356   if (PyDict_SetItem(__pyx_d, __pyx_n_s_QDataStream, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
28357   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28358   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28359 
28360   /* "urh/cythonext/path_creator.pyx":5
28361  * import numpy as np
28362  * from PyQt5.QtCore import QByteArray, QDataStream
28363  * from PyQt5.QtGui import QPainterPath             # <<<<<<<<<<<<<<
28364  *
28365  * # As we do not use any numpy C API functions we do no import_array here,
28366  */
28367   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
28368   __Pyx_GOTREF(__pyx_t_2);
28369   __Pyx_INCREF(__pyx_n_s_QPainterPath);
28370   __Pyx_GIVEREF(__pyx_n_s_QPainterPath);
28371   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_QPainterPath);
28372   __pyx_t_1 = __Pyx_Import(__pyx_n_s_PyQt5_QtGui, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
28373   __Pyx_GOTREF(__pyx_t_1);
28374   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28375   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_QPainterPath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
28376   __Pyx_GOTREF(__pyx_t_2);
28377   if (PyDict_SetItem(__pyx_d, __pyx_n_s_QPainterPath, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
28378   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28379   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28380 
28381   /* "urh/cythonext/path_creator.pyx":14
28382  * from urh.cythonext.util cimport iq
28383  *
28384  * from urh import settings             # <<<<<<<<<<<<<<
28385  * import cython
28386  * import math
28387  */
28388   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
28389   __Pyx_GOTREF(__pyx_t_1);
28390   __Pyx_INCREF(__pyx_n_s_settings);
28391   __Pyx_GIVEREF(__pyx_n_s_settings);
28392   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_settings);
28393   __pyx_t_2 = __Pyx_Import(__pyx_n_s_urh, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
28394   __Pyx_GOTREF(__pyx_t_2);
28395   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28396   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
28397   __Pyx_GOTREF(__pyx_t_1);
28398   if (PyDict_SetItem(__pyx_d, __pyx_n_s_settings, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
28399   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28400   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28401 
28402   /* "urh/cythonext/path_creator.pyx":16
28403  * from urh import settings
28404  * import cython
28405  * import math             # <<<<<<<<<<<<<<
28406  * import struct
28407  *
28408  */
28409   __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
28410   __Pyx_GOTREF(__pyx_t_2);
28411   if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
28412   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28413 
28414   /* "urh/cythonext/path_creator.pyx":17
28415  * import cython
28416  * import math
28417  * import struct             # <<<<<<<<<<<<<<
28418  *
28419  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):
28420  */
28421   __pyx_t_2 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
28422   __Pyx_GOTREF(__pyx_t_2);
28423   if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
28424   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28425 
28426   /* "urh/cythonext/path_creator.pyx":19
28427  * import struct
28428  *
28429  * cpdef create_path(iq[:] samples, long long start, long long end, list subpath_ranges=None):             # <<<<<<<<<<<<<<
28430  *     cdef iq[:] values
28431  *     cdef long long[::1] sample_rng
28432  */
28433   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
28434   __Pyx_GOTREF(__pyx_t_2);
28435   __Pyx_INCREF(Py_None);
28436   __Pyx_GIVEREF(Py_None);
28437   PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
28438   __Pyx_INCREF(Py_None);
28439   __pyx_k_ = Py_None;
28440   __Pyx_GIVEREF(Py_None);
28441   __Pyx_INCREF(Py_None);
28442   __pyx_k__6 = ((PyObject*)Py_None);
28443   __Pyx_GIVEREF(Py_None);
28444   __Pyx_INCREF(Py_None);
28445   __pyx_k__6 = ((PyObject*)Py_None);
28446   __Pyx_GIVEREF(Py_None);
28447   __Pyx_INCREF(Py_None);
28448   __pyx_k__7 = ((PyObject*)Py_None);
28449   __Pyx_GIVEREF(Py_None);
28450   __Pyx_INCREF(Py_None);
28451   __pyx_k__7 = ((PyObject*)Py_None);
28452   __Pyx_GIVEREF(Py_None);
28453   __Pyx_INCREF(Py_None);
28454   __pyx_k__8 = ((PyObject*)Py_None);
28455   __Pyx_GIVEREF(Py_None);
28456   __Pyx_INCREF(Py_None);
28457   __pyx_k__8 = ((PyObject*)Py_None);
28458   __Pyx_GIVEREF(Py_None);
28459   __Pyx_INCREF(Py_None);
28460   __pyx_k__9 = ((PyObject*)Py_None);
28461   __Pyx_GIVEREF(Py_None);
28462   __Pyx_INCREF(Py_None);
28463   __pyx_k__9 = ((PyObject*)Py_None);
28464   __Pyx_GIVEREF(Py_None);
28465   __Pyx_INCREF(Py_None);
28466   __pyx_k__10 = ((PyObject*)Py_None);
28467   __Pyx_GIVEREF(Py_None);
28468   __Pyx_INCREF(Py_None);
28469   __pyx_k__10 = ((PyObject*)Py_None);
28470   __Pyx_GIVEREF(Py_None);
28471   __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
28472   __Pyx_GOTREF(__pyx_t_1);
28473   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_3urh_9cythonext_12path_creator_7__pyx_fuse_0create_path, 0, __pyx_n_s_pyx_fuse_0create_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
28474   __Pyx_GOTREF(__pyx_t_3);
28475   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
28476   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_char, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
28477   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28478   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_3urh_9cythonext_12path_creator_9__pyx_fuse_1create_path, 0, __pyx_n_s_pyx_fuse_1create_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
28479   __Pyx_GOTREF(__pyx_t_3);
28480   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
28481   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_char, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
28482   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28483   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_3urh_9cythonext_12path_creator_11__pyx_fuse_2create_path, 0, __pyx_n_s_pyx_fuse_2create_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
28484   __Pyx_GOTREF(__pyx_t_3);
28485   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
28486   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_short, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
28487   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28488   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_3urh_9cythonext_12path_creator_13__pyx_fuse_3create_path, 0, __pyx_n_s_pyx_fuse_3create_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
28489   __Pyx_GOTREF(__pyx_t_3);
28490   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
28491   if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_short, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
28492   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28493   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_3urh_9cythonext_12path_creator_15__pyx_fuse_4create_path, 0, __pyx_n_s_pyx_fuse_4create_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
28494   __Pyx_GOTREF(__pyx_t_3);
28495   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
28496   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
28497   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28498   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_3urh_9cythonext_12path_creator_1create_path, 0, __pyx_n_s_create_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
28499   __Pyx_GOTREF(__pyx_t_3);
28500   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
28501   ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_1;
28502   __Pyx_GIVEREF(__pyx_t_1);
28503   __pyx_t_1 = 0;
28504   if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_path, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
28505   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28506   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28507 
28508   /* "urh/cythonext/path_creator.pyx":85
28509  *
28510  *
28511  * cpdef create_live_path(iq[:] samples, unsigned int start, unsigned int end):             # <<<<<<<<<<<<<<
28512  *     return array_to_QPath(np.arange(start, end).astype(np.int64), samples)
28513  *
28514  */
28515   __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
28516   __Pyx_GOTREF(__pyx_t_2);
28517   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_3urh_9cythonext_12path_creator_19__pyx_fuse_0create_live_path, 0, __pyx_n_s_pyx_fuse_0create_live_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
28518   __Pyx_GOTREF(__pyx_t_3);
28519   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
28520   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_char, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
28521   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28522   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_3urh_9cythonext_12path_creator_21__pyx_fuse_1create_live_path, 0, __pyx_n_s_pyx_fuse_1create_live_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
28523   __Pyx_GOTREF(__pyx_t_3);
28524   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
28525   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_unsigned_char, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
28526   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28527   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_3urh_9cythonext_12path_creator_23__pyx_fuse_2create_live_path, 0, __pyx_n_s_pyx_fuse_2create_live_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
28528   __Pyx_GOTREF(__pyx_t_3);
28529   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
28530   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_short, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
28531   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28532   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_3urh_9cythonext_12path_creator_25__pyx_fuse_3create_live_path, 0, __pyx_n_s_pyx_fuse_3create_live_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
28533   __Pyx_GOTREF(__pyx_t_3);
28534   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
28535   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_unsigned_short, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
28536   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28537   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_3urh_9cythonext_12path_creator_27__pyx_fuse_4create_live_path, 0, __pyx_n_s_pyx_fuse_4create_live_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
28538   __Pyx_GOTREF(__pyx_t_3);
28539   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
28540   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
28541   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28542   __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_3urh_9cythonext_12path_creator_3create_live_path, 0, __pyx_n_s_create_live_path, NULL, __pyx_n_s_urh_cythonext_path_creator, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
28543   __Pyx_GOTREF(__pyx_t_3);
28544   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
28545   ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_2;
28546   __Pyx_GIVEREF(__pyx_t_2);
28547   __pyx_t_2 = 0;
28548   if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_live_path, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
28549   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28550 
28551   /* "urh/cythonext/path_creator.pyx":1
28552  * # noinspection PyUnresolvedReferences             # <<<<<<<<<<<<<<
28553  * cimport numpy as np
28554  * import numpy as np
28555  */
28556   __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
28557   __Pyx_GOTREF(__pyx_t_3);
28558   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28559   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28560 
28561   /* "View.MemoryView":209
28562  *         info.obj = self
28563  *
28564  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
28565  *
28566  *     def __dealloc__(array self):
28567  */
28568   __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 209, __pyx_L1_error)
28569   __Pyx_GOTREF(__pyx_t_3);
28570   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
28571   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28572   PyType_Modified(__pyx_array_type);
28573 
28574   /* "View.MemoryView":286
28575  *         return self.name
28576  *
28577  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
28578  * cdef strided = Enum("<strided and direct>") # default
28579  * cdef indirect = Enum("<strided and indirect>")
28580  */
28581   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 286, __pyx_L1_error)
28582   __Pyx_GOTREF(__pyx_t_3);
28583   __Pyx_XGOTREF(generic);
28584   __Pyx_DECREF_SET(generic, __pyx_t_3);
28585   __Pyx_GIVEREF(__pyx_t_3);
28586   __pyx_t_3 = 0;
28587 
28588   /* "View.MemoryView":287
28589  *
28590  * cdef generic = Enum("<strided and direct or indirect>")
28591  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
28592  * cdef indirect = Enum("<strided and indirect>")
28593  *
28594  */
28595   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 287, __pyx_L1_error)
28596   __Pyx_GOTREF(__pyx_t_3);
28597   __Pyx_XGOTREF(strided);
28598   __Pyx_DECREF_SET(strided, __pyx_t_3);
28599   __Pyx_GIVEREF(__pyx_t_3);
28600   __pyx_t_3 = 0;
28601 
28602   /* "View.MemoryView":288
28603  * cdef generic = Enum("<strided and direct or indirect>")
28604  * cdef strided = Enum("<strided and direct>") # default
28605  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
28606  *
28607  *
28608  */
28609   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 288, __pyx_L1_error)
28610   __Pyx_GOTREF(__pyx_t_3);
28611   __Pyx_XGOTREF(indirect);
28612   __Pyx_DECREF_SET(indirect, __pyx_t_3);
28613   __Pyx_GIVEREF(__pyx_t_3);
28614   __pyx_t_3 = 0;
28615 
28616   /* "View.MemoryView":291
28617  *
28618  *
28619  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
28620  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
28621  *
28622  */
28623   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 291, __pyx_L1_error)
28624   __Pyx_GOTREF(__pyx_t_3);
28625   __Pyx_XGOTREF(contiguous);
28626   __Pyx_DECREF_SET(contiguous, __pyx_t_3);
28627   __Pyx_GIVEREF(__pyx_t_3);
28628   __pyx_t_3 = 0;
28629 
28630   /* "View.MemoryView":292
28631  *
28632  * cdef contiguous = Enum("<contiguous and direct>")
28633  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
28634  *
28635  *
28636  */
28637   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 292, __pyx_L1_error)
28638   __Pyx_GOTREF(__pyx_t_3);
28639   __Pyx_XGOTREF(indirect_contiguous);
28640   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3);
28641   __Pyx_GIVEREF(__pyx_t_3);
28642   __pyx_t_3 = 0;
28643 
28644   /* "View.MemoryView":316
28645  *
28646  * DEF THREAD_LOCKS_PREALLOCATED = 8
28647  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
28648  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
28649  *     PyThread_allocate_lock(),
28650  */
28651   __pyx_memoryview_thread_locks_used = 0;
28652 
28653   /* "View.MemoryView":317
28654  * DEF THREAD_LOCKS_PREALLOCATED = 8
28655  * cdef int __pyx_memoryview_thread_locks_used = 0
28656  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
28657  *     PyThread_allocate_lock(),
28658  *     PyThread_allocate_lock(),
28659  */
28660   __pyx_t_4[0] = PyThread_allocate_lock();
28661   __pyx_t_4[1] = PyThread_allocate_lock();
28662   __pyx_t_4[2] = PyThread_allocate_lock();
28663   __pyx_t_4[3] = PyThread_allocate_lock();
28664   __pyx_t_4[4] = PyThread_allocate_lock();
28665   __pyx_t_4[5] = PyThread_allocate_lock();
28666   __pyx_t_4[6] = PyThread_allocate_lock();
28667   __pyx_t_4[7] = PyThread_allocate_lock();
28668   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
28669 
28670   /* "View.MemoryView":549
28671  *         info.obj = self
28672  *
28673  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
28674  *
28675  *
28676  */
28677   __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 549, __pyx_L1_error)
28678   __Pyx_GOTREF(__pyx_t_3);
28679   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
28680   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28681   PyType_Modified(__pyx_memoryview_type);
28682 
28683   /* "View.MemoryView":995
28684  *         return self.from_object
28685  *
28686  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
28687  *
28688  *
28689  */
28690   __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 995, __pyx_L1_error)
28691   __Pyx_GOTREF(__pyx_t_3);
28692   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
28693   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28694   PyType_Modified(__pyx_memoryviewslice_type);
28695 
28696   /* "(tree fragment)":1
28697  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
28698  *     cdef object __pyx_PickleError
28699  *     cdef object __pyx_result
28700  */
28701   __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1, __pyx_L1_error)
28702   __Pyx_GOTREF(__pyx_t_3);
28703   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_3) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
28704   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28705 
28706   /* "(tree fragment)":11
28707  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
28708  *     return __pyx_result
28709  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
28710  *     __pyx_result.name = __pyx_state[0]
28711  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
28712  */
28713 
28714   /*--- Wrapped vars code ---*/
28715 
28716   goto __pyx_L0;
28717   __pyx_L1_error:;
28718   __Pyx_XDECREF(__pyx_t_1);
28719   __Pyx_XDECREF(__pyx_t_2);
28720   __Pyx_XDECREF(__pyx_t_3);
28721   if (__pyx_m) {
28722     if (__pyx_d) {
28723       __Pyx_AddTraceback("init urh.cythonext.path_creator", __pyx_clineno, __pyx_lineno, __pyx_filename);
28724     }
28725     Py_CLEAR(__pyx_m);
28726   } else if (!PyErr_Occurred()) {
28727     PyErr_SetString(PyExc_ImportError, "init urh.cythonext.path_creator");
28728   }
28729   __pyx_L0:;
28730   __Pyx_RefNannyFinishContext();
28731   #if CYTHON_PEP489_MULTI_PHASE_INIT
28732   return (__pyx_m != NULL) ? 0 : -1;
28733   #elif PY_MAJOR_VERSION >= 3
28734   return __pyx_m;
28735   #else
28736   return;
28737   #endif
28738 }
28739 
28740 /* --- Runtime support code --- */
28741 /* Refnanny */
28742 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)28743 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
28744     PyObject *m = NULL, *p = NULL;
28745     void *r = NULL;
28746     m = PyImport_ImportModule(modname);
28747     if (!m) goto end;
28748     p = PyObject_GetAttrString(m, "RefNannyAPI");
28749     if (!p) goto end;
28750     r = PyLong_AsVoidPtr(p);
28751 end:
28752     Py_XDECREF(p);
28753     Py_XDECREF(m);
28754     return (__Pyx_RefNannyAPIStruct *)r;
28755 }
28756 #endif
28757 
28758 /* PyObjectGetAttrStr */
28759 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)28760 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28761     PyTypeObject* tp = Py_TYPE(obj);
28762     if (likely(tp->tp_getattro))
28763         return tp->tp_getattro(obj, attr_name);
28764 #if PY_MAJOR_VERSION < 3
28765     if (likely(tp->tp_getattr))
28766         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28767 #endif
28768     return PyObject_GetAttr(obj, attr_name);
28769 }
28770 #endif
28771 
28772 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)28773 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28774     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
28775     if (unlikely(!result)) {
28776         PyErr_Format(PyExc_NameError,
28777 #if PY_MAJOR_VERSION >= 3
28778             "name '%U' is not defined", name);
28779 #else
28780             "name '%.200s' is not defined", PyString_AS_STRING(name));
28781 #endif
28782     }
28783     return result;
28784 }
28785 
28786 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)28787 static void __Pyx_RaiseArgtupleInvalid(
28788     const char* func_name,
28789     int exact,
28790     Py_ssize_t num_min,
28791     Py_ssize_t num_max,
28792     Py_ssize_t num_found)
28793 {
28794     Py_ssize_t num_expected;
28795     const char *more_or_less;
28796     if (num_found < num_min) {
28797         num_expected = num_min;
28798         more_or_less = "at least";
28799     } else {
28800         num_expected = num_max;
28801         more_or_less = "at most";
28802     }
28803     if (exact) {
28804         more_or_less = "exactly";
28805     }
28806     PyErr_Format(PyExc_TypeError,
28807                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
28808                  func_name, more_or_less, num_expected,
28809                  (num_expected == 1) ? "" : "s", num_found);
28810 }
28811 
28812 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)28813 static void __Pyx_RaiseDoubleKeywordsError(
28814     const char* func_name,
28815     PyObject* kw_name)
28816 {
28817     PyErr_Format(PyExc_TypeError,
28818         #if PY_MAJOR_VERSION >= 3
28819         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28820         #else
28821         "%s() got multiple values for keyword argument '%s'", func_name,
28822         PyString_AsString(kw_name));
28823         #endif
28824 }
28825 
28826 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)28827 static int __Pyx_ParseOptionalKeywords(
28828     PyObject *kwds,
28829     PyObject **argnames[],
28830     PyObject *kwds2,
28831     PyObject *values[],
28832     Py_ssize_t num_pos_args,
28833     const char* function_name)
28834 {
28835     PyObject *key = 0, *value = 0;
28836     Py_ssize_t pos = 0;
28837     PyObject*** name;
28838     PyObject*** first_kw_arg = argnames + num_pos_args;
28839     while (PyDict_Next(kwds, &pos, &key, &value)) {
28840         name = first_kw_arg;
28841         while (*name && (**name != key)) name++;
28842         if (*name) {
28843             values[name-argnames] = value;
28844             continue;
28845         }
28846         name = first_kw_arg;
28847         #if PY_MAJOR_VERSION < 3
28848         if (likely(PyString_Check(key))) {
28849             while (*name) {
28850                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
28851                         && _PyString_Eq(**name, key)) {
28852                     values[name-argnames] = value;
28853                     break;
28854                 }
28855                 name++;
28856             }
28857             if (*name) continue;
28858             else {
28859                 PyObject*** argname = argnames;
28860                 while (argname != first_kw_arg) {
28861                     if ((**argname == key) || (
28862                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
28863                              && _PyString_Eq(**argname, key))) {
28864                         goto arg_passed_twice;
28865                     }
28866                     argname++;
28867                 }
28868             }
28869         } else
28870         #endif
28871         if (likely(PyUnicode_Check(key))) {
28872             while (*name) {
28873                 int cmp = (**name == key) ? 0 :
28874                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28875                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28876                 #endif
28877                     PyUnicode_Compare(**name, key);
28878                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28879                 if (cmp == 0) {
28880                     values[name-argnames] = value;
28881                     break;
28882                 }
28883                 name++;
28884             }
28885             if (*name) continue;
28886             else {
28887                 PyObject*** argname = argnames;
28888                 while (argname != first_kw_arg) {
28889                     int cmp = (**argname == key) ? 0 :
28890                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28891                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28892                     #endif
28893                         PyUnicode_Compare(**argname, key);
28894                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28895                     if (cmp == 0) goto arg_passed_twice;
28896                     argname++;
28897                 }
28898             }
28899         } else
28900             goto invalid_keyword_type;
28901         if (kwds2) {
28902             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
28903         } else {
28904             goto invalid_keyword;
28905         }
28906     }
28907     return 0;
28908 arg_passed_twice:
28909     __Pyx_RaiseDoubleKeywordsError(function_name, key);
28910     goto bad;
28911 invalid_keyword_type:
28912     PyErr_Format(PyExc_TypeError,
28913         "%.200s() keywords must be strings", function_name);
28914     goto bad;
28915 invalid_keyword:
28916     PyErr_Format(PyExc_TypeError,
28917     #if PY_MAJOR_VERSION < 3
28918         "%.200s() got an unexpected keyword argument '%.200s'",
28919         function_name, PyString_AsString(key));
28920     #else
28921         "%s() got an unexpected keyword argument '%U'",
28922         function_name, key);
28923     #endif
28924 bad:
28925     return -1;
28926 }
28927 
28928 /* DictGetItem */
28929 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)28930 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
28931     PyObject *value;
28932     value = PyDict_GetItemWithError(d, key);
28933     if (unlikely(!value)) {
28934         if (!PyErr_Occurred()) {
28935             if (unlikely(PyTuple_Check(key))) {
28936                 PyObject* args = PyTuple_Pack(1, key);
28937                 if (likely(args)) {
28938                     PyErr_SetObject(PyExc_KeyError, args);
28939                     Py_DECREF(args);
28940                 }
28941             } else {
28942                 PyErr_SetObject(PyExc_KeyError, key);
28943             }
28944         }
28945         return NULL;
28946     }
28947     Py_INCREF(value);
28948     return value;
28949 }
28950 #endif
28951 
28952 /* PyCFunctionFastCall */
28953 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)28954 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
28955     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
28956     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
28957     PyObject *self = PyCFunction_GET_SELF(func);
28958     int flags = PyCFunction_GET_FLAGS(func);
28959     assert(PyCFunction_Check(func));
28960     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
28961     assert(nargs >= 0);
28962     assert(nargs == 0 || args != NULL);
28963     /* _PyCFunction_FastCallDict() must not be called with an exception set,
28964        because it may clear it (directly or indirectly) and so the
28965        caller loses its exception */
28966     assert(!PyErr_Occurred());
28967     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
28968         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
28969     } else {
28970         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
28971     }
28972 }
28973 #endif
28974 
28975 /* PyFunctionFastCall */
28976 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)28977 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
28978                                                PyObject *globals) {
28979     PyFrameObject *f;
28980     PyThreadState *tstate = __Pyx_PyThreadState_Current;
28981     PyObject **fastlocals;
28982     Py_ssize_t i;
28983     PyObject *result;
28984     assert(globals != NULL);
28985     /* XXX Perhaps we should create a specialized
28986        PyFrame_New() that doesn't take locals, but does
28987        take builtins without sanity checking them.
28988        */
28989     assert(tstate != NULL);
28990     f = PyFrame_New(tstate, co, globals, NULL);
28991     if (f == NULL) {
28992         return NULL;
28993     }
28994     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
28995     for (i = 0; i < na; i++) {
28996         Py_INCREF(*args);
28997         fastlocals[i] = *args++;
28998     }
28999     result = PyEval_EvalFrameEx(f,0);
29000     ++tstate->recursion_depth;
29001     Py_DECREF(f);
29002     --tstate->recursion_depth;
29003     return result;
29004 }
29005 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)29006 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
29007     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
29008     PyObject *globals = PyFunction_GET_GLOBALS(func);
29009     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
29010     PyObject *closure;
29011 #if PY_MAJOR_VERSION >= 3
29012     PyObject *kwdefs;
29013 #endif
29014     PyObject *kwtuple, **k;
29015     PyObject **d;
29016     Py_ssize_t nd;
29017     Py_ssize_t nk;
29018     PyObject *result;
29019     assert(kwargs == NULL || PyDict_Check(kwargs));
29020     nk = kwargs ? PyDict_Size(kwargs) : 0;
29021     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
29022         return NULL;
29023     }
29024     if (
29025 #if PY_MAJOR_VERSION >= 3
29026             co->co_kwonlyargcount == 0 &&
29027 #endif
29028             likely(kwargs == NULL || nk == 0) &&
29029             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
29030         if (argdefs == NULL && co->co_argcount == nargs) {
29031             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
29032             goto done;
29033         }
29034         else if (nargs == 0 && argdefs != NULL
29035                  && co->co_argcount == Py_SIZE(argdefs)) {
29036             /* function called with no arguments, but all parameters have
29037                a default value: use default values as arguments .*/
29038             args = &PyTuple_GET_ITEM(argdefs, 0);
29039             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
29040             goto done;
29041         }
29042     }
29043     if (kwargs != NULL) {
29044         Py_ssize_t pos, i;
29045         kwtuple = PyTuple_New(2 * nk);
29046         if (kwtuple == NULL) {
29047             result = NULL;
29048             goto done;
29049         }
29050         k = &PyTuple_GET_ITEM(kwtuple, 0);
29051         pos = i = 0;
29052         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
29053             Py_INCREF(k[i]);
29054             Py_INCREF(k[i+1]);
29055             i += 2;
29056         }
29057         nk = i / 2;
29058     }
29059     else {
29060         kwtuple = NULL;
29061         k = NULL;
29062     }
29063     closure = PyFunction_GET_CLOSURE(func);
29064 #if PY_MAJOR_VERSION >= 3
29065     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
29066 #endif
29067     if (argdefs != NULL) {
29068         d = &PyTuple_GET_ITEM(argdefs, 0);
29069         nd = Py_SIZE(argdefs);
29070     }
29071     else {
29072         d = NULL;
29073         nd = 0;
29074     }
29075 #if PY_MAJOR_VERSION >= 3
29076     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
29077                                args, (int)nargs,
29078                                k, (int)nk,
29079                                d, (int)nd, kwdefs, closure);
29080 #else
29081     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
29082                                args, (int)nargs,
29083                                k, (int)nk,
29084                                d, (int)nd, closure);
29085 #endif
29086     Py_XDECREF(kwtuple);
29087 done:
29088     Py_LeaveRecursiveCall();
29089     return result;
29090 }
29091 #endif
29092 #endif
29093 
29094 /* PyObjectCall */
29095 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)29096 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29097     PyObject *result;
29098     ternaryfunc call = func->ob_type->tp_call;
29099     if (unlikely(!call))
29100         return PyObject_Call(func, arg, kw);
29101     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
29102         return NULL;
29103     result = (*call)(func, arg, kw);
29104     Py_LeaveRecursiveCall();
29105     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29106         PyErr_SetString(
29107             PyExc_SystemError,
29108             "NULL result without error in PyObject_Call");
29109     }
29110     return result;
29111 }
29112 #endif
29113 
29114 /* PyObjectCallMethO */
29115 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)29116 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
29117     PyObject *self, *result;
29118     PyCFunction cfunc;
29119     cfunc = PyCFunction_GET_FUNCTION(func);
29120     self = PyCFunction_GET_SELF(func);
29121     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
29122         return NULL;
29123     result = cfunc(self, arg);
29124     Py_LeaveRecursiveCall();
29125     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29126         PyErr_SetString(
29127             PyExc_SystemError,
29128             "NULL result without error in PyObject_Call");
29129     }
29130     return result;
29131 }
29132 #endif
29133 
29134 /* PyObjectCallOneArg */
29135 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)29136 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29137     PyObject *result;
29138     PyObject *args = PyTuple_New(1);
29139     if (unlikely(!args)) return NULL;
29140     Py_INCREF(arg);
29141     PyTuple_SET_ITEM(args, 0, arg);
29142     result = __Pyx_PyObject_Call(func, args, NULL);
29143     Py_DECREF(args);
29144     return result;
29145 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)29146 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29147 #if CYTHON_FAST_PYCALL
29148     if (PyFunction_Check(func)) {
29149         return __Pyx_PyFunction_FastCall(func, &arg, 1);
29150     }
29151 #endif
29152     if (likely(PyCFunction_Check(func))) {
29153         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
29154             return __Pyx_PyObject_CallMethO(func, arg);
29155 #if CYTHON_FAST_PYCCALL
29156         } else if (__Pyx_PyFastCFunction_Check(func)) {
29157             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
29158 #endif
29159         }
29160     }
29161     return __Pyx__PyObject_CallOneArg(func, arg);
29162 }
29163 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)29164 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29165     PyObject *result;
29166     PyObject *args = PyTuple_Pack(1, arg);
29167     if (unlikely(!args)) return NULL;
29168     result = __Pyx_PyObject_Call(func, args, NULL);
29169     Py_DECREF(args);
29170     return result;
29171 }
29172 #endif
29173 
29174 /* PyErrFetchRestore */
29175 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)29176 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29177     PyObject *tmp_type, *tmp_value, *tmp_tb;
29178     tmp_type = tstate->curexc_type;
29179     tmp_value = tstate->curexc_value;
29180     tmp_tb = tstate->curexc_traceback;
29181     tstate->curexc_type = type;
29182     tstate->curexc_value = value;
29183     tstate->curexc_traceback = tb;
29184     Py_XDECREF(tmp_type);
29185     Py_XDECREF(tmp_value);
29186     Py_XDECREF(tmp_tb);
29187 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)29188 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29189     *type = tstate->curexc_type;
29190     *value = tstate->curexc_value;
29191     *tb = tstate->curexc_traceback;
29192     tstate->curexc_type = 0;
29193     tstate->curexc_value = 0;
29194     tstate->curexc_traceback = 0;
29195 }
29196 #endif
29197 
29198 /* RaiseException */
29199 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)29200 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
29201                         CYTHON_UNUSED PyObject *cause) {
29202     __Pyx_PyThreadState_declare
29203     Py_XINCREF(type);
29204     if (!value || value == Py_None)
29205         value = NULL;
29206     else
29207         Py_INCREF(value);
29208     if (!tb || tb == Py_None)
29209         tb = NULL;
29210     else {
29211         Py_INCREF(tb);
29212         if (!PyTraceBack_Check(tb)) {
29213             PyErr_SetString(PyExc_TypeError,
29214                 "raise: arg 3 must be a traceback or None");
29215             goto raise_error;
29216         }
29217     }
29218     if (PyType_Check(type)) {
29219 #if CYTHON_COMPILING_IN_PYPY
29220         if (!value) {
29221             Py_INCREF(Py_None);
29222             value = Py_None;
29223         }
29224 #endif
29225         PyErr_NormalizeException(&type, &value, &tb);
29226     } else {
29227         if (value) {
29228             PyErr_SetString(PyExc_TypeError,
29229                 "instance exception may not have a separate value");
29230             goto raise_error;
29231         }
29232         value = type;
29233         type = (PyObject*) Py_TYPE(type);
29234         Py_INCREF(type);
29235         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
29236             PyErr_SetString(PyExc_TypeError,
29237                 "raise: exception class must be a subclass of BaseException");
29238             goto raise_error;
29239         }
29240     }
29241     __Pyx_PyThreadState_assign
29242     __Pyx_ErrRestore(type, value, tb);
29243     return;
29244 raise_error:
29245     Py_XDECREF(value);
29246     Py_XDECREF(type);
29247     Py_XDECREF(tb);
29248     return;
29249 }
29250 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)29251 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
29252     PyObject* owned_instance = NULL;
29253     if (tb == Py_None) {
29254         tb = 0;
29255     } else if (tb && !PyTraceBack_Check(tb)) {
29256         PyErr_SetString(PyExc_TypeError,
29257             "raise: arg 3 must be a traceback or None");
29258         goto bad;
29259     }
29260     if (value == Py_None)
29261         value = 0;
29262     if (PyExceptionInstance_Check(type)) {
29263         if (value) {
29264             PyErr_SetString(PyExc_TypeError,
29265                 "instance exception may not have a separate value");
29266             goto bad;
29267         }
29268         value = type;
29269         type = (PyObject*) Py_TYPE(value);
29270     } else if (PyExceptionClass_Check(type)) {
29271         PyObject *instance_class = NULL;
29272         if (value && PyExceptionInstance_Check(value)) {
29273             instance_class = (PyObject*) Py_TYPE(value);
29274             if (instance_class != type) {
29275                 int is_subclass = PyObject_IsSubclass(instance_class, type);
29276                 if (!is_subclass) {
29277                     instance_class = NULL;
29278                 } else if (unlikely(is_subclass == -1)) {
29279                     goto bad;
29280                 } else {
29281                     type = instance_class;
29282                 }
29283             }
29284         }
29285         if (!instance_class) {
29286             PyObject *args;
29287             if (!value)
29288                 args = PyTuple_New(0);
29289             else if (PyTuple_Check(value)) {
29290                 Py_INCREF(value);
29291                 args = value;
29292             } else
29293                 args = PyTuple_Pack(1, value);
29294             if (!args)
29295                 goto bad;
29296             owned_instance = PyObject_Call(type, args, NULL);
29297             Py_DECREF(args);
29298             if (!owned_instance)
29299                 goto bad;
29300             value = owned_instance;
29301             if (!PyExceptionInstance_Check(value)) {
29302                 PyErr_Format(PyExc_TypeError,
29303                              "calling %R should have returned an instance of "
29304                              "BaseException, not %R",
29305                              type, Py_TYPE(value));
29306                 goto bad;
29307             }
29308         }
29309     } else {
29310         PyErr_SetString(PyExc_TypeError,
29311             "raise: exception class must be a subclass of BaseException");
29312         goto bad;
29313     }
29314     if (cause) {
29315         PyObject *fixed_cause;
29316         if (cause == Py_None) {
29317             fixed_cause = NULL;
29318         } else if (PyExceptionClass_Check(cause)) {
29319             fixed_cause = PyObject_CallObject(cause, NULL);
29320             if (fixed_cause == NULL)
29321                 goto bad;
29322         } else if (PyExceptionInstance_Check(cause)) {
29323             fixed_cause = cause;
29324             Py_INCREF(fixed_cause);
29325         } else {
29326             PyErr_SetString(PyExc_TypeError,
29327                             "exception causes must derive from "
29328                             "BaseException");
29329             goto bad;
29330         }
29331         PyException_SetCause(value, fixed_cause);
29332     }
29333     PyErr_SetObject(type, value);
29334     if (tb) {
29335 #if CYTHON_COMPILING_IN_PYPY
29336         PyObject *tmp_type, *tmp_value, *tmp_tb;
29337         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
29338         Py_INCREF(tb);
29339         PyErr_Restore(tmp_type, tmp_value, tb);
29340         Py_XDECREF(tmp_tb);
29341 #else
29342         PyThreadState *tstate = __Pyx_PyThreadState_Current;
29343         PyObject* tmp_tb = tstate->curexc_traceback;
29344         if (tb != tmp_tb) {
29345             Py_INCREF(tb);
29346             tstate->curexc_traceback = tb;
29347             Py_XDECREF(tmp_tb);
29348         }
29349 #endif
29350     }
29351 bad:
29352     Py_XDECREF(owned_instance);
29353     return;
29354 }
29355 #endif
29356 
29357 /* UnicodeAsUCS4 */
__Pyx_PyUnicode_AsPy_UCS4(PyObject * x)29358 static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
29359    Py_ssize_t length;
29360    #if CYTHON_PEP393_ENABLED
29361    length = PyUnicode_GET_LENGTH(x);
29362    if (likely(length == 1)) {
29363        return PyUnicode_READ_CHAR(x, 0);
29364    }
29365    #else
29366    length = PyUnicode_GET_SIZE(x);
29367    if (likely(length == 1)) {
29368        return PyUnicode_AS_UNICODE(x)[0];
29369    }
29370    #if Py_UNICODE_SIZE == 2
29371    else if (PyUnicode_GET_SIZE(x) == 2) {
29372        Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
29373        if (high_val >= 0xD800 && high_val <= 0xDBFF) {
29374            Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
29375            if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
29376                return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
29377            }
29378        }
29379    }
29380    #endif
29381    #endif
29382    PyErr_Format(PyExc_ValueError,
29383                 "only single character unicode strings can be converted to Py_UCS4, "
29384                 "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
29385    return (Py_UCS4)-1;
29386 }
29387 
29388 /* object_ord */
__Pyx__PyObject_Ord(PyObject * c)29389 static long __Pyx__PyObject_Ord(PyObject* c) {
29390     Py_ssize_t size;
29391     if (PyBytes_Check(c)) {
29392         size = PyBytes_GET_SIZE(c);
29393         if (likely(size == 1)) {
29394             return (unsigned char) PyBytes_AS_STRING(c)[0];
29395         }
29396 #if PY_MAJOR_VERSION < 3
29397     } else if (PyUnicode_Check(c)) {
29398         return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
29399 #endif
29400 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29401     } else if (PyByteArray_Check(c)) {
29402         size = PyByteArray_GET_SIZE(c);
29403         if (likely(size == 1)) {
29404             return (unsigned char) PyByteArray_AS_STRING(c)[0];
29405         }
29406 #endif
29407     } else {
29408         PyErr_Format(PyExc_TypeError,
29409             "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name);
29410         return (long)(Py_UCS4)-1;
29411     }
29412     PyErr_Format(PyExc_TypeError,
29413         "ord() expected a character, but string of length %zd found", size);
29414     return (long)(Py_UCS4)-1;
29415 }
29416 
29417 /* SetItemInt */
__Pyx_SetItemInt_Generic(PyObject * o,PyObject * j,PyObject * v)29418 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
29419     int r;
29420     if (!j) return -1;
29421     r = PyObject_SetItem(o, j, v);
29422     Py_DECREF(j);
29423     return r;
29424 }
__Pyx_SetItemInt_Fast(PyObject * o,Py_ssize_t i,PyObject * v,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)29425 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
29426                                                CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
29427 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29428     if (is_list || PyList_CheckExact(o)) {
29429         Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
29430         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
29431             PyObject* old = PyList_GET_ITEM(o, n);
29432             Py_INCREF(v);
29433             PyList_SET_ITEM(o, n, v);
29434             Py_DECREF(old);
29435             return 1;
29436         }
29437     } else {
29438         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
29439         if (likely(m && m->sq_ass_item)) {
29440             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
29441                 Py_ssize_t l = m->sq_length(o);
29442                 if (likely(l >= 0)) {
29443                     i += l;
29444                 } else {
29445                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29446                         return -1;
29447                     PyErr_Clear();
29448                 }
29449             }
29450             return m->sq_ass_item(o, i, v);
29451         }
29452     }
29453 #else
29454 #if CYTHON_COMPILING_IN_PYPY
29455     if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
29456 #else
29457     if (is_list || PySequence_Check(o))
29458 #endif
29459     {
29460         return PySequence_SetItem(o, i, v);
29461     }
29462 #endif
29463     return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
29464 }
29465 
29466 /* IterFinish */
__Pyx_IterFinish(void)29467 static CYTHON_INLINE int __Pyx_IterFinish(void) {
29468 #if CYTHON_FAST_THREAD_STATE
29469     PyThreadState *tstate = __Pyx_PyThreadState_Current;
29470     PyObject* exc_type = tstate->curexc_type;
29471     if (unlikely(exc_type)) {
29472         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
29473             PyObject *exc_value, *exc_tb;
29474             exc_value = tstate->curexc_value;
29475             exc_tb = tstate->curexc_traceback;
29476             tstate->curexc_type = 0;
29477             tstate->curexc_value = 0;
29478             tstate->curexc_traceback = 0;
29479             Py_DECREF(exc_type);
29480             Py_XDECREF(exc_value);
29481             Py_XDECREF(exc_tb);
29482             return 0;
29483         } else {
29484             return -1;
29485         }
29486     }
29487     return 0;
29488 #else
29489     if (unlikely(PyErr_Occurred())) {
29490         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
29491             PyErr_Clear();
29492             return 0;
29493         } else {
29494             return -1;
29495         }
29496     }
29497     return 0;
29498 #endif
29499 }
29500 
29501 /* PyObjectCallNoArg */
29502 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)29503 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
29504 #if CYTHON_FAST_PYCALL
29505     if (PyFunction_Check(func)) {
29506         return __Pyx_PyFunction_FastCall(func, NULL, 0);
29507     }
29508 #endif
29509 #ifdef __Pyx_CyFunction_USED
29510     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
29511 #else
29512     if (likely(PyCFunction_Check(func)))
29513 #endif
29514     {
29515         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
29516             return __Pyx_PyObject_CallMethO(func, NULL);
29517         }
29518     }
29519     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
29520 }
29521 #endif
29522 
29523 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)29524 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
29525     PyObject *attr;
29526 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
29527     PyTypeObject *tp = Py_TYPE(obj);
29528     PyObject *descr;
29529     descrgetfunc f = NULL;
29530     PyObject **dictptr, *dict;
29531     int meth_found = 0;
29532     assert (*method == NULL);
29533     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
29534         attr = __Pyx_PyObject_GetAttrStr(obj, name);
29535         goto try_unpack;
29536     }
29537     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
29538         return 0;
29539     }
29540     descr = _PyType_Lookup(tp, name);
29541     if (likely(descr != NULL)) {
29542         Py_INCREF(descr);
29543 #if PY_MAJOR_VERSION >= 3
29544         #ifdef __Pyx_CyFunction_USED
29545         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
29546         #else
29547         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
29548         #endif
29549 #else
29550         #ifdef __Pyx_CyFunction_USED
29551         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
29552         #else
29553         if (likely(PyFunction_Check(descr)))
29554         #endif
29555 #endif
29556         {
29557             meth_found = 1;
29558         } else {
29559             f = Py_TYPE(descr)->tp_descr_get;
29560             if (f != NULL && PyDescr_IsData(descr)) {
29561                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
29562                 Py_DECREF(descr);
29563                 goto try_unpack;
29564             }
29565         }
29566     }
29567     dictptr = _PyObject_GetDictPtr(obj);
29568     if (dictptr != NULL && (dict = *dictptr) != NULL) {
29569         Py_INCREF(dict);
29570         attr = __Pyx_PyDict_GetItemStr(dict, name);
29571         if (attr != NULL) {
29572             Py_INCREF(attr);
29573             Py_DECREF(dict);
29574             Py_XDECREF(descr);
29575             goto try_unpack;
29576         }
29577         Py_DECREF(dict);
29578     }
29579     if (meth_found) {
29580         *method = descr;
29581         return 1;
29582     }
29583     if (f != NULL) {
29584         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
29585         Py_DECREF(descr);
29586         goto try_unpack;
29587     }
29588     if (descr != NULL) {
29589         *method = descr;
29590         return 0;
29591     }
29592     PyErr_Format(PyExc_AttributeError,
29593 #if PY_MAJOR_VERSION >= 3
29594                  "'%.50s' object has no attribute '%U'",
29595                  tp->tp_name, name);
29596 #else
29597                  "'%.50s' object has no attribute '%.400s'",
29598                  tp->tp_name, PyString_AS_STRING(name));
29599 #endif
29600     return 0;
29601 #else
29602     attr = __Pyx_PyObject_GetAttrStr(obj, name);
29603     goto try_unpack;
29604 #endif
29605 try_unpack:
29606 #if CYTHON_UNPACK_METHODS
29607     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
29608         PyObject *function = PyMethod_GET_FUNCTION(attr);
29609         Py_INCREF(function);
29610         Py_DECREF(attr);
29611         *method = function;
29612         return 1;
29613     }
29614 #endif
29615     *method = attr;
29616     return 0;
29617 }
29618 
29619 /* PyObjectCallMethod0 */
__Pyx_PyObject_CallMethod0(PyObject * obj,PyObject * method_name)29620 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
29621     PyObject *method = NULL, *result = NULL;
29622     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
29623     if (likely(is_method)) {
29624         result = __Pyx_PyObject_CallOneArg(method, obj);
29625         Py_DECREF(method);
29626         return result;
29627     }
29628     if (unlikely(!method)) goto bad;
29629     result = __Pyx_PyObject_CallNoArg(method);
29630     Py_DECREF(method);
29631 bad:
29632     return result;
29633 }
29634 
29635 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)29636 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
29637     PyErr_Format(PyExc_ValueError,
29638                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
29639                  index, (index == 1) ? "" : "s");
29640 }
29641 
29642 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)29643 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
29644     PyErr_Format(PyExc_ValueError,
29645                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
29646 }
29647 
29648 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)29649 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
29650     if (unlikely(retval)) {
29651         Py_DECREF(retval);
29652         __Pyx_RaiseTooManyValuesError(expected);
29653         return -1;
29654     } else {
29655         return __Pyx_IterFinish();
29656     }
29657     return 0;
29658 }
29659 
29660 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)29661 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
29662     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
29663 }
29664 
29665 /* UnpackTupleError */
__Pyx_UnpackTupleError(PyObject * t,Py_ssize_t index)29666 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
29667     if (t == Py_None) {
29668       __Pyx_RaiseNoneNotIterableError();
29669     } else if (PyTuple_GET_SIZE(t) < index) {
29670       __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
29671     } else {
29672       __Pyx_RaiseTooManyValuesError(index);
29673     }
29674 }
29675 
29676 /* UnpackTuple2 */
__Pyx_unpack_tuple2_exact(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int decref_tuple)29677 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
29678         PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
29679     PyObject *value1 = NULL, *value2 = NULL;
29680 #if CYTHON_COMPILING_IN_PYPY
29681     value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
29682     value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
29683 #else
29684     value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
29685     value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
29686 #endif
29687     if (decref_tuple) {
29688         Py_DECREF(tuple);
29689     }
29690     *pvalue1 = value1;
29691     *pvalue2 = value2;
29692     return 0;
29693 #if CYTHON_COMPILING_IN_PYPY
29694 bad:
29695     Py_XDECREF(value1);
29696     Py_XDECREF(value2);
29697     if (decref_tuple) { Py_XDECREF(tuple); }
29698     return -1;
29699 #endif
29700 }
__Pyx_unpack_tuple2_generic(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int has_known_size,int decref_tuple)29701 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
29702                                        int has_known_size, int decref_tuple) {
29703     Py_ssize_t index;
29704     PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
29705     iternextfunc iternext;
29706     iter = PyObject_GetIter(tuple);
29707     if (unlikely(!iter)) goto bad;
29708     if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
29709     iternext = Py_TYPE(iter)->tp_iternext;
29710     value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
29711     value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
29712     if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
29713     Py_DECREF(iter);
29714     *pvalue1 = value1;
29715     *pvalue2 = value2;
29716     return 0;
29717 unpacking_failed:
29718     if (!has_known_size && __Pyx_IterFinish() == 0)
29719         __Pyx_RaiseNeedMoreValuesError(index);
29720 bad:
29721     Py_XDECREF(iter);
29722     Py_XDECREF(value1);
29723     Py_XDECREF(value2);
29724     if (decref_tuple) { Py_XDECREF(tuple); }
29725     return -1;
29726 }
29727 
29728 /* dict_iter */
__Pyx_dict_iterator(PyObject * iterable,int is_dict,PyObject * method_name,Py_ssize_t * p_orig_length,int * p_source_is_dict)29729 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
29730                                                    Py_ssize_t* p_orig_length, int* p_source_is_dict) {
29731     is_dict = is_dict || likely(PyDict_CheckExact(iterable));
29732     *p_source_is_dict = is_dict;
29733     if (is_dict) {
29734 #if !CYTHON_COMPILING_IN_PYPY
29735         *p_orig_length = PyDict_Size(iterable);
29736         Py_INCREF(iterable);
29737         return iterable;
29738 #elif PY_MAJOR_VERSION >= 3
29739         static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
29740         PyObject **pp = NULL;
29741         if (method_name) {
29742             const char *name = PyUnicode_AsUTF8(method_name);
29743             if (strcmp(name, "iteritems") == 0) pp = &py_items;
29744             else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
29745             else if (strcmp(name, "itervalues") == 0) pp = &py_values;
29746             if (pp) {
29747                 if (!*pp) {
29748                     *pp = PyUnicode_FromString(name + 4);
29749                     if (!*pp)
29750                         return NULL;
29751                 }
29752                 method_name = *pp;
29753             }
29754         }
29755 #endif
29756     }
29757     *p_orig_length = 0;
29758     if (method_name) {
29759         PyObject* iter;
29760         iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
29761         if (!iterable)
29762             return NULL;
29763 #if !CYTHON_COMPILING_IN_PYPY
29764         if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
29765             return iterable;
29766 #endif
29767         iter = PyObject_GetIter(iterable);
29768         Py_DECREF(iterable);
29769         return iter;
29770     }
29771     return PyObject_GetIter(iterable);
29772 }
__Pyx_dict_iter_next(PyObject * iter_obj,CYTHON_NCP_UNUSED Py_ssize_t orig_length,CYTHON_NCP_UNUSED Py_ssize_t * ppos,PyObject ** pkey,PyObject ** pvalue,PyObject ** pitem,int source_is_dict)29773 static CYTHON_INLINE int __Pyx_dict_iter_next(
29774         PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
29775         PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
29776     PyObject* next_item;
29777 #if !CYTHON_COMPILING_IN_PYPY
29778     if (source_is_dict) {
29779         PyObject *key, *value;
29780         if (unlikely(orig_length != PyDict_Size(iter_obj))) {
29781             PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
29782             return -1;
29783         }
29784         if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
29785             return 0;
29786         }
29787         if (pitem) {
29788             PyObject* tuple = PyTuple_New(2);
29789             if (unlikely(!tuple)) {
29790                 return -1;
29791             }
29792             Py_INCREF(key);
29793             Py_INCREF(value);
29794             PyTuple_SET_ITEM(tuple, 0, key);
29795             PyTuple_SET_ITEM(tuple, 1, value);
29796             *pitem = tuple;
29797         } else {
29798             if (pkey) {
29799                 Py_INCREF(key);
29800                 *pkey = key;
29801             }
29802             if (pvalue) {
29803                 Py_INCREF(value);
29804                 *pvalue = value;
29805             }
29806         }
29807         return 1;
29808     } else if (PyTuple_CheckExact(iter_obj)) {
29809         Py_ssize_t pos = *ppos;
29810         if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
29811         *ppos = pos + 1;
29812         next_item = PyTuple_GET_ITEM(iter_obj, pos);
29813         Py_INCREF(next_item);
29814     } else if (PyList_CheckExact(iter_obj)) {
29815         Py_ssize_t pos = *ppos;
29816         if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
29817         *ppos = pos + 1;
29818         next_item = PyList_GET_ITEM(iter_obj, pos);
29819         Py_INCREF(next_item);
29820     } else
29821 #endif
29822     {
29823         next_item = PyIter_Next(iter_obj);
29824         if (unlikely(!next_item)) {
29825             return __Pyx_IterFinish();
29826         }
29827     }
29828     if (pitem) {
29829         *pitem = next_item;
29830     } else if (pkey && pvalue) {
29831         if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
29832             return -1;
29833     } else if (pkey) {
29834         *pkey = next_item;
29835     } else {
29836         *pvalue = next_item;
29837     }
29838     return 1;
29839 }
29840 
29841 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)29842 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
29843     PyObject *args, *result = NULL;
29844     #if CYTHON_FAST_PYCALL
29845     if (PyFunction_Check(function)) {
29846         PyObject *args[2] = {arg1, arg2};
29847         return __Pyx_PyFunction_FastCall(function, args, 2);
29848     }
29849     #endif
29850     #if CYTHON_FAST_PYCCALL
29851     if (__Pyx_PyFastCFunction_Check(function)) {
29852         PyObject *args[2] = {arg1, arg2};
29853         return __Pyx_PyCFunction_FastCall(function, args, 2);
29854     }
29855     #endif
29856     args = PyTuple_New(2);
29857     if (unlikely(!args)) goto done;
29858     Py_INCREF(arg1);
29859     PyTuple_SET_ITEM(args, 0, arg1);
29860     Py_INCREF(arg2);
29861     PyTuple_SET_ITEM(args, 1, arg2);
29862     Py_INCREF(function);
29863     result = __Pyx_PyObject_Call(function, args, NULL);
29864     Py_DECREF(args);
29865     Py_DECREF(function);
29866 done:
29867     return result;
29868 }
29869 
29870 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)29871 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29872     PyObject *r;
29873     if (!j) return NULL;
29874     r = PyObject_GetItem(o, j);
29875     Py_DECREF(j);
29876     return r;
29877 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)29878 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29879                                                               CYTHON_NCP_UNUSED int wraparound,
29880                                                               CYTHON_NCP_UNUSED int boundscheck) {
29881 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29882     Py_ssize_t wrapped_i = i;
29883     if (wraparound & unlikely(i < 0)) {
29884         wrapped_i += PyList_GET_SIZE(o);
29885     }
29886     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29887         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29888         Py_INCREF(r);
29889         return r;
29890     }
29891     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29892 #else
29893     return PySequence_GetItem(o, i);
29894 #endif
29895 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)29896 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29897                                                               CYTHON_NCP_UNUSED int wraparound,
29898                                                               CYTHON_NCP_UNUSED int boundscheck) {
29899 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29900     Py_ssize_t wrapped_i = i;
29901     if (wraparound & unlikely(i < 0)) {
29902         wrapped_i += PyTuple_GET_SIZE(o);
29903     }
29904     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29905         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29906         Py_INCREF(r);
29907         return r;
29908     }
29909     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29910 #else
29911     return PySequence_GetItem(o, i);
29912 #endif
29913 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)29914 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
29915                                                      CYTHON_NCP_UNUSED int wraparound,
29916                                                      CYTHON_NCP_UNUSED int boundscheck) {
29917 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29918     if (is_list || PyList_CheckExact(o)) {
29919         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29920         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29921             PyObject *r = PyList_GET_ITEM(o, n);
29922             Py_INCREF(r);
29923             return r;
29924         }
29925     }
29926     else if (PyTuple_CheckExact(o)) {
29927         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29928         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29929             PyObject *r = PyTuple_GET_ITEM(o, n);
29930             Py_INCREF(r);
29931             return r;
29932         }
29933     } else {
29934         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
29935         if (likely(m && m->sq_item)) {
29936             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
29937                 Py_ssize_t l = m->sq_length(o);
29938                 if (likely(l >= 0)) {
29939                     i += l;
29940                 } else {
29941                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29942                         return NULL;
29943                     PyErr_Clear();
29944                 }
29945             }
29946             return m->sq_item(o, i);
29947         }
29948     }
29949 #else
29950     if (is_list || PySequence_Check(o)) {
29951         return PySequence_GetItem(o, i);
29952     }
29953 #endif
29954     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29955 }
29956 
29957 /* PyDictVersioning */
29958 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)29959 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
29960     PyObject *dict = Py_TYPE(obj)->tp_dict;
29961     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
29962 }
__Pyx_get_object_dict_version(PyObject * obj)29963 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
29964     PyObject **dictptr = NULL;
29965     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
29966     if (offset) {
29967 #if CYTHON_COMPILING_IN_CPYTHON
29968         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
29969 #else
29970         dictptr = _PyObject_GetDictPtr(obj);
29971 #endif
29972     }
29973     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
29974 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)29975 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
29976     PyObject *dict = Py_TYPE(obj)->tp_dict;
29977     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
29978         return 0;
29979     return obj_dict_version == __Pyx_get_object_dict_version(obj);
29980 }
29981 #endif
29982 
29983 /* GetModuleGlobalName */
29984 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)29985 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
29986 #else
29987 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
29988 #endif
29989 {
29990     PyObject *result;
29991 #if !CYTHON_AVOID_BORROWED_REFS
29992 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
29993     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
29994     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29995     if (likely(result)) {
29996         return __Pyx_NewRef(result);
29997     } else if (unlikely(PyErr_Occurred())) {
29998         return NULL;
29999     }
30000 #else
30001     result = PyDict_GetItem(__pyx_d, name);
30002     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
30003     if (likely(result)) {
30004         return __Pyx_NewRef(result);
30005     }
30006 #endif
30007 #else
30008     result = PyObject_GetItem(__pyx_d, name);
30009     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
30010     if (likely(result)) {
30011         return __Pyx_NewRef(result);
30012     }
30013     PyErr_Clear();
30014 #endif
30015     return __Pyx_GetBuiltinName(name);
30016 }
30017 
30018 /* MemviewSliceInit */
30019 static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)30020 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
30021                         int ndim,
30022                         __Pyx_memviewslice *memviewslice,
30023                         int memview_is_new_reference)
30024 {
30025     __Pyx_RefNannyDeclarations
30026     int i, retval=-1;
30027     Py_buffer *buf = &memview->view;
30028     __Pyx_RefNannySetupContext("init_memviewslice", 0);
30029     if (unlikely(memviewslice->memview || memviewslice->data)) {
30030         PyErr_SetString(PyExc_ValueError,
30031             "memviewslice is already initialized!");
30032         goto fail;
30033     }
30034     if (buf->strides) {
30035         for (i = 0; i < ndim; i++) {
30036             memviewslice->strides[i] = buf->strides[i];
30037         }
30038     } else {
30039         Py_ssize_t stride = buf->itemsize;
30040         for (i = ndim - 1; i >= 0; i--) {
30041             memviewslice->strides[i] = stride;
30042             stride *= buf->shape[i];
30043         }
30044     }
30045     for (i = 0; i < ndim; i++) {
30046         memviewslice->shape[i]   = buf->shape[i];
30047         if (buf->suboffsets) {
30048             memviewslice->suboffsets[i] = buf->suboffsets[i];
30049         } else {
30050             memviewslice->suboffsets[i] = -1;
30051         }
30052     }
30053     memviewslice->memview = memview;
30054     memviewslice->data = (char *)buf->buf;
30055     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
30056         Py_INCREF(memview);
30057     }
30058     retval = 0;
30059     goto no_fail;
30060 fail:
30061     memviewslice->memview = 0;
30062     memviewslice->data = 0;
30063     retval = -1;
30064 no_fail:
30065     __Pyx_RefNannyFinishContext();
30066     return retval;
30067 }
30068 #ifndef Py_NO_RETURN
30069 #define Py_NO_RETURN
30070 #endif
__pyx_fatalerror(const char * fmt,...)30071 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
30072     va_list vargs;
30073     char msg[200];
30074 #ifdef HAVE_STDARG_PROTOTYPES
30075     va_start(vargs, fmt);
30076 #else
30077     va_start(vargs);
30078 #endif
30079     vsnprintf(msg, 200, fmt, vargs);
30080     va_end(vargs);
30081     Py_FatalError(msg);
30082 }
30083 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)30084 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
30085                                    PyThread_type_lock lock)
30086 {
30087     int result;
30088     PyThread_acquire_lock(lock, 1);
30089     result = (*acquisition_count)++;
30090     PyThread_release_lock(lock);
30091     return result;
30092 }
30093 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)30094 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
30095                                    PyThread_type_lock lock)
30096 {
30097     int result;
30098     PyThread_acquire_lock(lock, 1);
30099     result = (*acquisition_count)--;
30100     PyThread_release_lock(lock);
30101     return result;
30102 }
30103 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)30104 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
30105 {
30106     int first_time;
30107     struct __pyx_memoryview_obj *memview = memslice->memview;
30108     if (unlikely(!memview || (PyObject *) memview == Py_None))
30109         return;
30110     if (unlikely(__pyx_get_slice_count(memview) < 0))
30111         __pyx_fatalerror("Acquisition count is %d (line %d)",
30112                          __pyx_get_slice_count(memview), lineno);
30113     first_time = __pyx_add_acquisition_count(memview) == 0;
30114     if (unlikely(first_time)) {
30115         if (have_gil) {
30116             Py_INCREF((PyObject *) memview);
30117         } else {
30118             PyGILState_STATE _gilstate = PyGILState_Ensure();
30119             Py_INCREF((PyObject *) memview);
30120             PyGILState_Release(_gilstate);
30121         }
30122     }
30123 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)30124 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
30125                                              int have_gil, int lineno) {
30126     int last_time;
30127     struct __pyx_memoryview_obj *memview = memslice->memview;
30128     if (unlikely(!memview || (PyObject *) memview == Py_None)) {
30129         memslice->memview = NULL;
30130         return;
30131     }
30132     if (unlikely(__pyx_get_slice_count(memview) <= 0))
30133         __pyx_fatalerror("Acquisition count is %d (line %d)",
30134                          __pyx_get_slice_count(memview), lineno);
30135     last_time = __pyx_sub_acquisition_count(memview) == 1;
30136     memslice->data = NULL;
30137     if (unlikely(last_time)) {
30138         if (have_gil) {
30139             Py_CLEAR(memslice->memview);
30140         } else {
30141             PyGILState_STATE _gilstate = PyGILState_Ensure();
30142             Py_CLEAR(memslice->memview);
30143             PyGILState_Release(_gilstate);
30144         }
30145     } else {
30146         memslice->memview = NULL;
30147     }
30148 }
30149 
30150 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)30151 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
30152 {
30153     if (unlikely(!type)) {
30154         PyErr_SetString(PyExc_SystemError, "Missing type object");
30155         return 0;
30156     }
30157     else if (exact) {
30158         #if PY_MAJOR_VERSION == 2
30159         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
30160         #endif
30161     }
30162     else {
30163         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
30164     }
30165     PyErr_Format(PyExc_TypeError,
30166         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
30167         name, type->tp_name, Py_TYPE(obj)->tp_name);
30168     return 0;
30169 }
30170 
30171 /* SliceObject */
__Pyx_PyObject_SetSlice(PyObject * obj,PyObject * value,Py_ssize_t cstart,Py_ssize_t cstop,PyObject ** _py_start,PyObject ** _py_stop,PyObject ** _py_slice,int has_cstart,int has_cstop,CYTHON_UNUSED int wraparound)30172 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
30173         Py_ssize_t cstart, Py_ssize_t cstop,
30174         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
30175         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
30176 #if CYTHON_USE_TYPE_SLOTS
30177     PyMappingMethods* mp;
30178 #if PY_MAJOR_VERSION < 3
30179     PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
30180     if (likely(ms && ms->sq_ass_slice)) {
30181         if (!has_cstart) {
30182             if (_py_start && (*_py_start != Py_None)) {
30183                 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
30184                 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
30185             } else
30186                 cstart = 0;
30187         }
30188         if (!has_cstop) {
30189             if (_py_stop && (*_py_stop != Py_None)) {
30190                 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
30191                 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
30192             } else
30193                 cstop = PY_SSIZE_T_MAX;
30194         }
30195         if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
30196             Py_ssize_t l = ms->sq_length(obj);
30197             if (likely(l >= 0)) {
30198                 if (cstop < 0) {
30199                     cstop += l;
30200                     if (cstop < 0) cstop = 0;
30201                 }
30202                 if (cstart < 0) {
30203                     cstart += l;
30204                     if (cstart < 0) cstart = 0;
30205                 }
30206             } else {
30207                 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30208                     goto bad;
30209                 PyErr_Clear();
30210             }
30211         }
30212         return ms->sq_ass_slice(obj, cstart, cstop, value);
30213     }
30214 #endif
30215     mp = Py_TYPE(obj)->tp_as_mapping;
30216     if (likely(mp && mp->mp_ass_subscript))
30217 #endif
30218     {
30219         int result;
30220         PyObject *py_slice, *py_start, *py_stop;
30221         if (_py_slice) {
30222             py_slice = *_py_slice;
30223         } else {
30224             PyObject* owned_start = NULL;
30225             PyObject* owned_stop = NULL;
30226             if (_py_start) {
30227                 py_start = *_py_start;
30228             } else {
30229                 if (has_cstart) {
30230                     owned_start = py_start = PyInt_FromSsize_t(cstart);
30231                     if (unlikely(!py_start)) goto bad;
30232                 } else
30233                     py_start = Py_None;
30234             }
30235             if (_py_stop) {
30236                 py_stop = *_py_stop;
30237             } else {
30238                 if (has_cstop) {
30239                     owned_stop = py_stop = PyInt_FromSsize_t(cstop);
30240                     if (unlikely(!py_stop)) {
30241                         Py_XDECREF(owned_start);
30242                         goto bad;
30243                     }
30244                 } else
30245                     py_stop = Py_None;
30246             }
30247             py_slice = PySlice_New(py_start, py_stop, Py_None);
30248             Py_XDECREF(owned_start);
30249             Py_XDECREF(owned_stop);
30250             if (unlikely(!py_slice)) goto bad;
30251         }
30252 #if CYTHON_USE_TYPE_SLOTS
30253         result = mp->mp_ass_subscript(obj, py_slice, value);
30254 #else
30255         result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
30256 #endif
30257         if (!_py_slice) {
30258             Py_DECREF(py_slice);
30259         }
30260         return result;
30261     }
30262     PyErr_Format(PyExc_TypeError,
30263         "'%.200s' object does not support slice %.10s",
30264         Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
30265 bad:
30266     return -1;
30267 }
30268 
30269 /* 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)30270 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
30271         Py_ssize_t cstart, Py_ssize_t cstop,
30272         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
30273         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
30274 #if CYTHON_USE_TYPE_SLOTS
30275     PyMappingMethods* mp;
30276 #if PY_MAJOR_VERSION < 3
30277     PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
30278     if (likely(ms && ms->sq_slice)) {
30279         if (!has_cstart) {
30280             if (_py_start && (*_py_start != Py_None)) {
30281                 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
30282                 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
30283             } else
30284                 cstart = 0;
30285         }
30286         if (!has_cstop) {
30287             if (_py_stop && (*_py_stop != Py_None)) {
30288                 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
30289                 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
30290             } else
30291                 cstop = PY_SSIZE_T_MAX;
30292         }
30293         if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
30294             Py_ssize_t l = ms->sq_length(obj);
30295             if (likely(l >= 0)) {
30296                 if (cstop < 0) {
30297                     cstop += l;
30298                     if (cstop < 0) cstop = 0;
30299                 }
30300                 if (cstart < 0) {
30301                     cstart += l;
30302                     if (cstart < 0) cstart = 0;
30303                 }
30304             } else {
30305                 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30306                     goto bad;
30307                 PyErr_Clear();
30308             }
30309         }
30310         return ms->sq_slice(obj, cstart, cstop);
30311     }
30312 #endif
30313     mp = Py_TYPE(obj)->tp_as_mapping;
30314     if (likely(mp && mp->mp_subscript))
30315 #endif
30316     {
30317         PyObject* result;
30318         PyObject *py_slice, *py_start, *py_stop;
30319         if (_py_slice) {
30320             py_slice = *_py_slice;
30321         } else {
30322             PyObject* owned_start = NULL;
30323             PyObject* owned_stop = NULL;
30324             if (_py_start) {
30325                 py_start = *_py_start;
30326             } else {
30327                 if (has_cstart) {
30328                     owned_start = py_start = PyInt_FromSsize_t(cstart);
30329                     if (unlikely(!py_start)) goto bad;
30330                 } else
30331                     py_start = Py_None;
30332             }
30333             if (_py_stop) {
30334                 py_stop = *_py_stop;
30335             } else {
30336                 if (has_cstop) {
30337                     owned_stop = py_stop = PyInt_FromSsize_t(cstop);
30338                     if (unlikely(!py_stop)) {
30339                         Py_XDECREF(owned_start);
30340                         goto bad;
30341                     }
30342                 } else
30343                     py_stop = Py_None;
30344             }
30345             py_slice = PySlice_New(py_start, py_stop, Py_None);
30346             Py_XDECREF(owned_start);
30347             Py_XDECREF(owned_stop);
30348             if (unlikely(!py_slice)) goto bad;
30349         }
30350 #if CYTHON_USE_TYPE_SLOTS
30351         result = mp->mp_subscript(obj, py_slice);
30352 #else
30353         result = PyObject_GetItem(obj, py_slice);
30354 #endif
30355         if (!_py_slice) {
30356             Py_DECREF(py_slice);
30357         }
30358         return result;
30359     }
30360     PyErr_Format(PyExc_TypeError,
30361         "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
30362 bad:
30363     return NULL;
30364 }
30365 
30366 /* GetTopmostException */
30367 #if CYTHON_USE_EXC_INFO_STACK
30368 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)30369 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
30370 {
30371     _PyErr_StackItem *exc_info = tstate->exc_info;
30372     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
30373            exc_info->previous_item != NULL)
30374     {
30375         exc_info = exc_info->previous_item;
30376     }
30377     return exc_info;
30378 }
30379 #endif
30380 
30381 /* SaveResetException */
30382 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)30383 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30384     #if CYTHON_USE_EXC_INFO_STACK
30385     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
30386     *type = exc_info->exc_type;
30387     *value = exc_info->exc_value;
30388     *tb = exc_info->exc_traceback;
30389     #else
30390     *type = tstate->exc_type;
30391     *value = tstate->exc_value;
30392     *tb = tstate->exc_traceback;
30393     #endif
30394     Py_XINCREF(*type);
30395     Py_XINCREF(*value);
30396     Py_XINCREF(*tb);
30397 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)30398 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
30399     PyObject *tmp_type, *tmp_value, *tmp_tb;
30400     #if CYTHON_USE_EXC_INFO_STACK
30401     _PyErr_StackItem *exc_info = tstate->exc_info;
30402     tmp_type = exc_info->exc_type;
30403     tmp_value = exc_info->exc_value;
30404     tmp_tb = exc_info->exc_traceback;
30405     exc_info->exc_type = type;
30406     exc_info->exc_value = value;
30407     exc_info->exc_traceback = tb;
30408     #else
30409     tmp_type = tstate->exc_type;
30410     tmp_value = tstate->exc_value;
30411     tmp_tb = tstate->exc_traceback;
30412     tstate->exc_type = type;
30413     tstate->exc_value = value;
30414     tstate->exc_traceback = tb;
30415     #endif
30416     Py_XDECREF(tmp_type);
30417     Py_XDECREF(tmp_value);
30418     Py_XDECREF(tmp_tb);
30419 }
30420 #endif
30421 
30422 /* PyErrExceptionMatches */
30423 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)30424 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30425     Py_ssize_t i, n;
30426     n = PyTuple_GET_SIZE(tuple);
30427 #if PY_MAJOR_VERSION >= 3
30428     for (i=0; i<n; i++) {
30429         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30430     }
30431 #endif
30432     for (i=0; i<n; i++) {
30433         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
30434     }
30435     return 0;
30436 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)30437 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
30438     PyObject *exc_type = tstate->curexc_type;
30439     if (exc_type == err) return 1;
30440     if (unlikely(!exc_type)) return 0;
30441     if (unlikely(PyTuple_Check(err)))
30442         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
30443     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
30444 }
30445 #endif
30446 
30447 /* GetException */
30448 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)30449 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
30450 #else
30451 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
30452 #endif
30453 {
30454     PyObject *local_type, *local_value, *local_tb;
30455 #if CYTHON_FAST_THREAD_STATE
30456     PyObject *tmp_type, *tmp_value, *tmp_tb;
30457     local_type = tstate->curexc_type;
30458     local_value = tstate->curexc_value;
30459     local_tb = tstate->curexc_traceback;
30460     tstate->curexc_type = 0;
30461     tstate->curexc_value = 0;
30462     tstate->curexc_traceback = 0;
30463 #else
30464     PyErr_Fetch(&local_type, &local_value, &local_tb);
30465 #endif
30466     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
30467 #if CYTHON_FAST_THREAD_STATE
30468     if (unlikely(tstate->curexc_type))
30469 #else
30470     if (unlikely(PyErr_Occurred()))
30471 #endif
30472         goto bad;
30473     #if PY_MAJOR_VERSION >= 3
30474     if (local_tb) {
30475         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
30476             goto bad;
30477     }
30478     #endif
30479     Py_XINCREF(local_tb);
30480     Py_XINCREF(local_type);
30481     Py_XINCREF(local_value);
30482     *type = local_type;
30483     *value = local_value;
30484     *tb = local_tb;
30485 #if CYTHON_FAST_THREAD_STATE
30486     #if CYTHON_USE_EXC_INFO_STACK
30487     {
30488         _PyErr_StackItem *exc_info = tstate->exc_info;
30489         tmp_type = exc_info->exc_type;
30490         tmp_value = exc_info->exc_value;
30491         tmp_tb = exc_info->exc_traceback;
30492         exc_info->exc_type = local_type;
30493         exc_info->exc_value = local_value;
30494         exc_info->exc_traceback = local_tb;
30495     }
30496     #else
30497     tmp_type = tstate->exc_type;
30498     tmp_value = tstate->exc_value;
30499     tmp_tb = tstate->exc_traceback;
30500     tstate->exc_type = local_type;
30501     tstate->exc_value = local_value;
30502     tstate->exc_traceback = local_tb;
30503     #endif
30504     Py_XDECREF(tmp_type);
30505     Py_XDECREF(tmp_value);
30506     Py_XDECREF(tmp_tb);
30507 #else
30508     PyErr_SetExcInfo(local_type, local_value, local_tb);
30509 #endif
30510     return 0;
30511 bad:
30512     *type = 0;
30513     *value = 0;
30514     *tb = 0;
30515     Py_XDECREF(local_type);
30516     Py_XDECREF(local_value);
30517     Py_XDECREF(local_tb);
30518     return -1;
30519 }
30520 
30521 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)30522 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
30523 #if CYTHON_COMPILING_IN_PYPY
30524     return PyObject_RichCompareBool(s1, s2, equals);
30525 #else
30526     if (s1 == s2) {
30527         return (equals == Py_EQ);
30528     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
30529         const char *ps1, *ps2;
30530         Py_ssize_t length = PyBytes_GET_SIZE(s1);
30531         if (length != PyBytes_GET_SIZE(s2))
30532             return (equals == Py_NE);
30533         ps1 = PyBytes_AS_STRING(s1);
30534         ps2 = PyBytes_AS_STRING(s2);
30535         if (ps1[0] != ps2[0]) {
30536             return (equals == Py_NE);
30537         } else if (length == 1) {
30538             return (equals == Py_EQ);
30539         } else {
30540             int result;
30541 #if CYTHON_USE_UNICODE_INTERNALS
30542             Py_hash_t hash1, hash2;
30543             hash1 = ((PyBytesObject*)s1)->ob_shash;
30544             hash2 = ((PyBytesObject*)s2)->ob_shash;
30545             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
30546                 return (equals == Py_NE);
30547             }
30548 #endif
30549             result = memcmp(ps1, ps2, (size_t)length);
30550             return (equals == Py_EQ) ? (result == 0) : (result != 0);
30551         }
30552     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
30553         return (equals == Py_NE);
30554     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
30555         return (equals == Py_NE);
30556     } else {
30557         int result;
30558         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
30559         if (!py_result)
30560             return -1;
30561         result = __Pyx_PyObject_IsTrue(py_result);
30562         Py_DECREF(py_result);
30563         return result;
30564     }
30565 #endif
30566 }
30567 
30568 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)30569 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
30570 #if CYTHON_COMPILING_IN_PYPY
30571     return PyObject_RichCompareBool(s1, s2, equals);
30572 #else
30573 #if PY_MAJOR_VERSION < 3
30574     PyObject* owned_ref = NULL;
30575 #endif
30576     int s1_is_unicode, s2_is_unicode;
30577     if (s1 == s2) {
30578         goto return_eq;
30579     }
30580     s1_is_unicode = PyUnicode_CheckExact(s1);
30581     s2_is_unicode = PyUnicode_CheckExact(s2);
30582 #if PY_MAJOR_VERSION < 3
30583     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
30584         owned_ref = PyUnicode_FromObject(s2);
30585         if (unlikely(!owned_ref))
30586             return -1;
30587         s2 = owned_ref;
30588         s2_is_unicode = 1;
30589     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
30590         owned_ref = PyUnicode_FromObject(s1);
30591         if (unlikely(!owned_ref))
30592             return -1;
30593         s1 = owned_ref;
30594         s1_is_unicode = 1;
30595     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
30596         return __Pyx_PyBytes_Equals(s1, s2, equals);
30597     }
30598 #endif
30599     if (s1_is_unicode & s2_is_unicode) {
30600         Py_ssize_t length;
30601         int kind;
30602         void *data1, *data2;
30603         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
30604             return -1;
30605         length = __Pyx_PyUnicode_GET_LENGTH(s1);
30606         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
30607             goto return_ne;
30608         }
30609 #if CYTHON_USE_UNICODE_INTERNALS
30610         {
30611             Py_hash_t hash1, hash2;
30612         #if CYTHON_PEP393_ENABLED
30613             hash1 = ((PyASCIIObject*)s1)->hash;
30614             hash2 = ((PyASCIIObject*)s2)->hash;
30615         #else
30616             hash1 = ((PyUnicodeObject*)s1)->hash;
30617             hash2 = ((PyUnicodeObject*)s2)->hash;
30618         #endif
30619             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
30620                 goto return_ne;
30621             }
30622         }
30623 #endif
30624         kind = __Pyx_PyUnicode_KIND(s1);
30625         if (kind != __Pyx_PyUnicode_KIND(s2)) {
30626             goto return_ne;
30627         }
30628         data1 = __Pyx_PyUnicode_DATA(s1);
30629         data2 = __Pyx_PyUnicode_DATA(s2);
30630         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
30631             goto return_ne;
30632         } else if (length == 1) {
30633             goto return_eq;
30634         } else {
30635             int result = memcmp(data1, data2, (size_t)(length * kind));
30636             #if PY_MAJOR_VERSION < 3
30637             Py_XDECREF(owned_ref);
30638             #endif
30639             return (equals == Py_EQ) ? (result == 0) : (result != 0);
30640         }
30641     } else if ((s1 == Py_None) & s2_is_unicode) {
30642         goto return_ne;
30643     } else if ((s2 == Py_None) & s1_is_unicode) {
30644         goto return_ne;
30645     } else {
30646         int result;
30647         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
30648         #if PY_MAJOR_VERSION < 3
30649         Py_XDECREF(owned_ref);
30650         #endif
30651         if (!py_result)
30652             return -1;
30653         result = __Pyx_PyObject_IsTrue(py_result);
30654         Py_DECREF(py_result);
30655         return result;
30656     }
30657 return_eq:
30658     #if PY_MAJOR_VERSION < 3
30659     Py_XDECREF(owned_ref);
30660     #endif
30661     return (equals == Py_EQ);
30662 return_ne:
30663     #if PY_MAJOR_VERSION < 3
30664     Py_XDECREF(owned_ref);
30665     #endif
30666     return (equals == Py_NE);
30667 #endif
30668 }
30669 
30670 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)30671 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
30672 #if CYTHON_USE_TYPE_SLOTS
30673 #if PY_MAJOR_VERSION >= 3
30674     if (likely(PyUnicode_Check(n)))
30675 #else
30676     if (likely(PyString_Check(n)))
30677 #endif
30678         return __Pyx_PyObject_GetAttrStr(o, n);
30679 #endif
30680     return PyObject_GetAttr(o, n);
30681 }
30682 
30683 /* ObjectGetItem */
30684 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)30685 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
30686     PyObject *runerr;
30687     Py_ssize_t key_value;
30688     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
30689     if (unlikely(!(m && m->sq_item))) {
30690         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
30691         return NULL;
30692     }
30693     key_value = __Pyx_PyIndex_AsSsize_t(index);
30694     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
30695         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
30696     }
30697     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
30698         PyErr_Clear();
30699         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
30700     }
30701     return NULL;
30702 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)30703 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
30704     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
30705     if (likely(m && m->mp_subscript)) {
30706         return m->mp_subscript(obj, key);
30707     }
30708     return __Pyx_PyObject_GetIndex(obj, key);
30709 }
30710 #endif
30711 
30712 /* decode_c_string */
__Pyx_decode_c_string(const char * cstring,Py_ssize_t start,Py_ssize_t stop,const char * encoding,const char * errors,PyObject * (* decode_func)(const char * s,Py_ssize_t size,const char * errors))30713 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
30714          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
30715          const char* encoding, const char* errors,
30716          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
30717     Py_ssize_t length;
30718     if (unlikely((start < 0) | (stop < 0))) {
30719         size_t slen = strlen(cstring);
30720         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
30721             PyErr_SetString(PyExc_OverflowError,
30722                             "c-string too long to convert to Python");
30723             return NULL;
30724         }
30725         length = (Py_ssize_t) slen;
30726         if (start < 0) {
30727             start += length;
30728             if (start < 0)
30729                 start = 0;
30730         }
30731         if (stop < 0)
30732             stop += length;
30733     }
30734     if (unlikely(stop <= start))
30735         return __Pyx_NewRef(__pyx_empty_unicode);
30736     length = stop - start;
30737     cstring += start;
30738     if (decode_func) {
30739         return decode_func(cstring, length, errors);
30740     } else {
30741         return PyUnicode_Decode(cstring, length, encoding, errors);
30742     }
30743 }
30744 
30745 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)30746 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
30747     __Pyx_PyThreadState_declare
30748     __Pyx_PyThreadState_assign
30749     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30750         return NULL;
30751     __Pyx_PyErr_Clear();
30752     Py_INCREF(d);
30753     return d;
30754 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)30755 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
30756     PyObject *r = __Pyx_GetAttr(o, n);
30757     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
30758 }
30759 
30760 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)30761 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
30762     if (unlikely(!type)) {
30763         PyErr_SetString(PyExc_SystemError, "Missing type object");
30764         return 0;
30765     }
30766     if (likely(__Pyx_TypeCheck(obj, type)))
30767         return 1;
30768     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
30769                  Py_TYPE(obj)->tp_name, type->tp_name);
30770     return 0;
30771 }
30772 
30773 /* SwapException */
30774 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)30775 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30776     PyObject *tmp_type, *tmp_value, *tmp_tb;
30777     #if CYTHON_USE_EXC_INFO_STACK
30778     _PyErr_StackItem *exc_info = tstate->exc_info;
30779     tmp_type = exc_info->exc_type;
30780     tmp_value = exc_info->exc_value;
30781     tmp_tb = exc_info->exc_traceback;
30782     exc_info->exc_type = *type;
30783     exc_info->exc_value = *value;
30784     exc_info->exc_traceback = *tb;
30785     #else
30786     tmp_type = tstate->exc_type;
30787     tmp_value = tstate->exc_value;
30788     tmp_tb = tstate->exc_traceback;
30789     tstate->exc_type = *type;
30790     tstate->exc_value = *value;
30791     tstate->exc_traceback = *tb;
30792     #endif
30793     *type = tmp_type;
30794     *value = tmp_value;
30795     *tb = tmp_tb;
30796 }
30797 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)30798 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
30799     PyObject *tmp_type, *tmp_value, *tmp_tb;
30800     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
30801     PyErr_SetExcInfo(*type, *value, *tb);
30802     *type = tmp_type;
30803     *value = tmp_value;
30804     *tb = tmp_tb;
30805 }
30806 #endif
30807 
30808 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)30809 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
30810     PyObject *empty_list = 0;
30811     PyObject *module = 0;
30812     PyObject *global_dict = 0;
30813     PyObject *empty_dict = 0;
30814     PyObject *list;
30815     #if PY_MAJOR_VERSION < 3
30816     PyObject *py_import;
30817     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
30818     if (!py_import)
30819         goto bad;
30820     #endif
30821     if (from_list)
30822         list = from_list;
30823     else {
30824         empty_list = PyList_New(0);
30825         if (!empty_list)
30826             goto bad;
30827         list = empty_list;
30828     }
30829     global_dict = PyModule_GetDict(__pyx_m);
30830     if (!global_dict)
30831         goto bad;
30832     empty_dict = PyDict_New();
30833     if (!empty_dict)
30834         goto bad;
30835     {
30836         #if PY_MAJOR_VERSION >= 3
30837         if (level == -1) {
30838             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
30839                 module = PyImport_ImportModuleLevelObject(
30840                     name, global_dict, empty_dict, list, 1);
30841                 if (!module) {
30842                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
30843                         goto bad;
30844                     PyErr_Clear();
30845                 }
30846             }
30847             level = 0;
30848         }
30849         #endif
30850         if (!module) {
30851             #if PY_MAJOR_VERSION < 3
30852             PyObject *py_level = PyInt_FromLong(level);
30853             if (!py_level)
30854                 goto bad;
30855             module = PyObject_CallFunctionObjArgs(py_import,
30856                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
30857             Py_DECREF(py_level);
30858             #else
30859             module = PyImport_ImportModuleLevelObject(
30860                 name, global_dict, empty_dict, list, level);
30861             #endif
30862         }
30863     }
30864 bad:
30865     #if PY_MAJOR_VERSION < 3
30866     Py_XDECREF(py_import);
30867     #endif
30868     Py_XDECREF(empty_list);
30869     Py_XDECREF(empty_dict);
30870     return module;
30871 }
30872 
30873 /* FastTypeChecks */
30874 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)30875 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30876     while (a) {
30877         a = a->tp_base;
30878         if (a == b)
30879             return 1;
30880     }
30881     return b == &PyBaseObject_Type;
30882 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)30883 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30884     PyObject *mro;
30885     if (a == b) return 1;
30886     mro = a->tp_mro;
30887     if (likely(mro)) {
30888         Py_ssize_t i, n;
30889         n = PyTuple_GET_SIZE(mro);
30890         for (i = 0; i < n; i++) {
30891             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30892                 return 1;
30893         }
30894         return 0;
30895     }
30896     return __Pyx_InBases(a, b);
30897 }
30898 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)30899 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
30900     PyObject *exception, *value, *tb;
30901     int res;
30902     __Pyx_PyThreadState_declare
30903     __Pyx_PyThreadState_assign
30904     __Pyx_ErrFetch(&exception, &value, &tb);
30905     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
30906     if (unlikely(res == -1)) {
30907         PyErr_WriteUnraisable(err);
30908         res = 0;
30909     }
30910     if (!res) {
30911         res = PyObject_IsSubclass(err, exc_type2);
30912         if (unlikely(res == -1)) {
30913             PyErr_WriteUnraisable(err);
30914             res = 0;
30915         }
30916     }
30917     __Pyx_ErrRestore(exception, value, tb);
30918     return res;
30919 }
30920 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)30921 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
30922     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
30923     if (!res) {
30924         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
30925     }
30926     return res;
30927 }
30928 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)30929 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30930     Py_ssize_t i, n;
30931     assert(PyExceptionClass_Check(exc_type));
30932     n = PyTuple_GET_SIZE(tuple);
30933 #if PY_MAJOR_VERSION >= 3
30934     for (i=0; i<n; i++) {
30935         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30936     }
30937 #endif
30938     for (i=0; i<n; i++) {
30939         PyObject *t = PyTuple_GET_ITEM(tuple, i);
30940         #if PY_MAJOR_VERSION < 3
30941         if (likely(exc_type == t)) return 1;
30942         #endif
30943         if (likely(PyExceptionClass_Check(t))) {
30944             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
30945         } else {
30946         }
30947     }
30948     return 0;
30949 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)30950 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30951     if (likely(err == exc_type)) return 1;
30952     if (likely(PyExceptionClass_Check(err))) {
30953         if (likely(PyExceptionClass_Check(exc_type))) {
30954             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30955         } else if (likely(PyTuple_Check(exc_type))) {
30956             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30957         } else {
30958         }
30959     }
30960     return PyErr_GivenExceptionMatches(err, exc_type);
30961 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)30962 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30963     assert(PyExceptionClass_Check(exc_type1));
30964     assert(PyExceptionClass_Check(exc_type2));
30965     if (likely(err == exc_type1 || err == exc_type2)) return 1;
30966     if (likely(PyExceptionClass_Check(err))) {
30967         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30968     }
30969     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30970 }
30971 #endif
30972 
30973 /* PyIntBinop */
30974 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)30975 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
30976     (void)inplace;
30977     (void)zerodivision_check;
30978     #if PY_MAJOR_VERSION < 3
30979     if (likely(PyInt_CheckExact(op1))) {
30980         const long b = intval;
30981         long x;
30982         long a = PyInt_AS_LONG(op1);
30983             x = (long)((unsigned long)a + b);
30984             if (likely((x^a) >= 0 || (x^b) >= 0))
30985                 return PyInt_FromLong(x);
30986             return PyLong_Type.tp_as_number->nb_add(op1, op2);
30987     }
30988     #endif
30989     #if CYTHON_USE_PYLONG_INTERNALS
30990     if (likely(PyLong_CheckExact(op1))) {
30991         const long b = intval;
30992         long a, x;
30993 #ifdef HAVE_LONG_LONG
30994         const PY_LONG_LONG llb = intval;
30995         PY_LONG_LONG lla, llx;
30996 #endif
30997         const digit* digits = ((PyLongObject*)op1)->ob_digit;
30998         const Py_ssize_t size = Py_SIZE(op1);
30999         if (likely(__Pyx_sst_abs(size) <= 1)) {
31000             a = likely(size) ? digits[0] : 0;
31001             if (size == -1) a = -a;
31002         } else {
31003             switch (size) {
31004                 case -2:
31005                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
31006                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31007                         break;
31008 #ifdef HAVE_LONG_LONG
31009                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
31010                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31011                         goto long_long;
31012 #endif
31013                     }
31014                     CYTHON_FALLTHROUGH;
31015                 case 2:
31016                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
31017                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31018                         break;
31019 #ifdef HAVE_LONG_LONG
31020                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
31021                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31022                         goto long_long;
31023 #endif
31024                     }
31025                     CYTHON_FALLTHROUGH;
31026                 case -3:
31027                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
31028                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31029                         break;
31030 #ifdef HAVE_LONG_LONG
31031                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
31032                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31033                         goto long_long;
31034 #endif
31035                     }
31036                     CYTHON_FALLTHROUGH;
31037                 case 3:
31038                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
31039                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31040                         break;
31041 #ifdef HAVE_LONG_LONG
31042                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
31043                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31044                         goto long_long;
31045 #endif
31046                     }
31047                     CYTHON_FALLTHROUGH;
31048                 case -4:
31049                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
31050                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31051                         break;
31052 #ifdef HAVE_LONG_LONG
31053                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
31054                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31055                         goto long_long;
31056 #endif
31057                     }
31058                     CYTHON_FALLTHROUGH;
31059                 case 4:
31060                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
31061                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31062                         break;
31063 #ifdef HAVE_LONG_LONG
31064                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
31065                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31066                         goto long_long;
31067 #endif
31068                     }
31069                     CYTHON_FALLTHROUGH;
31070                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
31071             }
31072         }
31073                 x = a + b;
31074             return PyLong_FromLong(x);
31075 #ifdef HAVE_LONG_LONG
31076         long_long:
31077                 llx = lla + llb;
31078             return PyLong_FromLongLong(llx);
31079 #endif
31080 
31081 
31082     }
31083     #endif
31084     if (PyFloat_CheckExact(op1)) {
31085         const long b = intval;
31086         double a = PyFloat_AS_DOUBLE(op1);
31087             double result;
31088             PyFPE_START_PROTECT("add", return NULL)
31089             result = ((double)a) + (double)b;
31090             PyFPE_END_PROTECT(result)
31091             return PyFloat_FromDouble(result);
31092     }
31093     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
31094 }
31095 #endif
31096 
31097 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)31098 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
31099     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
31100 }
31101 
31102 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)31103 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
31104     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
31105     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
31106         PyErr_Format(PyExc_ImportError,
31107         #if PY_MAJOR_VERSION < 3
31108             "cannot import name %.230s", PyString_AS_STRING(name));
31109         #else
31110             "cannot import name %S", name);
31111         #endif
31112     }
31113     return value;
31114 }
31115 
31116 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)31117 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
31118     PyObject *r;
31119     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
31120         PyErr_SetString(PyExc_TypeError,
31121                         "hasattr(): attribute name must be string");
31122         return -1;
31123     }
31124     r = __Pyx_GetAttr(o, n);
31125     if (unlikely(!r)) {
31126         PyErr_Clear();
31127         return 0;
31128     } else {
31129         Py_DECREF(r);
31130         return 1;
31131     }
31132 }
31133 
31134 /* PyObject_GenericGetAttrNoDict */
31135 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)31136 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
31137     PyErr_Format(PyExc_AttributeError,
31138 #if PY_MAJOR_VERSION >= 3
31139                  "'%.50s' object has no attribute '%U'",
31140                  tp->tp_name, attr_name);
31141 #else
31142                  "'%.50s' object has no attribute '%.400s'",
31143                  tp->tp_name, PyString_AS_STRING(attr_name));
31144 #endif
31145     return NULL;
31146 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)31147 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
31148     PyObject *descr;
31149     PyTypeObject *tp = Py_TYPE(obj);
31150     if (unlikely(!PyString_Check(attr_name))) {
31151         return PyObject_GenericGetAttr(obj, attr_name);
31152     }
31153     assert(!tp->tp_dictoffset);
31154     descr = _PyType_Lookup(tp, attr_name);
31155     if (unlikely(!descr)) {
31156         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
31157     }
31158     Py_INCREF(descr);
31159     #if PY_MAJOR_VERSION < 3
31160     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
31161     #endif
31162     {
31163         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
31164         if (unlikely(f)) {
31165             PyObject *res = f(descr, obj, (PyObject *)tp);
31166             Py_DECREF(descr);
31167             return res;
31168         }
31169     }
31170     return descr;
31171 }
31172 #endif
31173 
31174 /* PyObject_GenericGetAttr */
31175 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)31176 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
31177     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
31178         return PyObject_GenericGetAttr(obj, attr_name);
31179     }
31180     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
31181 }
31182 #endif
31183 
31184 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)31185 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
31186 #if PY_VERSION_HEX >= 0x02070000
31187     PyObject *ob = PyCapsule_New(vtable, 0, 0);
31188 #else
31189     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
31190 #endif
31191     if (!ob)
31192         goto bad;
31193     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
31194         goto bad;
31195     Py_DECREF(ob);
31196     return 0;
31197 bad:
31198     Py_XDECREF(ob);
31199     return -1;
31200 }
31201 
31202 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)31203 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
31204     __Pyx_PyThreadState_declare
31205     __Pyx_PyThreadState_assign
31206     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
31207         __Pyx_PyErr_Clear();
31208 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)31209 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
31210     PyObject *result;
31211 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
31212     PyTypeObject* tp = Py_TYPE(obj);
31213     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
31214         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
31215     }
31216 #endif
31217     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
31218     if (unlikely(!result)) {
31219         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
31220     }
31221     return result;
31222 }
31223 
31224 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)31225 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
31226   int ret;
31227   PyObject *name_attr;
31228   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
31229   if (likely(name_attr)) {
31230       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
31231   } else {
31232       ret = -1;
31233   }
31234   if (unlikely(ret < 0)) {
31235       PyErr_Clear();
31236       ret = 0;
31237   }
31238   Py_XDECREF(name_attr);
31239   return ret;
31240 }
__Pyx_setup_reduce(PyObject * type_obj)31241 static int __Pyx_setup_reduce(PyObject* type_obj) {
31242     int ret = 0;
31243     PyObject *object_reduce = NULL;
31244     PyObject *object_reduce_ex = NULL;
31245     PyObject *reduce = NULL;
31246     PyObject *reduce_ex = NULL;
31247     PyObject *reduce_cython = NULL;
31248     PyObject *setstate = NULL;
31249     PyObject *setstate_cython = NULL;
31250 #if CYTHON_USE_PYTYPE_LOOKUP
31251     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
31252 #else
31253     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
31254 #endif
31255 #if CYTHON_USE_PYTYPE_LOOKUP
31256     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
31257 #else
31258     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
31259 #endif
31260     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
31261     if (reduce_ex == object_reduce_ex) {
31262 #if CYTHON_USE_PYTYPE_LOOKUP
31263         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
31264 #else
31265         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
31266 #endif
31267         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
31268         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
31269             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
31270             if (likely(reduce_cython)) {
31271                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31272                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31273             } else if (reduce == object_reduce || PyErr_Occurred()) {
31274                 goto __PYX_BAD;
31275             }
31276             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
31277             if (!setstate) PyErr_Clear();
31278             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
31279                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
31280                 if (likely(setstate_cython)) {
31281                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31282                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31283                 } else if (!setstate || PyErr_Occurred()) {
31284                     goto __PYX_BAD;
31285                 }
31286             }
31287             PyType_Modified((PyTypeObject*)type_obj);
31288         }
31289     }
31290     goto __PYX_GOOD;
31291 __PYX_BAD:
31292     if (!PyErr_Occurred())
31293         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
31294     ret = -1;
31295 __PYX_GOOD:
31296 #if !CYTHON_USE_PYTYPE_LOOKUP
31297     Py_XDECREF(object_reduce);
31298     Py_XDECREF(object_reduce_ex);
31299 #endif
31300     Py_XDECREF(reduce);
31301     Py_XDECREF(reduce_ex);
31302     Py_XDECREF(reduce_cython);
31303     Py_XDECREF(setstate);
31304     Py_XDECREF(setstate_cython);
31305     return ret;
31306 }
31307 
31308 /* TypeImport */
31309 #ifndef __PYX_HAVE_RT_ImportType
31310 #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)31311 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
31312     size_t size, enum __Pyx_ImportType_CheckSize check_size)
31313 {
31314     PyObject *result = 0;
31315     char warning[200];
31316     Py_ssize_t basicsize;
31317 #ifdef Py_LIMITED_API
31318     PyObject *py_basicsize;
31319 #endif
31320     result = PyObject_GetAttrString(module, class_name);
31321     if (!result)
31322         goto bad;
31323     if (!PyType_Check(result)) {
31324         PyErr_Format(PyExc_TypeError,
31325             "%.200s.%.200s is not a type object",
31326             module_name, class_name);
31327         goto bad;
31328     }
31329 #ifndef Py_LIMITED_API
31330     basicsize = ((PyTypeObject *)result)->tp_basicsize;
31331 #else
31332     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
31333     if (!py_basicsize)
31334         goto bad;
31335     basicsize = PyLong_AsSsize_t(py_basicsize);
31336     Py_DECREF(py_basicsize);
31337     py_basicsize = 0;
31338     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
31339         goto bad;
31340 #endif
31341     if ((size_t)basicsize < size) {
31342         PyErr_Format(PyExc_ValueError,
31343             "%.200s.%.200s size changed, may indicate binary incompatibility. "
31344             "Expected %zd from C header, got %zd from PyObject",
31345             module_name, class_name, size, basicsize);
31346         goto bad;
31347     }
31348     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
31349         PyErr_Format(PyExc_ValueError,
31350             "%.200s.%.200s size changed, may indicate binary incompatibility. "
31351             "Expected %zd from C header, got %zd from PyObject",
31352             module_name, class_name, size, basicsize);
31353         goto bad;
31354     }
31355     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
31356         PyOS_snprintf(warning, sizeof(warning),
31357             "%s.%s size changed, may indicate binary incompatibility. "
31358             "Expected %zd from C header, got %zd from PyObject",
31359             module_name, class_name, size, basicsize);
31360         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
31361     }
31362     return (PyTypeObject *)result;
31363 bad:
31364     Py_XDECREF(result);
31365     return NULL;
31366 }
31367 #endif
31368 
31369 /* FetchCommonType */
__Pyx_FetchCommonType(PyTypeObject * type)31370 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
31371     PyObject* fake_module;
31372     PyTypeObject* cached_type = NULL;
31373     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
31374     if (!fake_module) return NULL;
31375     Py_INCREF(fake_module);
31376     cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
31377     if (cached_type) {
31378         if (!PyType_Check((PyObject*)cached_type)) {
31379             PyErr_Format(PyExc_TypeError,
31380                 "Shared Cython type %.200s is not a type object",
31381                 type->tp_name);
31382             goto bad;
31383         }
31384         if (cached_type->tp_basicsize != type->tp_basicsize) {
31385             PyErr_Format(PyExc_TypeError,
31386                 "Shared Cython type %.200s has the wrong size, try recompiling",
31387                 type->tp_name);
31388             goto bad;
31389         }
31390     } else {
31391         if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
31392         PyErr_Clear();
31393         if (PyType_Ready(type) < 0) goto bad;
31394         if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
31395             goto bad;
31396         Py_INCREF(type);
31397         cached_type = type;
31398     }
31399 done:
31400     Py_DECREF(fake_module);
31401     return cached_type;
31402 bad:
31403     Py_XDECREF(cached_type);
31404     cached_type = NULL;
31405     goto done;
31406 }
31407 
31408 /* CythonFunctionShared */
31409 #include <structmember.h>
31410 static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * closure)31411 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
31412 {
31413     if (unlikely(op->func_doc == NULL)) {
31414         if (op->func.m_ml->ml_doc) {
31415 #if PY_MAJOR_VERSION >= 3
31416             op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
31417 #else
31418             op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
31419 #endif
31420             if (unlikely(op->func_doc == NULL))
31421                 return NULL;
31422         } else {
31423             Py_INCREF(Py_None);
31424             return Py_None;
31425         }
31426     }
31427     Py_INCREF(op->func_doc);
31428     return op->func_doc;
31429 }
31430 static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)31431 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
31432 {
31433     PyObject *tmp = op->func_doc;
31434     if (value == NULL) {
31435         value = Py_None;
31436     }
31437     Py_INCREF(value);
31438     op->func_doc = value;
31439     Py_XDECREF(tmp);
31440     return 0;
31441 }
31442 static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31443 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
31444 {
31445     if (unlikely(op->func_name == NULL)) {
31446 #if PY_MAJOR_VERSION >= 3
31447         op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
31448 #else
31449         op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
31450 #endif
31451         if (unlikely(op->func_name == NULL))
31452             return NULL;
31453     }
31454     Py_INCREF(op->func_name);
31455     return op->func_name;
31456 }
31457 static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)31458 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
31459 {
31460     PyObject *tmp;
31461 #if PY_MAJOR_VERSION >= 3
31462     if (unlikely(value == NULL || !PyUnicode_Check(value)))
31463 #else
31464     if (unlikely(value == NULL || !PyString_Check(value)))
31465 #endif
31466     {
31467         PyErr_SetString(PyExc_TypeError,
31468                         "__name__ must be set to a string object");
31469         return -1;
31470     }
31471     tmp = op->func_name;
31472     Py_INCREF(value);
31473     op->func_name = value;
31474     Py_XDECREF(tmp);
31475     return 0;
31476 }
31477 static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31478 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
31479 {
31480     Py_INCREF(op->func_qualname);
31481     return op->func_qualname;
31482 }
31483 static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)31484 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
31485 {
31486     PyObject *tmp;
31487 #if PY_MAJOR_VERSION >= 3
31488     if (unlikely(value == NULL || !PyUnicode_Check(value)))
31489 #else
31490     if (unlikely(value == NULL || !PyString_Check(value)))
31491 #endif
31492     {
31493         PyErr_SetString(PyExc_TypeError,
31494                         "__qualname__ must be set to a string object");
31495         return -1;
31496     }
31497     tmp = op->func_qualname;
31498     Py_INCREF(value);
31499     op->func_qualname = value;
31500     Py_XDECREF(tmp);
31501     return 0;
31502 }
31503 static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject * m,CYTHON_UNUSED void * closure)31504 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
31505 {
31506     PyObject *self;
31507     self = m->func_closure;
31508     if (self == NULL)
31509         self = Py_None;
31510     Py_INCREF(self);
31511     return self;
31512 }
31513 static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31514 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
31515 {
31516     if (unlikely(op->func_dict == NULL)) {
31517         op->func_dict = PyDict_New();
31518         if (unlikely(op->func_dict == NULL))
31519             return NULL;
31520     }
31521     Py_INCREF(op->func_dict);
31522     return op->func_dict;
31523 }
31524 static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)31525 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
31526 {
31527     PyObject *tmp;
31528     if (unlikely(value == NULL)) {
31529         PyErr_SetString(PyExc_TypeError,
31530                "function's dictionary may not be deleted");
31531         return -1;
31532     }
31533     if (unlikely(!PyDict_Check(value))) {
31534         PyErr_SetString(PyExc_TypeError,
31535                "setting function's dictionary to a non-dict");
31536         return -1;
31537     }
31538     tmp = op->func_dict;
31539     Py_INCREF(value);
31540     op->func_dict = value;
31541     Py_XDECREF(tmp);
31542     return 0;
31543 }
31544 static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31545 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
31546 {
31547     Py_INCREF(op->func_globals);
31548     return op->func_globals;
31549 }
31550 static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31551 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
31552 {
31553     Py_INCREF(Py_None);
31554     return Py_None;
31555 }
31556 static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31557 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
31558 {
31559     PyObject* result = (op->func_code) ? op->func_code : Py_None;
31560     Py_INCREF(result);
31561     return result;
31562 }
31563 static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject * op)31564 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
31565     int result = 0;
31566     PyObject *res = op->defaults_getter((PyObject *) op);
31567     if (unlikely(!res))
31568         return -1;
31569     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31570     op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
31571     Py_INCREF(op->defaults_tuple);
31572     op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
31573     Py_INCREF(op->defaults_kwdict);
31574     #else
31575     op->defaults_tuple = PySequence_ITEM(res, 0);
31576     if (unlikely(!op->defaults_tuple)) result = -1;
31577     else {
31578         op->defaults_kwdict = PySequence_ITEM(res, 1);
31579         if (unlikely(!op->defaults_kwdict)) result = -1;
31580     }
31581     #endif
31582     Py_DECREF(res);
31583     return result;
31584 }
31585 static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)31586 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
31587     PyObject* tmp;
31588     if (!value) {
31589         value = Py_None;
31590     } else if (value != Py_None && !PyTuple_Check(value)) {
31591         PyErr_SetString(PyExc_TypeError,
31592                         "__defaults__ must be set to a tuple object");
31593         return -1;
31594     }
31595     Py_INCREF(value);
31596     tmp = op->defaults_tuple;
31597     op->defaults_tuple = value;
31598     Py_XDECREF(tmp);
31599     return 0;
31600 }
31601 static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31602 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
31603     PyObject* result = op->defaults_tuple;
31604     if (unlikely(!result)) {
31605         if (op->defaults_getter) {
31606             if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
31607             result = op->defaults_tuple;
31608         } else {
31609             result = Py_None;
31610         }
31611     }
31612     Py_INCREF(result);
31613     return result;
31614 }
31615 static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)31616 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
31617     PyObject* tmp;
31618     if (!value) {
31619         value = Py_None;
31620     } else if (value != Py_None && !PyDict_Check(value)) {
31621         PyErr_SetString(PyExc_TypeError,
31622                         "__kwdefaults__ must be set to a dict object");
31623         return -1;
31624     }
31625     Py_INCREF(value);
31626     tmp = op->defaults_kwdict;
31627     op->defaults_kwdict = value;
31628     Py_XDECREF(tmp);
31629     return 0;
31630 }
31631 static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31632 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
31633     PyObject* result = op->defaults_kwdict;
31634     if (unlikely(!result)) {
31635         if (op->defaults_getter) {
31636             if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
31637             result = op->defaults_kwdict;
31638         } else {
31639             result = Py_None;
31640         }
31641     }
31642     Py_INCREF(result);
31643     return result;
31644 }
31645 static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)31646 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
31647     PyObject* tmp;
31648     if (!value || value == Py_None) {
31649         value = NULL;
31650     } else if (!PyDict_Check(value)) {
31651         PyErr_SetString(PyExc_TypeError,
31652                         "__annotations__ must be set to a dict object");
31653         return -1;
31654     }
31655     Py_XINCREF(value);
31656     tmp = op->func_annotations;
31657     op->func_annotations = value;
31658     Py_XDECREF(tmp);
31659     return 0;
31660 }
31661 static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)31662 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
31663     PyObject* result = op->func_annotations;
31664     if (unlikely(!result)) {
31665         result = PyDict_New();
31666         if (unlikely(!result)) return NULL;
31667         op->func_annotations = result;
31668     }
31669     Py_INCREF(result);
31670     return result;
31671 }
31672 static PyGetSetDef __pyx_CyFunction_getsets[] = {
31673     {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
31674     {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
31675     {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
31676     {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
31677     {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
31678     {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
31679     {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
31680     {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
31681     {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
31682     {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
31683     {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
31684     {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
31685     {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
31686     {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
31687     {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
31688     {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
31689     {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
31690     {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
31691     {0, 0, 0, 0, 0}
31692 };
31693 static PyMemberDef __pyx_CyFunction_members[] = {
31694     {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
31695     {0, 0, 0,  0, 0}
31696 };
31697 static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject * m,CYTHON_UNUSED PyObject * args)31698 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
31699 {
31700 #if PY_MAJOR_VERSION >= 3
31701     return PyUnicode_FromString(m->func.m_ml->ml_name);
31702 #else
31703     return PyString_FromString(m->func.m_ml->ml_name);
31704 #endif
31705 }
31706 static PyMethodDef __pyx_CyFunction_methods[] = {
31707     {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
31708     {0, 0, 0, 0}
31709 };
31710 #if PY_VERSION_HEX < 0x030500A0
31711 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
31712 #else
31713 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
31714 #endif
__Pyx_CyFunction_Init(__pyx_CyFunctionObject * op,PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)31715 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
31716                                        PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31717     if (unlikely(op == NULL))
31718         return NULL;
31719     op->flags = flags;
31720     __Pyx_CyFunction_weakreflist(op) = NULL;
31721     op->func.m_ml = ml;
31722     op->func.m_self = (PyObject *) op;
31723     Py_XINCREF(closure);
31724     op->func_closure = closure;
31725     Py_XINCREF(module);
31726     op->func.m_module = module;
31727     op->func_dict = NULL;
31728     op->func_name = NULL;
31729     Py_INCREF(qualname);
31730     op->func_qualname = qualname;
31731     op->func_doc = NULL;
31732     op->func_classobj = NULL;
31733     op->func_globals = globals;
31734     Py_INCREF(op->func_globals);
31735     Py_XINCREF(code);
31736     op->func_code = code;
31737     op->defaults_pyobjects = 0;
31738     op->defaults_size = 0;
31739     op->defaults = NULL;
31740     op->defaults_tuple = NULL;
31741     op->defaults_kwdict = NULL;
31742     op->defaults_getter = NULL;
31743     op->func_annotations = NULL;
31744     return (PyObject *) op;
31745 }
31746 static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject * m)31747 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
31748 {
31749     Py_CLEAR(m->func_closure);
31750     Py_CLEAR(m->func.m_module);
31751     Py_CLEAR(m->func_dict);
31752     Py_CLEAR(m->func_name);
31753     Py_CLEAR(m->func_qualname);
31754     Py_CLEAR(m->func_doc);
31755     Py_CLEAR(m->func_globals);
31756     Py_CLEAR(m->func_code);
31757     Py_CLEAR(m->func_classobj);
31758     Py_CLEAR(m->defaults_tuple);
31759     Py_CLEAR(m->defaults_kwdict);
31760     Py_CLEAR(m->func_annotations);
31761     if (m->defaults) {
31762         PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
31763         int i;
31764         for (i = 0; i < m->defaults_pyobjects; i++)
31765             Py_XDECREF(pydefaults[i]);
31766         PyObject_Free(m->defaults);
31767         m->defaults = NULL;
31768     }
31769     return 0;
31770 }
__Pyx__CyFunction_dealloc(__pyx_CyFunctionObject * m)31771 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
31772 {
31773     if (__Pyx_CyFunction_weakreflist(m) != NULL)
31774         PyObject_ClearWeakRefs((PyObject *) m);
31775     __Pyx_CyFunction_clear(m);
31776     PyObject_GC_Del(m);
31777 }
__Pyx_CyFunction_dealloc(__pyx_CyFunctionObject * m)31778 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
31779 {
31780     PyObject_GC_UnTrack(m);
31781     __Pyx__CyFunction_dealloc(m);
31782 }
__Pyx_CyFunction_traverse(__pyx_CyFunctionObject * m,visitproc visit,void * arg)31783 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
31784 {
31785     Py_VISIT(m->func_closure);
31786     Py_VISIT(m->func.m_module);
31787     Py_VISIT(m->func_dict);
31788     Py_VISIT(m->func_name);
31789     Py_VISIT(m->func_qualname);
31790     Py_VISIT(m->func_doc);
31791     Py_VISIT(m->func_globals);
31792     Py_VISIT(m->func_code);
31793     Py_VISIT(m->func_classobj);
31794     Py_VISIT(m->defaults_tuple);
31795     Py_VISIT(m->defaults_kwdict);
31796     if (m->defaults) {
31797         PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
31798         int i;
31799         for (i = 0; i < m->defaults_pyobjects; i++)
31800             Py_VISIT(pydefaults[i]);
31801     }
31802     return 0;
31803 }
__Pyx_CyFunction_descr_get(PyObject * func,PyObject * obj,PyObject * type)31804 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
31805 {
31806 #if PY_MAJOR_VERSION < 3
31807     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31808     if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
31809         Py_INCREF(func);
31810         return func;
31811     }
31812     if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
31813         if (type == NULL)
31814             type = (PyObject *)(Py_TYPE(obj));
31815         return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
31816     }
31817     if (obj == Py_None)
31818         obj = NULL;
31819 #endif
31820     return __Pyx_PyMethod_New(func, obj, type);
31821 }
31822 static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject * op)31823 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
31824 {
31825 #if PY_MAJOR_VERSION >= 3
31826     return PyUnicode_FromFormat("<cyfunction %U at %p>",
31827                                 op->func_qualname, (void *)op);
31828 #else
31829     return PyString_FromFormat("<cyfunction %s at %p>",
31830                                PyString_AsString(op->func_qualname), (void *)op);
31831 #endif
31832 }
__Pyx_CyFunction_CallMethod(PyObject * func,PyObject * self,PyObject * arg,PyObject * kw)31833 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
31834     PyCFunctionObject* f = (PyCFunctionObject*)func;
31835     PyCFunction meth = f->m_ml->ml_meth;
31836     Py_ssize_t size;
31837     switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
31838     case METH_VARARGS:
31839         if (likely(kw == NULL || PyDict_Size(kw) == 0))
31840             return (*meth)(self, arg);
31841         break;
31842     case METH_VARARGS | METH_KEYWORDS:
31843         return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
31844     case METH_NOARGS:
31845         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31846             size = PyTuple_GET_SIZE(arg);
31847             if (likely(size == 0))
31848                 return (*meth)(self, NULL);
31849             PyErr_Format(PyExc_TypeError,
31850                 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
31851                 f->m_ml->ml_name, size);
31852             return NULL;
31853         }
31854         break;
31855     case METH_O:
31856         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31857             size = PyTuple_GET_SIZE(arg);
31858             if (likely(size == 1)) {
31859                 PyObject *result, *arg0;
31860                 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31861                 arg0 = PyTuple_GET_ITEM(arg, 0);
31862                 #else
31863                 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
31864                 #endif
31865                 result = (*meth)(self, arg0);
31866                 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
31867                 Py_DECREF(arg0);
31868                 #endif
31869                 return result;
31870             }
31871             PyErr_Format(PyExc_TypeError,
31872                 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
31873                 f->m_ml->ml_name, size);
31874             return NULL;
31875         }
31876         break;
31877     default:
31878         PyErr_SetString(PyExc_SystemError, "Bad call flags in "
31879                         "__Pyx_CyFunction_Call. METH_OLDARGS is no "
31880                         "longer supported!");
31881         return NULL;
31882     }
31883     PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
31884                  f->m_ml->ml_name);
31885     return NULL;
31886 }
__Pyx_CyFunction_Call(PyObject * func,PyObject * arg,PyObject * kw)31887 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
31888     return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
31889 }
__Pyx_CyFunction_CallAsMethod(PyObject * func,PyObject * args,PyObject * kw)31890 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
31891     PyObject *result;
31892     __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
31893     if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
31894         Py_ssize_t argc;
31895         PyObject *new_args;
31896         PyObject *self;
31897         argc = PyTuple_GET_SIZE(args);
31898         new_args = PyTuple_GetSlice(args, 1, argc);
31899         if (unlikely(!new_args))
31900             return NULL;
31901         self = PyTuple_GetItem(args, 0);
31902         if (unlikely(!self)) {
31903             Py_DECREF(new_args);
31904             return NULL;
31905         }
31906         result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
31907         Py_DECREF(new_args);
31908     } else {
31909         result = __Pyx_CyFunction_Call(func, args, kw);
31910     }
31911     return result;
31912 }
31913 static PyTypeObject __pyx_CyFunctionType_type = {
31914     PyVarObject_HEAD_INIT(0, 0)
31915     "cython_function_or_method",
31916     sizeof(__pyx_CyFunctionObject),
31917     0,
31918     (destructor) __Pyx_CyFunction_dealloc,
31919     0,
31920     0,
31921     0,
31922 #if PY_MAJOR_VERSION < 3
31923     0,
31924 #else
31925     0,
31926 #endif
31927     (reprfunc) __Pyx_CyFunction_repr,
31928     0,
31929     0,
31930     0,
31931     0,
31932     __Pyx_CyFunction_CallAsMethod,
31933     0,
31934     0,
31935     0,
31936     0,
31937     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
31938     0,
31939     (traverseproc) __Pyx_CyFunction_traverse,
31940     (inquiry) __Pyx_CyFunction_clear,
31941     0,
31942 #if PY_VERSION_HEX < 0x030500A0
31943     offsetof(__pyx_CyFunctionObject, func_weakreflist),
31944 #else
31945     offsetof(PyCFunctionObject, m_weakreflist),
31946 #endif
31947     0,
31948     0,
31949     __pyx_CyFunction_methods,
31950     __pyx_CyFunction_members,
31951     __pyx_CyFunction_getsets,
31952     0,
31953     0,
31954     __Pyx_CyFunction_descr_get,
31955     0,
31956     offsetof(__pyx_CyFunctionObject, func_dict),
31957     0,
31958     0,
31959     0,
31960     0,
31961     0,
31962     0,
31963     0,
31964     0,
31965     0,
31966     0,
31967     0,
31968     0,
31969 #if PY_VERSION_HEX >= 0x030400a1
31970     0,
31971 #endif
31972 #if PY_VERSION_HEX >= 0x030800b1
31973     0,
31974 #endif
31975 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31976     0,
31977 #endif
31978 };
__pyx_CyFunction_init(void)31979 static int __pyx_CyFunction_init(void) {
31980     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
31981     if (unlikely(__pyx_CyFunctionType == NULL)) {
31982         return -1;
31983     }
31984     return 0;
31985 }
__Pyx_CyFunction_InitDefaults(PyObject * func,size_t size,int pyobjects)31986 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
31987     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31988     m->defaults = PyObject_Malloc(size);
31989     if (unlikely(!m->defaults))
31990         return PyErr_NoMemory();
31991     memset(m->defaults, 0, size);
31992     m->defaults_pyobjects = pyobjects;
31993     m->defaults_size = size;
31994     return m->defaults;
31995 }
__Pyx_CyFunction_SetDefaultsTuple(PyObject * func,PyObject * tuple)31996 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
31997     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31998     m->defaults_tuple = tuple;
31999     Py_INCREF(tuple);
32000 }
__Pyx_CyFunction_SetDefaultsKwDict(PyObject * func,PyObject * dict)32001 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
32002     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32003     m->defaults_kwdict = dict;
32004     Py_INCREF(dict);
32005 }
__Pyx_CyFunction_SetAnnotationsDict(PyObject * func,PyObject * dict)32006 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
32007     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32008     m->func_annotations = dict;
32009     Py_INCREF(dict);
32010 }
32011 
32012 /* FusedFunction */
32013 static PyObject *
__pyx_FusedFunction_New(PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)32014 __pyx_FusedFunction_New(PyMethodDef *ml, int flags,
32015                         PyObject *qualname, PyObject *closure,
32016                         PyObject *module, PyObject *globals,
32017                         PyObject *code)
32018 {
32019     PyObject *op = __Pyx_CyFunction_Init(
32020         PyObject_GC_New(__pyx_CyFunctionObject, __pyx_FusedFunctionType),
32021         ml, flags, qualname, closure, module, globals, code
32022     );
32023     if (likely(op)) {
32024         __pyx_FusedFunctionObject *fusedfunc = (__pyx_FusedFunctionObject *) op;
32025         fusedfunc->__signatures__ = NULL;
32026         fusedfunc->type = NULL;
32027         fusedfunc->self = NULL;
32028         PyObject_GC_Track(op);
32029     }
32030     return op;
32031 }
32032 static void
__pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject * self)32033 __pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject *self)
32034 {
32035     PyObject_GC_UnTrack(self);
32036     Py_CLEAR(self->self);
32037     Py_CLEAR(self->type);
32038     Py_CLEAR(self->__signatures__);
32039     __Pyx__CyFunction_dealloc((__pyx_CyFunctionObject *) self);
32040 }
32041 static int
__pyx_FusedFunction_traverse(__pyx_FusedFunctionObject * self,visitproc visit,void * arg)32042 __pyx_FusedFunction_traverse(__pyx_FusedFunctionObject *self,
32043                              visitproc visit,
32044                              void *arg)
32045 {
32046     Py_VISIT(self->self);
32047     Py_VISIT(self->type);
32048     Py_VISIT(self->__signatures__);
32049     return __Pyx_CyFunction_traverse((__pyx_CyFunctionObject *) self, visit, arg);
32050 }
32051 static int
__pyx_FusedFunction_clear(__pyx_FusedFunctionObject * self)32052 __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self)
32053 {
32054     Py_CLEAR(self->self);
32055     Py_CLEAR(self->type);
32056     Py_CLEAR(self->__signatures__);
32057     return __Pyx_CyFunction_clear((__pyx_CyFunctionObject *) self);
32058 }
32059 static PyObject *
__pyx_FusedFunction_descr_get(PyObject * self,PyObject * obj,PyObject * type)32060 __pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
32061 {
32062     __pyx_FusedFunctionObject *func, *meth;
32063     func = (__pyx_FusedFunctionObject *) self;
32064     if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) {
32065         Py_INCREF(self);
32066         return self;
32067     }
32068     if (obj == Py_None)
32069         obj = NULL;
32070     meth = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_New(
32071                     ((PyCFunctionObject *) func)->m_ml,
32072                     ((__pyx_CyFunctionObject *) func)->flags,
32073                     ((__pyx_CyFunctionObject *) func)->func_qualname,
32074                     ((__pyx_CyFunctionObject *) func)->func_closure,
32075                     ((PyCFunctionObject *) func)->m_module,
32076                     ((__pyx_CyFunctionObject *) func)->func_globals,
32077                     ((__pyx_CyFunctionObject *) func)->func_code);
32078     if (!meth)
32079         return NULL;
32080     if (func->func.defaults) {
32081         PyObject **pydefaults;
32082         int i;
32083         if (!__Pyx_CyFunction_InitDefaults((PyObject*)meth,
32084                                       func->func.defaults_size,
32085                                       func->func.defaults_pyobjects)) {
32086             Py_XDECREF((PyObject*)meth);
32087             return NULL;
32088         }
32089         memcpy(meth->func.defaults, func->func.defaults, func->func.defaults_size);
32090         pydefaults = __Pyx_CyFunction_Defaults(PyObject *, meth);
32091         for (i = 0; i < meth->func.defaults_pyobjects; i++)
32092             Py_XINCREF(pydefaults[i]);
32093     }
32094     Py_XINCREF(func->func.func_classobj);
32095     meth->func.func_classobj = func->func.func_classobj;
32096     Py_XINCREF(func->__signatures__);
32097     meth->__signatures__ = func->__signatures__;
32098     Py_XINCREF(type);
32099     meth->type = type;
32100     Py_XINCREF(func->func.defaults_tuple);
32101     meth->func.defaults_tuple = func->func.defaults_tuple;
32102     if (func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD)
32103         obj = type;
32104     Py_XINCREF(obj);
32105     meth->self = obj;
32106     return (PyObject *) meth;
32107 }
32108 static PyObject *
_obj_to_str(PyObject * obj)32109 _obj_to_str(PyObject *obj)
32110 {
32111     if (PyType_Check(obj))
32112         return PyObject_GetAttr(obj, __pyx_n_s_name_2);
32113     else
32114         return PyObject_Str(obj);
32115 }
32116 static PyObject *
__pyx_FusedFunction_getitem(__pyx_FusedFunctionObject * self,PyObject * idx)32117 __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
32118 {
32119     PyObject *signature = NULL;
32120     PyObject *unbound_result_func;
32121     PyObject *result_func = NULL;
32122     if (self->__signatures__ == NULL) {
32123         PyErr_SetString(PyExc_TypeError, "Function is not fused");
32124         return NULL;
32125     }
32126     if (PyTuple_Check(idx)) {
32127         PyObject *list = PyList_New(0);
32128         Py_ssize_t n = PyTuple_GET_SIZE(idx);
32129         PyObject *sep = NULL;
32130         int i;
32131         if (unlikely(!list))
32132             return NULL;
32133         for (i = 0; i < n; i++) {
32134             int ret;
32135             PyObject *string;
32136 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32137             PyObject *item = PyTuple_GET_ITEM(idx, i);
32138 #else
32139             PyObject *item = PySequence_ITEM(idx, i);  if (unlikely(!item)) goto __pyx_err;
32140 #endif
32141             string = _obj_to_str(item);
32142 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32143             Py_DECREF(item);
32144 #endif
32145             if (unlikely(!string)) goto __pyx_err;
32146             ret = PyList_Append(list, string);
32147             Py_DECREF(string);
32148             if (unlikely(ret < 0)) goto __pyx_err;
32149         }
32150         sep = PyUnicode_FromString("|");
32151         if (likely(sep))
32152             signature = PyUnicode_Join(sep, list);
32153 __pyx_err:
32154 ;
32155         Py_DECREF(list);
32156         Py_XDECREF(sep);
32157     } else {
32158         signature = _obj_to_str(idx);
32159     }
32160     if (!signature)
32161         return NULL;
32162     unbound_result_func = PyObject_GetItem(self->__signatures__, signature);
32163     if (unbound_result_func) {
32164         if (self->self || self->type) {
32165             __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func;
32166             Py_CLEAR(unbound->func.func_classobj);
32167             Py_XINCREF(self->func.func_classobj);
32168             unbound->func.func_classobj = self->func.func_classobj;
32169             result_func = __pyx_FusedFunction_descr_get(unbound_result_func,
32170                                                         self->self, self->type);
32171         } else {
32172             result_func = unbound_result_func;
32173             Py_INCREF(result_func);
32174         }
32175     }
32176     Py_DECREF(signature);
32177     Py_XDECREF(unbound_result_func);
32178     return result_func;
32179 }
32180 static PyObject *
__pyx_FusedFunction_callfunction(PyObject * func,PyObject * args,PyObject * kw)32181 __pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw)
32182 {
32183      __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
32184     int static_specialized = (cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD &&
32185                               !((__pyx_FusedFunctionObject *) func)->__signatures__);
32186     if (cyfunc->flags & __Pyx_CYFUNCTION_CCLASS && !static_specialized) {
32187         return __Pyx_CyFunction_CallAsMethod(func, args, kw);
32188     } else {
32189         return __Pyx_CyFunction_Call(func, args, kw);
32190     }
32191 }
32192 static PyObject *
__pyx_FusedFunction_call(PyObject * func,PyObject * args,PyObject * kw)32193 __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
32194 {
32195     __pyx_FusedFunctionObject *binding_func = (__pyx_FusedFunctionObject *) func;
32196     Py_ssize_t argc = PyTuple_GET_SIZE(args);
32197     PyObject *new_args = NULL;
32198     __pyx_FusedFunctionObject *new_func = NULL;
32199     PyObject *result = NULL;
32200     PyObject *self = NULL;
32201     int is_staticmethod = binding_func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD;
32202     int is_classmethod = binding_func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD;
32203     if (binding_func->self) {
32204         Py_ssize_t i;
32205         new_args = PyTuple_New(argc + 1);
32206         if (!new_args)
32207             return NULL;
32208         self = binding_func->self;
32209 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32210         Py_INCREF(self);
32211 #endif
32212         Py_INCREF(self);
32213         PyTuple_SET_ITEM(new_args, 0, self);
32214         for (i = 0; i < argc; i++) {
32215 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32216             PyObject *item = PyTuple_GET_ITEM(args, i);
32217             Py_INCREF(item);
32218 #else
32219             PyObject *item = PySequence_ITEM(args, i);  if (unlikely(!item)) goto bad;
32220 #endif
32221             PyTuple_SET_ITEM(new_args, i + 1, item);
32222         }
32223         args = new_args;
32224     } else if (binding_func->type) {
32225         if (argc < 1) {
32226             PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given.");
32227             return NULL;
32228         }
32229 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32230         self = PyTuple_GET_ITEM(args, 0);
32231 #else
32232         self = PySequence_ITEM(args, 0);  if (unlikely(!self)) return NULL;
32233 #endif
32234     }
32235     if (self && !is_classmethod && !is_staticmethod) {
32236         int is_instance = PyObject_IsInstance(self, binding_func->type);
32237         if (unlikely(!is_instance)) {
32238             PyErr_Format(PyExc_TypeError,
32239                          "First argument should be of type %.200s, got %.200s.",
32240                          ((PyTypeObject *) binding_func->type)->tp_name,
32241                          self->ob_type->tp_name);
32242             goto bad;
32243         } else if (unlikely(is_instance == -1)) {
32244             goto bad;
32245         }
32246     }
32247 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32248     Py_XDECREF(self);
32249     self = NULL;
32250 #endif
32251     if (binding_func->__signatures__) {
32252         PyObject *tup;
32253         if (is_staticmethod && binding_func->func.flags & __Pyx_CYFUNCTION_CCLASS) {
32254             tup = PyTuple_Pack(3, args,
32255                                kw == NULL ? Py_None : kw,
32256                                binding_func->func.defaults_tuple);
32257             if (unlikely(!tup)) goto bad;
32258             new_func = (__pyx_FusedFunctionObject *) __Pyx_CyFunction_CallMethod(
32259                 func, binding_func->__signatures__, tup, NULL);
32260         } else {
32261             tup = PyTuple_Pack(4, binding_func->__signatures__, args,
32262                                kw == NULL ? Py_None : kw,
32263                                binding_func->func.defaults_tuple);
32264             if (unlikely(!tup)) goto bad;
32265             new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL);
32266         }
32267         Py_DECREF(tup);
32268         if (unlikely(!new_func))
32269             goto bad;
32270         Py_XINCREF(binding_func->func.func_classobj);
32271         Py_CLEAR(new_func->func.func_classobj);
32272         new_func->func.func_classobj = binding_func->func.func_classobj;
32273         func = (PyObject *) new_func;
32274     }
32275     result = __pyx_FusedFunction_callfunction(func, args, kw);
32276 bad:
32277 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32278     Py_XDECREF(self);
32279 #endif
32280     Py_XDECREF(new_args);
32281     Py_XDECREF((PyObject *) new_func);
32282     return result;
32283 }
32284 static PyMemberDef __pyx_FusedFunction_members[] = {
32285     {(char *) "__signatures__",
32286      T_OBJECT,
32287      offsetof(__pyx_FusedFunctionObject, __signatures__),
32288      READONLY,
32289      0},
32290     {0, 0, 0, 0, 0},
32291 };
32292 static PyMappingMethods __pyx_FusedFunction_mapping_methods = {
32293     0,
32294     (binaryfunc) __pyx_FusedFunction_getitem,
32295     0,
32296 };
32297 static PyTypeObject __pyx_FusedFunctionType_type = {
32298     PyVarObject_HEAD_INIT(0, 0)
32299     "fused_cython_function",
32300     sizeof(__pyx_FusedFunctionObject),
32301     0,
32302     (destructor) __pyx_FusedFunction_dealloc,
32303     0,
32304     0,
32305     0,
32306 #if PY_MAJOR_VERSION < 3
32307     0,
32308 #else
32309     0,
32310 #endif
32311     0,
32312     0,
32313     0,
32314     &__pyx_FusedFunction_mapping_methods,
32315     0,
32316     (ternaryfunc) __pyx_FusedFunction_call,
32317     0,
32318     0,
32319     0,
32320     0,
32321     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
32322     0,
32323     (traverseproc) __pyx_FusedFunction_traverse,
32324     (inquiry) __pyx_FusedFunction_clear,
32325     0,
32326     0,
32327     0,
32328     0,
32329     0,
32330     __pyx_FusedFunction_members,
32331     __pyx_CyFunction_getsets,
32332     &__pyx_CyFunctionType_type,
32333     0,
32334     __pyx_FusedFunction_descr_get,
32335     0,
32336     0,
32337     0,
32338     0,
32339     0,
32340     0,
32341     0,
32342     0,
32343     0,
32344     0,
32345     0,
32346     0,
32347     0,
32348     0,
32349 #if PY_VERSION_HEX >= 0x030400a1
32350     0,
32351 #endif
32352 #if PY_VERSION_HEX >= 0x030800b1
32353     0,
32354 #endif
32355 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
32356     0,
32357 #endif
32358 };
__pyx_FusedFunction_init(void)32359 static int __pyx_FusedFunction_init(void) {
32360     __pyx_FusedFunctionType_type.tp_base = __pyx_CyFunctionType;
32361     __pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type);
32362     if (__pyx_FusedFunctionType == NULL) {
32363         return -1;
32364     }
32365     return 0;
32366 }
32367 
32368 /* CLineInTraceback */
32369 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)32370 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
32371     PyObject *use_cline;
32372     PyObject *ptype, *pvalue, *ptraceback;
32373 #if CYTHON_COMPILING_IN_CPYTHON
32374     PyObject **cython_runtime_dict;
32375 #endif
32376     if (unlikely(!__pyx_cython_runtime)) {
32377         return c_line;
32378     }
32379     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
32380 #if CYTHON_COMPILING_IN_CPYTHON
32381     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
32382     if (likely(cython_runtime_dict)) {
32383         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
32384             use_cline, *cython_runtime_dict,
32385             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
32386     } else
32387 #endif
32388     {
32389       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
32390       if (use_cline_obj) {
32391         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
32392         Py_DECREF(use_cline_obj);
32393       } else {
32394         PyErr_Clear();
32395         use_cline = NULL;
32396       }
32397     }
32398     if (!use_cline) {
32399         c_line = 0;
32400         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
32401     }
32402     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
32403         c_line = 0;
32404     }
32405     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
32406     return c_line;
32407 }
32408 #endif
32409 
32410 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)32411 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
32412     int start = 0, mid = 0, end = count - 1;
32413     if (end >= 0 && code_line > entries[end].code_line) {
32414         return count;
32415     }
32416     while (start < end) {
32417         mid = start + (end - start) / 2;
32418         if (code_line < entries[mid].code_line) {
32419             end = mid;
32420         } else if (code_line > entries[mid].code_line) {
32421              start = mid + 1;
32422         } else {
32423             return mid;
32424         }
32425     }
32426     if (code_line <= entries[mid].code_line) {
32427         return mid;
32428     } else {
32429         return mid + 1;
32430     }
32431 }
__pyx_find_code_object(int code_line)32432 static PyCodeObject *__pyx_find_code_object(int code_line) {
32433     PyCodeObject* code_object;
32434     int pos;
32435     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
32436         return NULL;
32437     }
32438     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
32439     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
32440         return NULL;
32441     }
32442     code_object = __pyx_code_cache.entries[pos].code_object;
32443     Py_INCREF(code_object);
32444     return code_object;
32445 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)32446 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
32447     int pos, i;
32448     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
32449     if (unlikely(!code_line)) {
32450         return;
32451     }
32452     if (unlikely(!entries)) {
32453         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
32454         if (likely(entries)) {
32455             __pyx_code_cache.entries = entries;
32456             __pyx_code_cache.max_count = 64;
32457             __pyx_code_cache.count = 1;
32458             entries[0].code_line = code_line;
32459             entries[0].code_object = code_object;
32460             Py_INCREF(code_object);
32461         }
32462         return;
32463     }
32464     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
32465     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
32466         PyCodeObject* tmp = entries[pos].code_object;
32467         entries[pos].code_object = code_object;
32468         Py_DECREF(tmp);
32469         return;
32470     }
32471     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
32472         int new_max = __pyx_code_cache.max_count + 64;
32473         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
32474             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
32475         if (unlikely(!entries)) {
32476             return;
32477         }
32478         __pyx_code_cache.entries = entries;
32479         __pyx_code_cache.max_count = new_max;
32480     }
32481     for (i=__pyx_code_cache.count; i>pos; i--) {
32482         entries[i] = entries[i-1];
32483     }
32484     entries[pos].code_line = code_line;
32485     entries[pos].code_object = code_object;
32486     __pyx_code_cache.count++;
32487     Py_INCREF(code_object);
32488 }
32489 
32490 /* AddTraceback */
32491 #include "compile.h"
32492 #include "frameobject.h"
32493 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)32494 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
32495             const char *funcname, int c_line,
32496             int py_line, const char *filename) {
32497     PyCodeObject *py_code = 0;
32498     PyObject *py_srcfile = 0;
32499     PyObject *py_funcname = 0;
32500     #if PY_MAJOR_VERSION < 3
32501     py_srcfile = PyString_FromString(filename);
32502     #else
32503     py_srcfile = PyUnicode_FromString(filename);
32504     #endif
32505     if (!py_srcfile) goto bad;
32506     if (c_line) {
32507         #if PY_MAJOR_VERSION < 3
32508         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
32509         #else
32510         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
32511         #endif
32512     }
32513     else {
32514         #if PY_MAJOR_VERSION < 3
32515         py_funcname = PyString_FromString(funcname);
32516         #else
32517         py_funcname = PyUnicode_FromString(funcname);
32518         #endif
32519     }
32520     if (!py_funcname) goto bad;
32521     py_code = __Pyx_PyCode_New(
32522         0,
32523         0,
32524         0,
32525         0,
32526         0,
32527         __pyx_empty_bytes, /*PyObject *code,*/
32528         __pyx_empty_tuple, /*PyObject *consts,*/
32529         __pyx_empty_tuple, /*PyObject *names,*/
32530         __pyx_empty_tuple, /*PyObject *varnames,*/
32531         __pyx_empty_tuple, /*PyObject *freevars,*/
32532         __pyx_empty_tuple, /*PyObject *cellvars,*/
32533         py_srcfile,   /*PyObject *filename,*/
32534         py_funcname,  /*PyObject *name,*/
32535         py_line,
32536         __pyx_empty_bytes  /*PyObject *lnotab*/
32537     );
32538     Py_DECREF(py_srcfile);
32539     Py_DECREF(py_funcname);
32540     return py_code;
32541 bad:
32542     Py_XDECREF(py_srcfile);
32543     Py_XDECREF(py_funcname);
32544     return NULL;
32545 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)32546 static void __Pyx_AddTraceback(const char *funcname, int c_line,
32547                                int py_line, const char *filename) {
32548     PyCodeObject *py_code = 0;
32549     PyFrameObject *py_frame = 0;
32550     PyThreadState *tstate = __Pyx_PyThreadState_Current;
32551     if (c_line) {
32552         c_line = __Pyx_CLineForTraceback(tstate, c_line);
32553     }
32554     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
32555     if (!py_code) {
32556         py_code = __Pyx_CreateCodeObjectForTraceback(
32557             funcname, c_line, py_line, filename);
32558         if (!py_code) goto bad;
32559         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
32560     }
32561     py_frame = PyFrame_New(
32562         tstate,            /*PyThreadState *tstate,*/
32563         py_code,           /*PyCodeObject *code,*/
32564         __pyx_d,    /*PyObject *globals,*/
32565         0                  /*PyObject *locals*/
32566     );
32567     if (!py_frame) goto bad;
32568     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
32569     PyTraceBack_Here(py_frame);
32570 bad:
32571     Py_XDECREF(py_code);
32572     Py_XDECREF(py_frame);
32573 }
32574 
32575 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)32576 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
32577     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
32578         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
32579         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
32580     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
32581     return -1;
32582 }
__Pyx_ReleaseBuffer(Py_buffer * view)32583 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
32584     PyObject *obj = view->obj;
32585     if (!obj) return;
32586     if (PyObject_CheckBuffer(obj)) {
32587         PyBuffer_Release(view);
32588         return;
32589     }
32590     if ((0)) {}
32591     view->obj = NULL;
32592     Py_DECREF(obj);
32593 }
32594 #endif
32595 
32596 
32597 /* MemviewSliceIsContig */
32598 static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)32599 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
32600 {
32601     int i, index, step, start;
32602     Py_ssize_t itemsize = mvs.memview->view.itemsize;
32603     if (order == 'F') {
32604         step = 1;
32605         start = 0;
32606     } else {
32607         step = -1;
32608         start = ndim - 1;
32609     }
32610     for (i = 0; i < ndim; i++) {
32611         index = start + step * i;
32612         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
32613             return 0;
32614         itemsize *= mvs.shape[index];
32615     }
32616     return 1;
32617 }
32618 
32619 /* OverlappingSlices */
32620 static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)32621 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
32622                                void **out_start, void **out_end,
32623                                int ndim, size_t itemsize)
32624 {
32625     char *start, *end;
32626     int i;
32627     start = end = slice->data;
32628     for (i = 0; i < ndim; i++) {
32629         Py_ssize_t stride = slice->strides[i];
32630         Py_ssize_t extent = slice->shape[i];
32631         if (extent == 0) {
32632             *out_start = *out_end = start;
32633             return;
32634         } else {
32635             if (stride > 0)
32636                 end += stride * (extent - 1);
32637             else
32638                 start += stride * (extent - 1);
32639         }
32640     }
32641     *out_start = start;
32642     *out_end = end + itemsize;
32643 }
32644 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)32645 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
32646                      __Pyx_memviewslice *slice2,
32647                      int ndim, size_t itemsize)
32648 {
32649     void *start1, *end1, *start2, *end2;
32650     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
32651     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
32652     return (start1 < end2) && (start2 < end1);
32653 }
32654 
32655 /* Capsule */
32656 static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)32657 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
32658 {
32659     PyObject *cobj;
32660 #if PY_VERSION_HEX >= 0x02070000
32661     cobj = PyCapsule_New(p, sig, NULL);
32662 #else
32663     cobj = PyCObject_FromVoidPtr(p, NULL);
32664 #endif
32665     return cobj;
32666 }
32667 
32668 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)32669 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
32670 {
32671   union {
32672     uint32_t u32;
32673     uint8_t u8[4];
32674   } S;
32675   S.u32 = 0x01020304;
32676   return S.u8[0] == 4;
32677 }
32678 
32679 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)32680 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
32681                               __Pyx_BufFmt_StackElem* stack,
32682                               __Pyx_TypeInfo* type) {
32683   stack[0].field = &ctx->root;
32684   stack[0].parent_offset = 0;
32685   ctx->root.type = type;
32686   ctx->root.name = "buffer dtype";
32687   ctx->root.offset = 0;
32688   ctx->head = stack;
32689   ctx->head->field = &ctx->root;
32690   ctx->fmt_offset = 0;
32691   ctx->head->parent_offset = 0;
32692   ctx->new_packmode = '@';
32693   ctx->enc_packmode = '@';
32694   ctx->new_count = 1;
32695   ctx->enc_count = 0;
32696   ctx->enc_type = 0;
32697   ctx->is_complex = 0;
32698   ctx->is_valid_array = 0;
32699   ctx->struct_alignment = 0;
32700   while (type->typegroup == 'S') {
32701     ++ctx->head;
32702     ctx->head->field = type->fields;
32703     ctx->head->parent_offset = 0;
32704     type = type->fields->type;
32705   }
32706 }
__Pyx_BufFmt_ParseNumber(const char ** ts)32707 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
32708     int count;
32709     const char* t = *ts;
32710     if (*t < '0' || *t > '9') {
32711       return -1;
32712     } else {
32713         count = *t++ - '0';
32714         while (*t >= '0' && *t <= '9') {
32715             count *= 10;
32716             count += *t++ - '0';
32717         }
32718     }
32719     *ts = t;
32720     return count;
32721 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)32722 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
32723     int number = __Pyx_BufFmt_ParseNumber(ts);
32724     if (number == -1)
32725         PyErr_Format(PyExc_ValueError,\
32726                      "Does not understand character buffer dtype format string ('%c')", **ts);
32727     return number;
32728 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)32729 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
32730   PyErr_Format(PyExc_ValueError,
32731                "Unexpected format string character: '%c'", ch);
32732 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)32733 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
32734   switch (ch) {
32735     case '?': return "'bool'";
32736     case 'c': return "'char'";
32737     case 'b': return "'signed char'";
32738     case 'B': return "'unsigned char'";
32739     case 'h': return "'short'";
32740     case 'H': return "'unsigned short'";
32741     case 'i': return "'int'";
32742     case 'I': return "'unsigned int'";
32743     case 'l': return "'long'";
32744     case 'L': return "'unsigned long'";
32745     case 'q': return "'long long'";
32746     case 'Q': return "'unsigned long long'";
32747     case 'f': return (is_complex ? "'complex float'" : "'float'");
32748     case 'd': return (is_complex ? "'complex double'" : "'double'");
32749     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
32750     case 'T': return "a struct";
32751     case 'O': return "Python object";
32752     case 'P': return "a pointer";
32753     case 's': case 'p': return "a string";
32754     case 0: return "end";
32755     default: return "unparseable format string";
32756   }
32757 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)32758 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
32759   switch (ch) {
32760     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32761     case 'h': case 'H': return 2;
32762     case 'i': case 'I': case 'l': case 'L': return 4;
32763     case 'q': case 'Q': return 8;
32764     case 'f': return (is_complex ? 8 : 4);
32765     case 'd': return (is_complex ? 16 : 8);
32766     case 'g': {
32767       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
32768       return 0;
32769     }
32770     case 'O': case 'P': return sizeof(void*);
32771     default:
32772       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32773       return 0;
32774     }
32775 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)32776 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
32777   switch (ch) {
32778     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32779     case 'h': case 'H': return sizeof(short);
32780     case 'i': case 'I': return sizeof(int);
32781     case 'l': case 'L': return sizeof(long);
32782     #ifdef HAVE_LONG_LONG
32783     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
32784     #endif
32785     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
32786     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
32787     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
32788     case 'O': case 'P': return sizeof(void*);
32789     default: {
32790       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32791       return 0;
32792     }
32793   }
32794 }
32795 typedef struct { char c; short x; } __Pyx_st_short;
32796 typedef struct { char c; int x; } __Pyx_st_int;
32797 typedef struct { char c; long x; } __Pyx_st_long;
32798 typedef struct { char c; float x; } __Pyx_st_float;
32799 typedef struct { char c; double x; } __Pyx_st_double;
32800 typedef struct { char c; long double x; } __Pyx_st_longdouble;
32801 typedef struct { char c; void *x; } __Pyx_st_void_p;
32802 #ifdef HAVE_LONG_LONG
32803 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
32804 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)32805 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
32806   switch (ch) {
32807     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32808     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
32809     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
32810     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
32811 #ifdef HAVE_LONG_LONG
32812     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
32813 #endif
32814     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
32815     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
32816     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
32817     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
32818     default:
32819       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32820       return 0;
32821     }
32822 }
32823 /* These are for computing the padding at the end of the struct to align
32824    on the first member of the struct. This will probably the same as above,
32825    but we don't have any guarantees.
32826  */
32827 typedef struct { short x; char c; } __Pyx_pad_short;
32828 typedef struct { int x; char c; } __Pyx_pad_int;
32829 typedef struct { long x; char c; } __Pyx_pad_long;
32830 typedef struct { float x; char c; } __Pyx_pad_float;
32831 typedef struct { double x; char c; } __Pyx_pad_double;
32832 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
32833 typedef struct { void *x; char c; } __Pyx_pad_void_p;
32834 #ifdef HAVE_LONG_LONG
32835 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
32836 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)32837 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
32838   switch (ch) {
32839     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32840     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
32841     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
32842     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
32843 #ifdef HAVE_LONG_LONG
32844     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
32845 #endif
32846     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
32847     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
32848     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
32849     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
32850     default:
32851       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32852       return 0;
32853     }
32854 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)32855 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
32856   switch (ch) {
32857     case 'c':
32858         return 'H';
32859     case 'b': case 'h': case 'i':
32860     case 'l': case 'q': case 's': case 'p':
32861         return 'I';
32862     case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
32863         return 'U';
32864     case 'f': case 'd': case 'g':
32865         return (is_complex ? 'C' : 'R');
32866     case 'O':
32867         return 'O';
32868     case 'P':
32869         return 'P';
32870     default: {
32871       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32872       return 0;
32873     }
32874   }
32875 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)32876 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
32877   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
32878     const char* expected;
32879     const char* quote;
32880     if (ctx->head == NULL) {
32881       expected = "end";
32882       quote = "";
32883     } else {
32884       expected = ctx->head->field->type->name;
32885       quote = "'";
32886     }
32887     PyErr_Format(PyExc_ValueError,
32888                  "Buffer dtype mismatch, expected %s%s%s but got %s",
32889                  quote, expected, quote,
32890                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
32891   } else {
32892     __Pyx_StructField* field = ctx->head->field;
32893     __Pyx_StructField* parent = (ctx->head - 1)->field;
32894     PyErr_Format(PyExc_ValueError,
32895                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
32896                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
32897                  parent->type->name, field->name);
32898   }
32899 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)32900 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
32901   char group;
32902   size_t size, offset, arraysize = 1;
32903   if (ctx->enc_type == 0) return 0;
32904   if (ctx->head->field->type->arraysize[0]) {
32905     int i, ndim = 0;
32906     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
32907         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
32908         ndim = 1;
32909         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
32910             PyErr_Format(PyExc_ValueError,
32911                          "Expected a dimension of size %zu, got %zu",
32912                          ctx->head->field->type->arraysize[0], ctx->enc_count);
32913             return -1;
32914         }
32915     }
32916     if (!ctx->is_valid_array) {
32917       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
32918                    ctx->head->field->type->ndim, ndim);
32919       return -1;
32920     }
32921     for (i = 0; i < ctx->head->field->type->ndim; i++) {
32922       arraysize *= ctx->head->field->type->arraysize[i];
32923     }
32924     ctx->is_valid_array = 0;
32925     ctx->enc_count = 1;
32926   }
32927   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
32928   do {
32929     __Pyx_StructField* field = ctx->head->field;
32930     __Pyx_TypeInfo* type = field->type;
32931     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
32932       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
32933     } else {
32934       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
32935     }
32936     if (ctx->enc_packmode == '@') {
32937       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
32938       size_t align_mod_offset;
32939       if (align_at == 0) return -1;
32940       align_mod_offset = ctx->fmt_offset % align_at;
32941       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
32942       if (ctx->struct_alignment == 0)
32943           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
32944                                                                  ctx->is_complex);
32945     }
32946     if (type->size != size || type->typegroup != group) {
32947       if (type->typegroup == 'C' && type->fields != NULL) {
32948         size_t parent_offset = ctx->head->parent_offset + field->offset;
32949         ++ctx->head;
32950         ctx->head->field = type->fields;
32951         ctx->head->parent_offset = parent_offset;
32952         continue;
32953       }
32954       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
32955       } else {
32956           __Pyx_BufFmt_RaiseExpected(ctx);
32957           return -1;
32958       }
32959     }
32960     offset = ctx->head->parent_offset + field->offset;
32961     if (ctx->fmt_offset != offset) {
32962       PyErr_Format(PyExc_ValueError,
32963                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
32964                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
32965       return -1;
32966     }
32967     ctx->fmt_offset += size;
32968     if (arraysize)
32969       ctx->fmt_offset += (arraysize - 1) * size;
32970     --ctx->enc_count;
32971     while (1) {
32972       if (field == &ctx->root) {
32973         ctx->head = NULL;
32974         if (ctx->enc_count != 0) {
32975           __Pyx_BufFmt_RaiseExpected(ctx);
32976           return -1;
32977         }
32978         break;
32979       }
32980       ctx->head->field = ++field;
32981       if (field->type == NULL) {
32982         --ctx->head;
32983         field = ctx->head->field;
32984         continue;
32985       } else if (field->type->typegroup == 'S') {
32986         size_t parent_offset = ctx->head->parent_offset + field->offset;
32987         if (field->type->fields->type == NULL) continue;
32988         field = field->type->fields;
32989         ++ctx->head;
32990         ctx->head->field = field;
32991         ctx->head->parent_offset = parent_offset;
32992         break;
32993       } else {
32994         break;
32995       }
32996     }
32997   } while (ctx->enc_count);
32998   ctx->enc_type = 0;
32999   ctx->is_complex = 0;
33000   return 0;
33001 }
33002 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)33003 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
33004 {
33005     const char *ts = *tsp;
33006     int i = 0, number, ndim;
33007     ++ts;
33008     if (ctx->new_count != 1) {
33009         PyErr_SetString(PyExc_ValueError,
33010                         "Cannot handle repeated arrays in format string");
33011         return NULL;
33012     }
33013     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33014     ndim = ctx->head->field->type->ndim;
33015     while (*ts && *ts != ')') {
33016         switch (*ts) {
33017             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
33018             default:  break;
33019         }
33020         number = __Pyx_BufFmt_ExpectNumber(&ts);
33021         if (number == -1) return NULL;
33022         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
33023             return PyErr_Format(PyExc_ValueError,
33024                         "Expected a dimension of size %zu, got %d",
33025                         ctx->head->field->type->arraysize[i], number);
33026         if (*ts != ',' && *ts != ')')
33027             return PyErr_Format(PyExc_ValueError,
33028                                 "Expected a comma in format string, got '%c'", *ts);
33029         if (*ts == ',') ts++;
33030         i++;
33031     }
33032     if (i != ndim)
33033         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
33034                             ctx->head->field->type->ndim, i);
33035     if (!*ts) {
33036         PyErr_SetString(PyExc_ValueError,
33037                         "Unexpected end of format string, expected ')'");
33038         return NULL;
33039     }
33040     ctx->is_valid_array = 1;
33041     ctx->new_count = 1;
33042     *tsp = ++ts;
33043     return Py_None;
33044 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)33045 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
33046   int got_Z = 0;
33047   while (1) {
33048     switch(*ts) {
33049       case 0:
33050         if (ctx->enc_type != 0 && ctx->head == NULL) {
33051           __Pyx_BufFmt_RaiseExpected(ctx);
33052           return NULL;
33053         }
33054         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33055         if (ctx->head != NULL) {
33056           __Pyx_BufFmt_RaiseExpected(ctx);
33057           return NULL;
33058         }
33059         return ts;
33060       case ' ':
33061       case '\r':
33062       case '\n':
33063         ++ts;
33064         break;
33065       case '<':
33066         if (!__Pyx_Is_Little_Endian()) {
33067           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
33068           return NULL;
33069         }
33070         ctx->new_packmode = '=';
33071         ++ts;
33072         break;
33073       case '>':
33074       case '!':
33075         if (__Pyx_Is_Little_Endian()) {
33076           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
33077           return NULL;
33078         }
33079         ctx->new_packmode = '=';
33080         ++ts;
33081         break;
33082       case '=':
33083       case '@':
33084       case '^':
33085         ctx->new_packmode = *ts++;
33086         break;
33087       case 'T':
33088         {
33089           const char* ts_after_sub;
33090           size_t i, struct_count = ctx->new_count;
33091           size_t struct_alignment = ctx->struct_alignment;
33092           ctx->new_count = 1;
33093           ++ts;
33094           if (*ts != '{') {
33095             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
33096             return NULL;
33097           }
33098           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33099           ctx->enc_type = 0;
33100           ctx->enc_count = 0;
33101           ctx->struct_alignment = 0;
33102           ++ts;
33103           ts_after_sub = ts;
33104           for (i = 0; i != struct_count; ++i) {
33105             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
33106             if (!ts_after_sub) return NULL;
33107           }
33108           ts = ts_after_sub;
33109           if (struct_alignment) ctx->struct_alignment = struct_alignment;
33110         }
33111         break;
33112       case '}':
33113         {
33114           size_t alignment = ctx->struct_alignment;
33115           ++ts;
33116           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33117           ctx->enc_type = 0;
33118           if (alignment && ctx->fmt_offset % alignment) {
33119             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
33120           }
33121         }
33122         return ts;
33123       case 'x':
33124         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33125         ctx->fmt_offset += ctx->new_count;
33126         ctx->new_count = 1;
33127         ctx->enc_count = 0;
33128         ctx->enc_type = 0;
33129         ctx->enc_packmode = ctx->new_packmode;
33130         ++ts;
33131         break;
33132       case 'Z':
33133         got_Z = 1;
33134         ++ts;
33135         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
33136           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
33137           return NULL;
33138         }
33139         CYTHON_FALLTHROUGH;
33140       case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
33141       case 'l': case 'L': case 'q': case 'Q':
33142       case 'f': case 'd': case 'g':
33143       case 'O': case 'p':
33144         if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
33145             (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
33146           ctx->enc_count += ctx->new_count;
33147           ctx->new_count = 1;
33148           got_Z = 0;
33149           ++ts;
33150           break;
33151         }
33152         CYTHON_FALLTHROUGH;
33153       case 's':
33154         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33155         ctx->enc_count = ctx->new_count;
33156         ctx->enc_packmode = ctx->new_packmode;
33157         ctx->enc_type = *ts;
33158         ctx->is_complex = got_Z;
33159         ++ts;
33160         ctx->new_count = 1;
33161         got_Z = 0;
33162         break;
33163       case ':':
33164         ++ts;
33165         while(*ts != ':') ++ts;
33166         ++ts;
33167         break;
33168       case '(':
33169         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
33170         break;
33171       default:
33172         {
33173           int number = __Pyx_BufFmt_ExpectNumber(&ts);
33174           if (number == -1) return NULL;
33175           ctx->new_count = (size_t)number;
33176         }
33177     }
33178   }
33179 }
33180 
33181 /* TypeInfoCompare */
33182   static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo * a,__Pyx_TypeInfo * b)33183 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
33184 {
33185     int i;
33186     if (!a || !b)
33187         return 0;
33188     if (a == b)
33189         return 1;
33190     if (a->size != b->size || a->typegroup != b->typegroup ||
33191             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
33192         if (a->typegroup == 'H' || b->typegroup == 'H') {
33193             return a->size == b->size;
33194         } else {
33195             return 0;
33196         }
33197     }
33198     if (a->ndim) {
33199         for (i = 0; i < a->ndim; i++)
33200             if (a->arraysize[i] != b->arraysize[i])
33201                 return 0;
33202     }
33203     if (a->typegroup == 'S') {
33204         if (a->flags != b->flags)
33205             return 0;
33206         if (a->fields || b->fields) {
33207             if (!(a->fields && b->fields))
33208                 return 0;
33209             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
33210                 __Pyx_StructField *field_a = a->fields + i;
33211                 __Pyx_StructField *field_b = b->fields + i;
33212                 if (field_a->offset != field_b->offset ||
33213                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
33214                     return 0;
33215             }
33216             return !a->fields[i].type && !b->fields[i].type;
33217         }
33218     }
33219     return 1;
33220 }
33221 
33222 /* MemviewSliceValidateAndInit */
33223   static int
__pyx_check_strides(Py_buffer * buf,int dim,int ndim,int spec)33224 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
33225 {
33226     if (buf->shape[dim] <= 1)
33227         return 1;
33228     if (buf->strides) {
33229         if (spec & __Pyx_MEMVIEW_CONTIG) {
33230             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
33231                 if (unlikely(buf->strides[dim] != sizeof(void *))) {
33232                     PyErr_Format(PyExc_ValueError,
33233                                  "Buffer is not indirectly contiguous "
33234                                  "in dimension %d.", dim);
33235                     goto fail;
33236                 }
33237             } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
33238                 PyErr_SetString(PyExc_ValueError,
33239                                 "Buffer and memoryview are not contiguous "
33240                                 "in the same dimension.");
33241                 goto fail;
33242             }
33243         }
33244         if (spec & __Pyx_MEMVIEW_FOLLOW) {
33245             Py_ssize_t stride = buf->strides[dim];
33246             if (stride < 0)
33247                 stride = -stride;
33248             if (unlikely(stride < buf->itemsize)) {
33249                 PyErr_SetString(PyExc_ValueError,
33250                                 "Buffer and memoryview are not contiguous "
33251                                 "in the same dimension.");
33252                 goto fail;
33253             }
33254         }
33255     } else {
33256         if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
33257             PyErr_Format(PyExc_ValueError,
33258                          "C-contiguous buffer is not contiguous in "
33259                          "dimension %d", dim);
33260             goto fail;
33261         } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
33262             PyErr_Format(PyExc_ValueError,
33263                          "C-contiguous buffer is not indirect in "
33264                          "dimension %d", dim);
33265             goto fail;
33266         } else if (unlikely(buf->suboffsets)) {
33267             PyErr_SetString(PyExc_ValueError,
33268                             "Buffer exposes suboffsets but no strides");
33269             goto fail;
33270         }
33271     }
33272     return 1;
33273 fail:
33274     return 0;
33275 }
33276 static int
__pyx_check_suboffsets(Py_buffer * buf,int dim,CYTHON_UNUSED int ndim,int spec)33277 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
33278 {
33279     if (spec & __Pyx_MEMVIEW_DIRECT) {
33280         if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
33281             PyErr_Format(PyExc_ValueError,
33282                          "Buffer not compatible with direct access "
33283                          "in dimension %d.", dim);
33284             goto fail;
33285         }
33286     }
33287     if (spec & __Pyx_MEMVIEW_PTR) {
33288         if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
33289             PyErr_Format(PyExc_ValueError,
33290                          "Buffer is not indirectly accessible "
33291                          "in dimension %d.", dim);
33292             goto fail;
33293         }
33294     }
33295     return 1;
33296 fail:
33297     return 0;
33298 }
33299 static int
__pyx_verify_contig(Py_buffer * buf,int ndim,int c_or_f_flag)33300 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
33301 {
33302     int i;
33303     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
33304         Py_ssize_t stride = 1;
33305         for (i = 0; i < ndim; i++) {
33306             if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
33307                 PyErr_SetString(PyExc_ValueError,
33308                     "Buffer not fortran contiguous.");
33309                 goto fail;
33310             }
33311             stride = stride * buf->shape[i];
33312         }
33313     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
33314         Py_ssize_t stride = 1;
33315         for (i = ndim - 1; i >- 1; i--) {
33316             if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
33317                 PyErr_SetString(PyExc_ValueError,
33318                     "Buffer not C contiguous.");
33319                 goto fail;
33320             }
33321             stride = stride * buf->shape[i];
33322         }
33323     }
33324     return 1;
33325 fail:
33326     return 0;
33327 }
__Pyx_ValidateAndInit_memviewslice(int * axes_specs,int c_or_f_flag,int buf_flags,int ndim,__Pyx_TypeInfo * dtype,__Pyx_BufFmt_StackElem stack[],__Pyx_memviewslice * memviewslice,PyObject * original_obj)33328 static int __Pyx_ValidateAndInit_memviewslice(
33329                 int *axes_specs,
33330                 int c_or_f_flag,
33331                 int buf_flags,
33332                 int ndim,
33333                 __Pyx_TypeInfo *dtype,
33334                 __Pyx_BufFmt_StackElem stack[],
33335                 __Pyx_memviewslice *memviewslice,
33336                 PyObject *original_obj)
33337 {
33338     struct __pyx_memoryview_obj *memview, *new_memview;
33339     __Pyx_RefNannyDeclarations
33340     Py_buffer *buf;
33341     int i, spec = 0, retval = -1;
33342     __Pyx_BufFmt_Context ctx;
33343     int from_memoryview = __pyx_memoryview_check(original_obj);
33344     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
33345     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
33346                                                             original_obj)->typeinfo)) {
33347         memview = (struct __pyx_memoryview_obj *) original_obj;
33348         new_memview = NULL;
33349     } else {
33350         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
33351                                             original_obj, buf_flags, 0, dtype);
33352         new_memview = memview;
33353         if (unlikely(!memview))
33354             goto fail;
33355     }
33356     buf = &memview->view;
33357     if (unlikely(buf->ndim != ndim)) {
33358         PyErr_Format(PyExc_ValueError,
33359                 "Buffer has wrong number of dimensions (expected %d, got %d)",
33360                 ndim, buf->ndim);
33361         goto fail;
33362     }
33363     if (new_memview) {
33364         __Pyx_BufFmt_Init(&ctx, stack, dtype);
33365         if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
33366     }
33367     if (unlikely((unsigned) buf->itemsize != dtype->size)) {
33368         PyErr_Format(PyExc_ValueError,
33369                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
33370                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
33371                      buf->itemsize,
33372                      (buf->itemsize > 1) ? "s" : "",
33373                      dtype->name,
33374                      dtype->size,
33375                      (dtype->size > 1) ? "s" : "");
33376         goto fail;
33377     }
33378     if (buf->len > 0) {
33379         for (i = 0; i < ndim; i++) {
33380             spec = axes_specs[i];
33381             if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
33382                 goto fail;
33383             if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
33384                 goto fail;
33385         }
33386         if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
33387             goto fail;
33388     }
33389     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
33390                                          new_memview != NULL) == -1)) {
33391         goto fail;
33392     }
33393     retval = 0;
33394     goto no_fail;
33395 fail:
33396     Py_XDECREF(new_memview);
33397     retval = -1;
33398 no_fail:
33399     __Pyx_RefNannyFinishContext();
33400     return retval;
33401 }
33402 
33403 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_char(PyObject * obj,int writable_flag)33404   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_char(PyObject *obj, int writable_flag) {
33405     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33406     __Pyx_BufFmt_StackElem stack[1];
33407     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
33408     int retcode;
33409     if (obj == Py_None) {
33410         result.memview = (struct __pyx_memoryview_obj *) Py_None;
33411         return result;
33412     }
33413     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
33414                                                  PyBUF_RECORDS_RO | writable_flag, 1,
33415                                                  &__Pyx_TypeInfo_char, stack,
33416                                                  &result, obj);
33417     if (unlikely(retcode == -1))
33418         goto __pyx_fail;
33419     return result;
33420 __pyx_fail:
33421     result.memview = NULL;
33422     result.data = NULL;
33423     return result;
33424 }
33425 
33426 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject * obj,int writable_flag)33427   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *obj, int writable_flag) {
33428     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33429     __Pyx_BufFmt_StackElem stack[1];
33430     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
33431     int retcode;
33432     if (obj == Py_None) {
33433         result.memview = (struct __pyx_memoryview_obj *) Py_None;
33434         return result;
33435     }
33436     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
33437                                                  PyBUF_RECORDS_RO | writable_flag, 1,
33438                                                  &__Pyx_TypeInfo_unsigned_char, stack,
33439                                                  &result, obj);
33440     if (unlikely(retcode == -1))
33441         goto __pyx_fail;
33442     return result;
33443 __pyx_fail:
33444     result.memview = NULL;
33445     result.data = NULL;
33446     return result;
33447 }
33448 
33449 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_short(PyObject * obj,int writable_flag)33450   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_short(PyObject *obj, int writable_flag) {
33451     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33452     __Pyx_BufFmt_StackElem stack[1];
33453     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
33454     int retcode;
33455     if (obj == Py_None) {
33456         result.memview = (struct __pyx_memoryview_obj *) Py_None;
33457         return result;
33458     }
33459     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
33460                                                  PyBUF_RECORDS_RO | writable_flag, 1,
33461                                                  &__Pyx_TypeInfo_short, stack,
33462                                                  &result, obj);
33463     if (unlikely(retcode == -1))
33464         goto __pyx_fail;
33465     return result;
33466 __pyx_fail:
33467     result.memview = NULL;
33468     result.data = NULL;
33469     return result;
33470 }
33471 
33472 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(PyObject * obj,int writable_flag)33473   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(PyObject *obj, int writable_flag) {
33474     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33475     __Pyx_BufFmt_StackElem stack[1];
33476     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
33477     int retcode;
33478     if (obj == Py_None) {
33479         result.memview = (struct __pyx_memoryview_obj *) Py_None;
33480         return result;
33481     }
33482     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
33483                                                  PyBUF_RECORDS_RO | writable_flag, 1,
33484                                                  &__Pyx_TypeInfo_unsigned_short, stack,
33485                                                  &result, obj);
33486     if (unlikely(retcode == -1))
33487         goto __pyx_fail;
33488     return result;
33489 __pyx_fail:
33490     result.memview = NULL;
33491     result.data = NULL;
33492     return result;
33493 }
33494 
33495 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject * obj,int writable_flag)33496   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
33497     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33498     __Pyx_BufFmt_StackElem stack[1];
33499     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
33500     int retcode;
33501     if (obj == Py_None) {
33502         result.memview = (struct __pyx_memoryview_obj *) Py_None;
33503         return result;
33504     }
33505     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
33506                                                  PyBUF_RECORDS_RO | writable_flag, 1,
33507                                                  &__Pyx_TypeInfo_float, stack,
33508                                                  &result, obj);
33509     if (unlikely(retcode == -1))
33510         goto __pyx_fail;
33511     return result;
33512 __pyx_fail:
33513     result.memview = NULL;
33514     result.data = NULL;
33515     return result;
33516 }
33517 
33518 /* CIntFromPyVerify */
33519   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
33520     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
33521 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
33522     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
33523 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
33524     {\
33525         func_type value = func_value;\
33526         if (sizeof(target_type) < sizeof(func_type)) {\
33527             if (unlikely(value != (func_type) (target_type) value)) {\
33528                 func_type zero = 0;\
33529                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
33530                     return (target_type) -1;\
33531                 if (is_unsigned && unlikely(value < zero))\
33532                     goto raise_neg_overflow;\
33533                 else\
33534                     goto raise_overflow;\
33535             }\
33536         }\
33537         return (target_type) value;\
33538     }
33539 
33540 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)33541   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
33542     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33543     __Pyx_BufFmt_StackElem stack[1];
33544     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
33545     int retcode;
33546     if (obj == Py_None) {
33547         result.memview = (struct __pyx_memoryview_obj *) Py_None;
33548         return result;
33549     }
33550     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
33551                                                  PyBUF_RECORDS_RO | writable_flag, 1,
33552                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
33553                                                  &result, obj);
33554     if (unlikely(retcode == -1))
33555         goto __pyx_fail;
33556     return result;
33557 __pyx_fail:
33558     result.memview = NULL;
33559     result.data = NULL;
33560     return result;
33561 }
33562 
33563 /* MemviewDtypeToObject */
__pyx_memview_get_PY_LONG_LONG(const char * itemp)33564   static CYTHON_INLINE PyObject *__pyx_memview_get_PY_LONG_LONG(const char *itemp) {
33565     return (PyObject *) __Pyx_PyInt_From_PY_LONG_LONG(*(PY_LONG_LONG *) itemp);
33566 }
__pyx_memview_set_PY_LONG_LONG(const char * itemp,PyObject * obj)33567 static CYTHON_INLINE int __pyx_memview_set_PY_LONG_LONG(const char *itemp, PyObject *obj) {
33568     PY_LONG_LONG value = __Pyx_PyInt_As_PY_LONG_LONG(obj);
33569     if ((value == (PY_LONG_LONG)-1) && PyErr_Occurred())
33570         return 0;
33571     *(PY_LONG_LONG *) itemp = value;
33572     return 1;
33573 }
33574 
33575 /* MemviewDtypeToObject */
__pyx_memview_get_char(const char * itemp)33576   static CYTHON_INLINE PyObject *__pyx_memview_get_char(const char *itemp) {
33577     return (PyObject *) __Pyx_PyInt_From_char(*(char *) itemp);
33578 }
__pyx_memview_set_char(const char * itemp,PyObject * obj)33579 static CYTHON_INLINE int __pyx_memview_set_char(const char *itemp, PyObject *obj) {
33580     char value = __Pyx_PyInt_As_char(obj);
33581     if ((value == (char)-1) && PyErr_Occurred())
33582         return 0;
33583     *(char *) itemp = value;
33584     return 1;
33585 }
33586 
33587 /* MemviewDtypeToObject */
__pyx_memview_get_unsigned_char(const char * itemp)33588   static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp) {
33589     return (PyObject *) __Pyx_PyInt_From_unsigned_char(*(unsigned char *) itemp);
33590 }
__pyx_memview_set_unsigned_char(const char * itemp,PyObject * obj)33591 static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj) {
33592     unsigned char value = __Pyx_PyInt_As_unsigned_char(obj);
33593     if ((value == (unsigned char)-1) && PyErr_Occurred())
33594         return 0;
33595     *(unsigned char *) itemp = value;
33596     return 1;
33597 }
33598 
33599 /* MemviewDtypeToObject */
__pyx_memview_get_short(const char * itemp)33600   static CYTHON_INLINE PyObject *__pyx_memview_get_short(const char *itemp) {
33601     return (PyObject *) __Pyx_PyInt_From_short(*(short *) itemp);
33602 }
__pyx_memview_set_short(const char * itemp,PyObject * obj)33603 static CYTHON_INLINE int __pyx_memview_set_short(const char *itemp, PyObject *obj) {
33604     short value = __Pyx_PyInt_As_short(obj);
33605     if ((value == (short)-1) && PyErr_Occurred())
33606         return 0;
33607     *(short *) itemp = value;
33608     return 1;
33609 }
33610 
33611 /* MemviewDtypeToObject */
__pyx_memview_get_unsigned_short(const char * itemp)33612   static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_short(const char *itemp) {
33613     return (PyObject *) __Pyx_PyInt_From_unsigned_short(*(unsigned short *) itemp);
33614 }
__pyx_memview_set_unsigned_short(const char * itemp,PyObject * obj)33615 static CYTHON_INLINE int __pyx_memview_set_unsigned_short(const char *itemp, PyObject *obj) {
33616     unsigned short value = __Pyx_PyInt_As_unsigned_short(obj);
33617     if ((value == (unsigned short)-1) && PyErr_Occurred())
33618         return 0;
33619     *(unsigned short *) itemp = value;
33620     return 1;
33621 }
33622 
33623 /* MemviewDtypeToObject */
__pyx_memview_get_float(const char * itemp)33624   static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp) {
33625     return (PyObject *) PyFloat_FromDouble(*(float *) itemp);
33626 }
__pyx_memview_set_float(const char * itemp,PyObject * obj)33627 static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
33628     float value = __pyx_PyFloat_AsFloat(obj);
33629     if ((value == (float)-1) && PyErr_Occurred())
33630         return 0;
33631     *(float *) itemp = value;
33632     return 1;
33633 }
33634 
33635 /* MemviewDtypeToObject */
__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char * itemp)33636   static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) {
33637     return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp);
33638 }
__pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char * itemp,PyObject * obj)33639 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) {
33640     __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj);
33641     if ((value == ((npy_int64)-1)) && PyErr_Occurred())
33642         return 0;
33643     *(__pyx_t_5numpy_int64_t *) itemp = value;
33644     return 1;
33645 }
33646 
33647 /* Declarations */
33648   #if CYTHON_CCOMPLEX
33649   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)33650     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33651       return ::std::complex< float >(x, y);
33652     }
33653   #else
__pyx_t_float_complex_from_parts(float x,float y)33654     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33655       return x + y*(__pyx_t_float_complex)_Complex_I;
33656     }
33657   #endif
33658 #else
__pyx_t_float_complex_from_parts(float x,float y)33659     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33660       __pyx_t_float_complex z;
33661       z.real = x;
33662       z.imag = y;
33663       return z;
33664     }
33665 #endif
33666 
33667 /* Arithmetic */
33668   #if CYTHON_CCOMPLEX
33669 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)33670     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33671        return (a.real == b.real) && (a.imag == b.imag);
33672     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)33673     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33674         __pyx_t_float_complex z;
33675         z.real = a.real + b.real;
33676         z.imag = a.imag + b.imag;
33677         return z;
33678     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)33679     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33680         __pyx_t_float_complex z;
33681         z.real = a.real - b.real;
33682         z.imag = a.imag - b.imag;
33683         return z;
33684     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)33685     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33686         __pyx_t_float_complex z;
33687         z.real = a.real * b.real - a.imag * b.imag;
33688         z.imag = a.real * b.imag + a.imag * b.real;
33689         return z;
33690     }
33691     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)33692     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33693         if (b.imag == 0) {
33694             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
33695         } else if (fabsf(b.real) >= fabsf(b.imag)) {
33696             if (b.real == 0 && b.imag == 0) {
33697                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
33698             } else {
33699                 float r = b.imag / b.real;
33700                 float s = (float)(1.0) / (b.real + b.imag * r);
33701                 return __pyx_t_float_complex_from_parts(
33702                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
33703             }
33704         } else {
33705             float r = b.real / b.imag;
33706             float s = (float)(1.0) / (b.imag + b.real * r);
33707             return __pyx_t_float_complex_from_parts(
33708                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
33709         }
33710     }
33711     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)33712     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33713         if (b.imag == 0) {
33714             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
33715         } else {
33716             float denom = b.real * b.real + b.imag * b.imag;
33717             return __pyx_t_float_complex_from_parts(
33718                 (a.real * b.real + a.imag * b.imag) / denom,
33719                 (a.imag * b.real - a.real * b.imag) / denom);
33720         }
33721     }
33722     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)33723     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
33724         __pyx_t_float_complex z;
33725         z.real = -a.real;
33726         z.imag = -a.imag;
33727         return z;
33728     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)33729     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
33730        return (a.real == 0) && (a.imag == 0);
33731     }
__Pyx_c_conj_float(__pyx_t_float_complex a)33732     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
33733         __pyx_t_float_complex z;
33734         z.real =  a.real;
33735         z.imag = -a.imag;
33736         return z;
33737     }
33738     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)33739         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
33740           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
33741             return sqrtf(z.real*z.real + z.imag*z.imag);
33742           #else
33743             return hypotf(z.real, z.imag);
33744           #endif
33745         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)33746         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33747             __pyx_t_float_complex z;
33748             float r, lnr, theta, z_r, z_theta;
33749             if (b.imag == 0 && b.real == (int)b.real) {
33750                 if (b.real < 0) {
33751                     float denom = a.real * a.real + a.imag * a.imag;
33752                     a.real = a.real / denom;
33753                     a.imag = -a.imag / denom;
33754                     b.real = -b.real;
33755                 }
33756                 switch ((int)b.real) {
33757                     case 0:
33758                         z.real = 1;
33759                         z.imag = 0;
33760                         return z;
33761                     case 1:
33762                         return a;
33763                     case 2:
33764                         return __Pyx_c_prod_float(a, a);
33765                     case 3:
33766                         z = __Pyx_c_prod_float(a, a);
33767                         return __Pyx_c_prod_float(z, a);
33768                     case 4:
33769                         z = __Pyx_c_prod_float(a, a);
33770                         return __Pyx_c_prod_float(z, z);
33771                 }
33772             }
33773             if (a.imag == 0) {
33774                 if (a.real == 0) {
33775                     return a;
33776                 } else if (b.imag == 0) {
33777                     z.real = powf(a.real, b.real);
33778                     z.imag = 0;
33779                     return z;
33780                 } else if (a.real > 0) {
33781                     r = a.real;
33782                     theta = 0;
33783                 } else {
33784                     r = -a.real;
33785                     theta = atan2f(0.0, -1.0);
33786                 }
33787             } else {
33788                 r = __Pyx_c_abs_float(a);
33789                 theta = atan2f(a.imag, a.real);
33790             }
33791             lnr = logf(r);
33792             z_r = expf(lnr * b.real - theta * b.imag);
33793             z_theta = theta * b.real + lnr * b.imag;
33794             z.real = z_r * cosf(z_theta);
33795             z.imag = z_r * sinf(z_theta);
33796             return z;
33797         }
33798     #endif
33799 #endif
33800 
33801 /* Declarations */
33802   #if CYTHON_CCOMPLEX
33803   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)33804     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
33805       return ::std::complex< double >(x, y);
33806     }
33807   #else
__pyx_t_double_complex_from_parts(double x,double y)33808     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
33809       return x + y*(__pyx_t_double_complex)_Complex_I;
33810     }
33811   #endif
33812 #else
__pyx_t_double_complex_from_parts(double x,double y)33813     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
33814       __pyx_t_double_complex z;
33815       z.real = x;
33816       z.imag = y;
33817       return z;
33818     }
33819 #endif
33820 
33821 /* Arithmetic */
33822   #if CYTHON_CCOMPLEX
33823 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)33824     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33825        return (a.real == b.real) && (a.imag == b.imag);
33826     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)33827     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33828         __pyx_t_double_complex z;
33829         z.real = a.real + b.real;
33830         z.imag = a.imag + b.imag;
33831         return z;
33832     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)33833     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33834         __pyx_t_double_complex z;
33835         z.real = a.real - b.real;
33836         z.imag = a.imag - b.imag;
33837         return z;
33838     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)33839     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33840         __pyx_t_double_complex z;
33841         z.real = a.real * b.real - a.imag * b.imag;
33842         z.imag = a.real * b.imag + a.imag * b.real;
33843         return z;
33844     }
33845     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)33846     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33847         if (b.imag == 0) {
33848             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
33849         } else if (fabs(b.real) >= fabs(b.imag)) {
33850             if (b.real == 0 && b.imag == 0) {
33851                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
33852             } else {
33853                 double r = b.imag / b.real;
33854                 double s = (double)(1.0) / (b.real + b.imag * r);
33855                 return __pyx_t_double_complex_from_parts(
33856                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
33857             }
33858         } else {
33859             double r = b.real / b.imag;
33860             double s = (double)(1.0) / (b.imag + b.real * r);
33861             return __pyx_t_double_complex_from_parts(
33862                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
33863         }
33864     }
33865     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)33866     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33867         if (b.imag == 0) {
33868             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
33869         } else {
33870             double denom = b.real * b.real + b.imag * b.imag;
33871             return __pyx_t_double_complex_from_parts(
33872                 (a.real * b.real + a.imag * b.imag) / denom,
33873                 (a.imag * b.real - a.real * b.imag) / denom);
33874         }
33875     }
33876     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)33877     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
33878         __pyx_t_double_complex z;
33879         z.real = -a.real;
33880         z.imag = -a.imag;
33881         return z;
33882     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)33883     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
33884        return (a.real == 0) && (a.imag == 0);
33885     }
__Pyx_c_conj_double(__pyx_t_double_complex a)33886     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
33887         __pyx_t_double_complex z;
33888         z.real =  a.real;
33889         z.imag = -a.imag;
33890         return z;
33891     }
33892     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)33893         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
33894           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
33895             return sqrt(z.real*z.real + z.imag*z.imag);
33896           #else
33897             return hypot(z.real, z.imag);
33898           #endif
33899         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)33900         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33901             __pyx_t_double_complex z;
33902             double r, lnr, theta, z_r, z_theta;
33903             if (b.imag == 0 && b.real == (int)b.real) {
33904                 if (b.real < 0) {
33905                     double denom = a.real * a.real + a.imag * a.imag;
33906                     a.real = a.real / denom;
33907                     a.imag = -a.imag / denom;
33908                     b.real = -b.real;
33909                 }
33910                 switch ((int)b.real) {
33911                     case 0:
33912                         z.real = 1;
33913                         z.imag = 0;
33914                         return z;
33915                     case 1:
33916                         return a;
33917                     case 2:
33918                         return __Pyx_c_prod_double(a, a);
33919                     case 3:
33920                         z = __Pyx_c_prod_double(a, a);
33921                         return __Pyx_c_prod_double(z, a);
33922                     case 4:
33923                         z = __Pyx_c_prod_double(a, a);
33924                         return __Pyx_c_prod_double(z, z);
33925                 }
33926             }
33927             if (a.imag == 0) {
33928                 if (a.real == 0) {
33929                     return a;
33930                 } else if (b.imag == 0) {
33931                     z.real = pow(a.real, b.real);
33932                     z.imag = 0;
33933                     return z;
33934                 } else if (a.real > 0) {
33935                     r = a.real;
33936                     theta = 0;
33937                 } else {
33938                     r = -a.real;
33939                     theta = atan2(0.0, -1.0);
33940                 }
33941             } else {
33942                 r = __Pyx_c_abs_double(a);
33943                 theta = atan2(a.imag, a.real);
33944             }
33945             lnr = log(r);
33946             z_r = exp(lnr * b.real - theta * b.imag);
33947             z_theta = theta * b.real + lnr * b.imag;
33948             z.real = z_r * cos(z_theta);
33949             z.imag = z_r * sin(z_theta);
33950             return z;
33951         }
33952     #endif
33953 #endif
33954 
33955 /* MemviewSliceCopyTemplate */
33956   static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice * from_mvs,const char * mode,int ndim,size_t sizeof_dtype,int contig_flag,int dtype_is_object)33957 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
33958                                  const char *mode, int ndim,
33959                                  size_t sizeof_dtype, int contig_flag,
33960                                  int dtype_is_object)
33961 {
33962     __Pyx_RefNannyDeclarations
33963     int i;
33964     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
33965     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
33966     Py_buffer *buf = &from_memview->view;
33967     PyObject *shape_tuple = NULL;
33968     PyObject *temp_int = NULL;
33969     struct __pyx_array_obj *array_obj = NULL;
33970     struct __pyx_memoryview_obj *memview_obj = NULL;
33971     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
33972     for (i = 0; i < ndim; i++) {
33973         if (unlikely(from_mvs->suboffsets[i] >= 0)) {
33974             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
33975                                            "indirect dimensions (axis %d)", i);
33976             goto fail;
33977         }
33978     }
33979     shape_tuple = PyTuple_New(ndim);
33980     if (unlikely(!shape_tuple)) {
33981         goto fail;
33982     }
33983     __Pyx_GOTREF(shape_tuple);
33984     for(i = 0; i < ndim; i++) {
33985         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
33986         if(unlikely(!temp_int)) {
33987             goto fail;
33988         } else {
33989             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
33990             temp_int = NULL;
33991         }
33992     }
33993     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
33994     if (unlikely(!array_obj)) {
33995         goto fail;
33996     }
33997     __Pyx_GOTREF(array_obj);
33998     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
33999                                     (PyObject *) array_obj, contig_flag,
34000                                     dtype_is_object,
34001                                     from_mvs->memview->typeinfo);
34002     if (unlikely(!memview_obj))
34003         goto fail;
34004     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
34005         goto fail;
34006     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
34007                                                 dtype_is_object) < 0))
34008         goto fail;
34009     goto no_fail;
34010 fail:
34011     __Pyx_XDECREF(new_mvs.memview);
34012     new_mvs.memview = NULL;
34013     new_mvs.data = NULL;
34014 no_fail:
34015     __Pyx_XDECREF(shape_tuple);
34016     __Pyx_XDECREF(temp_int);
34017     __Pyx_XDECREF(array_obj);
34018     __Pyx_RefNannyFinishContext();
34019     return new_mvs;
34020 }
34021 
34022 /* CIntFromPy */
__Pyx_PyInt_As_PY_LONG_LONG(PyObject * x)34023   static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {
34024 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34025 #pragma GCC diagnostic push
34026 #pragma GCC diagnostic ignored "-Wconversion"
34027 #endif
34028     const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
34029 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34030 #pragma GCC diagnostic pop
34031 #endif
34032     const int is_unsigned = neg_one > const_zero;
34033 #if PY_MAJOR_VERSION < 3
34034     if (likely(PyInt_Check(x))) {
34035         if (sizeof(PY_LONG_LONG) < sizeof(long)) {
34036             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))
34037         } else {
34038             long val = PyInt_AS_LONG(x);
34039             if (is_unsigned && unlikely(val < 0)) {
34040                 goto raise_neg_overflow;
34041             }
34042             return (PY_LONG_LONG) val;
34043         }
34044     } else
34045 #endif
34046     if (likely(PyLong_Check(x))) {
34047         if (is_unsigned) {
34048 #if CYTHON_USE_PYLONG_INTERNALS
34049             const digit* digits = ((PyLongObject*)x)->ob_digit;
34050             switch (Py_SIZE(x)) {
34051                 case  0: return (PY_LONG_LONG) 0;
34052                 case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, digits[0])
34053                 case 2:
34054                     if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
34055                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34056                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34057                         } else if (8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
34058                             return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
34059                         }
34060                     }
34061                     break;
34062                 case 3:
34063                     if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
34064                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34065                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34066                         } else if (8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
34067                             return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
34068                         }
34069                     }
34070                     break;
34071                 case 4:
34072                     if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
34073                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34074                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34075                         } else if (8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
34076                             return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
34077                         }
34078                     }
34079                     break;
34080             }
34081 #endif
34082 #if CYTHON_COMPILING_IN_CPYTHON
34083             if (unlikely(Py_SIZE(x) < 0)) {
34084                 goto raise_neg_overflow;
34085             }
34086 #else
34087             {
34088                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
34089                 if (unlikely(result < 0))
34090                     return (PY_LONG_LONG) -1;
34091                 if (unlikely(result == 1))
34092                     goto raise_neg_overflow;
34093             }
34094 #endif
34095             if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
34096                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
34097 #ifdef HAVE_LONG_LONG
34098             } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
34099                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
34100 #endif
34101             }
34102         } else {
34103 #if CYTHON_USE_PYLONG_INTERNALS
34104             const digit* digits = ((PyLongObject*)x)->ob_digit;
34105             switch (Py_SIZE(x)) {
34106                 case  0: return (PY_LONG_LONG) 0;
34107                 case -1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
34108                 case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG,  digit, +digits[0])
34109                 case -2:
34110                     if (8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
34111                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34112                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34113                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
34114                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
34115                         }
34116                     }
34117                     break;
34118                 case 2:
34119                     if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
34120                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34121                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34122                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
34123                             return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
34124                         }
34125                     }
34126                     break;
34127                 case -3:
34128                     if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
34129                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34130                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34131                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
34132                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
34133                         }
34134                     }
34135                     break;
34136                 case 3:
34137                     if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
34138                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34139                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34140                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
34141                             return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
34142                         }
34143                     }
34144                     break;
34145                 case -4:
34146                     if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
34147                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34148                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34149                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
34150                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
34151                         }
34152                     }
34153                     break;
34154                 case 4:
34155                     if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
34156                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34157                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34158                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
34159                             return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
34160                         }
34161                     }
34162                     break;
34163             }
34164 #endif
34165             if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
34166                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))
34167 #ifdef HAVE_LONG_LONG
34168             } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
34169                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
34170 #endif
34171             }
34172         }
34173         {
34174 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
34175             PyErr_SetString(PyExc_RuntimeError,
34176                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
34177 #else
34178             PY_LONG_LONG val;
34179             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
34180  #if PY_MAJOR_VERSION < 3
34181             if (likely(v) && !PyLong_Check(v)) {
34182                 PyObject *tmp = v;
34183                 v = PyNumber_Long(tmp);
34184                 Py_DECREF(tmp);
34185             }
34186  #endif
34187             if (likely(v)) {
34188                 int one = 1; int is_little = (int)*(unsigned char *)&one;
34189                 unsigned char *bytes = (unsigned char *)&val;
34190                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
34191                                               bytes, sizeof(val),
34192                                               is_little, !is_unsigned);
34193                 Py_DECREF(v);
34194                 if (likely(!ret))
34195                     return val;
34196             }
34197 #endif
34198             return (PY_LONG_LONG) -1;
34199         }
34200     } else {
34201         PY_LONG_LONG val;
34202         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
34203         if (!tmp) return (PY_LONG_LONG) -1;
34204         val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
34205         Py_DECREF(tmp);
34206         return val;
34207     }
34208 raise_overflow:
34209     PyErr_SetString(PyExc_OverflowError,
34210         "value too large to convert to PY_LONG_LONG");
34211     return (PY_LONG_LONG) -1;
34212 raise_neg_overflow:
34213     PyErr_SetString(PyExc_OverflowError,
34214         "can't convert negative value to PY_LONG_LONG");
34215     return (PY_LONG_LONG) -1;
34216 }
34217 
34218 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_int(PyObject * x)34219   static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
34220 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34221 #pragma GCC diagnostic push
34222 #pragma GCC diagnostic ignored "-Wconversion"
34223 #endif
34224     const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
34225 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34226 #pragma GCC diagnostic pop
34227 #endif
34228     const int is_unsigned = neg_one > const_zero;
34229 #if PY_MAJOR_VERSION < 3
34230     if (likely(PyInt_Check(x))) {
34231         if (sizeof(unsigned int) < sizeof(long)) {
34232             __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
34233         } else {
34234             long val = PyInt_AS_LONG(x);
34235             if (is_unsigned && unlikely(val < 0)) {
34236                 goto raise_neg_overflow;
34237             }
34238             return (unsigned int) val;
34239         }
34240     } else
34241 #endif
34242     if (likely(PyLong_Check(x))) {
34243         if (is_unsigned) {
34244 #if CYTHON_USE_PYLONG_INTERNALS
34245             const digit* digits = ((PyLongObject*)x)->ob_digit;
34246             switch (Py_SIZE(x)) {
34247                 case  0: return (unsigned int) 0;
34248                 case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
34249                 case 2:
34250                     if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
34251                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34252                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34253                         } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
34254                             return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
34255                         }
34256                     }
34257                     break;
34258                 case 3:
34259                     if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
34260                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34261                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34262                         } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
34263                             return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
34264                         }
34265                     }
34266                     break;
34267                 case 4:
34268                     if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
34269                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34270                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34271                         } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
34272                             return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
34273                         }
34274                     }
34275                     break;
34276             }
34277 #endif
34278 #if CYTHON_COMPILING_IN_CPYTHON
34279             if (unlikely(Py_SIZE(x) < 0)) {
34280                 goto raise_neg_overflow;
34281             }
34282 #else
34283             {
34284                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
34285                 if (unlikely(result < 0))
34286                     return (unsigned int) -1;
34287                 if (unlikely(result == 1))
34288                     goto raise_neg_overflow;
34289             }
34290 #endif
34291             if (sizeof(unsigned int) <= sizeof(unsigned long)) {
34292                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
34293 #ifdef HAVE_LONG_LONG
34294             } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
34295                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
34296 #endif
34297             }
34298         } else {
34299 #if CYTHON_USE_PYLONG_INTERNALS
34300             const digit* digits = ((PyLongObject*)x)->ob_digit;
34301             switch (Py_SIZE(x)) {
34302                 case  0: return (unsigned int) 0;
34303                 case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
34304                 case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
34305                 case -2:
34306                     if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
34307                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34308                             __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34309                         } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
34310                             return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
34311                         }
34312                     }
34313                     break;
34314                 case 2:
34315                     if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
34316                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34317                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34318                         } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
34319                             return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
34320                         }
34321                     }
34322                     break;
34323                 case -3:
34324                     if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
34325                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34326                             __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34327                         } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
34328                             return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
34329                         }
34330                     }
34331                     break;
34332                 case 3:
34333                     if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
34334                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34335                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34336                         } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
34337                             return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
34338                         }
34339                     }
34340                     break;
34341                 case -4:
34342                     if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
34343                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34344                             __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34345                         } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
34346                             return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
34347                         }
34348                     }
34349                     break;
34350                 case 4:
34351                     if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
34352                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34353                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34354                         } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
34355                             return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
34356                         }
34357                     }
34358                     break;
34359             }
34360 #endif
34361             if (sizeof(unsigned int) <= sizeof(long)) {
34362                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
34363 #ifdef HAVE_LONG_LONG
34364             } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
34365                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
34366 #endif
34367             }
34368         }
34369         {
34370 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
34371             PyErr_SetString(PyExc_RuntimeError,
34372                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
34373 #else
34374             unsigned int val;
34375             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
34376  #if PY_MAJOR_VERSION < 3
34377             if (likely(v) && !PyLong_Check(v)) {
34378                 PyObject *tmp = v;
34379                 v = PyNumber_Long(tmp);
34380                 Py_DECREF(tmp);
34381             }
34382  #endif
34383             if (likely(v)) {
34384                 int one = 1; int is_little = (int)*(unsigned char *)&one;
34385                 unsigned char *bytes = (unsigned char *)&val;
34386                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
34387                                               bytes, sizeof(val),
34388                                               is_little, !is_unsigned);
34389                 Py_DECREF(v);
34390                 if (likely(!ret))
34391                     return val;
34392             }
34393 #endif
34394             return (unsigned int) -1;
34395         }
34396     } else {
34397         unsigned int val;
34398         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
34399         if (!tmp) return (unsigned int) -1;
34400         val = __Pyx_PyInt_As_unsigned_int(tmp);
34401         Py_DECREF(tmp);
34402         return val;
34403     }
34404 raise_overflow:
34405     PyErr_SetString(PyExc_OverflowError,
34406         "value too large to convert to unsigned int");
34407     return (unsigned int) -1;
34408 raise_neg_overflow:
34409     PyErr_SetString(PyExc_OverflowError,
34410         "can't convert negative value to unsigned int");
34411     return (unsigned int) -1;
34412 }
34413 
34414 /* CIntToPy */
__Pyx_PyInt_From_long(long value)34415   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
34416 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34417 #pragma GCC diagnostic push
34418 #pragma GCC diagnostic ignored "-Wconversion"
34419 #endif
34420     const long neg_one = (long) -1, const_zero = (long) 0;
34421 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34422 #pragma GCC diagnostic pop
34423 #endif
34424     const int is_unsigned = neg_one > const_zero;
34425     if (is_unsigned) {
34426         if (sizeof(long) < sizeof(long)) {
34427             return PyInt_FromLong((long) value);
34428         } else if (sizeof(long) <= sizeof(unsigned long)) {
34429             return PyLong_FromUnsignedLong((unsigned long) value);
34430 #ifdef HAVE_LONG_LONG
34431         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
34432             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34433 #endif
34434         }
34435     } else {
34436         if (sizeof(long) <= sizeof(long)) {
34437             return PyInt_FromLong((long) value);
34438 #ifdef HAVE_LONG_LONG
34439         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
34440             return PyLong_FromLongLong((PY_LONG_LONG) value);
34441 #endif
34442         }
34443     }
34444     {
34445         int one = 1; int little = (int)*(unsigned char *)&one;
34446         unsigned char *bytes = (unsigned char *)&value;
34447         return _PyLong_FromByteArray(bytes, sizeof(long),
34448                                      little, !is_unsigned);
34449     }
34450 }
34451 
34452 /* CIntToPy */
__Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value)34453   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
34454 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34455 #pragma GCC diagnostic push
34456 #pragma GCC diagnostic ignored "-Wconversion"
34457 #endif
34458     const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
34459 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34460 #pragma GCC diagnostic pop
34461 #endif
34462     const int is_unsigned = neg_one > const_zero;
34463     if (is_unsigned) {
34464         if (sizeof(PY_LONG_LONG) < sizeof(long)) {
34465             return PyInt_FromLong((long) value);
34466         } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
34467             return PyLong_FromUnsignedLong((unsigned long) value);
34468 #ifdef HAVE_LONG_LONG
34469         } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
34470             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34471 #endif
34472         }
34473     } else {
34474         if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
34475             return PyInt_FromLong((long) value);
34476 #ifdef HAVE_LONG_LONG
34477         } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
34478             return PyLong_FromLongLong((PY_LONG_LONG) value);
34479 #endif
34480         }
34481     }
34482     {
34483         int one = 1; int little = (int)*(unsigned char *)&one;
34484         unsigned char *bytes = (unsigned char *)&value;
34485         return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
34486                                      little, !is_unsigned);
34487     }
34488 }
34489 
34490 /* CIntToPy */
__Pyx_PyInt_From_char(char value)34491   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
34492 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34493 #pragma GCC diagnostic push
34494 #pragma GCC diagnostic ignored "-Wconversion"
34495 #endif
34496     const char neg_one = (char) -1, const_zero = (char) 0;
34497 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34498 #pragma GCC diagnostic pop
34499 #endif
34500     const int is_unsigned = neg_one > const_zero;
34501     if (is_unsigned) {
34502         if (sizeof(char) < sizeof(long)) {
34503             return PyInt_FromLong((long) value);
34504         } else if (sizeof(char) <= sizeof(unsigned long)) {
34505             return PyLong_FromUnsignedLong((unsigned long) value);
34506 #ifdef HAVE_LONG_LONG
34507         } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
34508             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34509 #endif
34510         }
34511     } else {
34512         if (sizeof(char) <= sizeof(long)) {
34513             return PyInt_FromLong((long) value);
34514 #ifdef HAVE_LONG_LONG
34515         } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
34516             return PyLong_FromLongLong((PY_LONG_LONG) value);
34517 #endif
34518         }
34519     }
34520     {
34521         int one = 1; int little = (int)*(unsigned char *)&one;
34522         unsigned char *bytes = (unsigned char *)&value;
34523         return _PyLong_FromByteArray(bytes, sizeof(char),
34524                                      little, !is_unsigned);
34525     }
34526 }
34527 
34528 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)34529   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
34530 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34531 #pragma GCC diagnostic push
34532 #pragma GCC diagnostic ignored "-Wconversion"
34533 #endif
34534     const char neg_one = (char) -1, const_zero = (char) 0;
34535 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34536 #pragma GCC diagnostic pop
34537 #endif
34538     const int is_unsigned = neg_one > const_zero;
34539 #if PY_MAJOR_VERSION < 3
34540     if (likely(PyInt_Check(x))) {
34541         if (sizeof(char) < sizeof(long)) {
34542             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
34543         } else {
34544             long val = PyInt_AS_LONG(x);
34545             if (is_unsigned && unlikely(val < 0)) {
34546                 goto raise_neg_overflow;
34547             }
34548             return (char) val;
34549         }
34550     } else
34551 #endif
34552     if (likely(PyLong_Check(x))) {
34553         if (is_unsigned) {
34554 #if CYTHON_USE_PYLONG_INTERNALS
34555             const digit* digits = ((PyLongObject*)x)->ob_digit;
34556             switch (Py_SIZE(x)) {
34557                 case  0: return (char) 0;
34558                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
34559                 case 2:
34560                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
34561                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34562                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34563                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
34564                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
34565                         }
34566                     }
34567                     break;
34568                 case 3:
34569                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
34570                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34571                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34572                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
34573                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
34574                         }
34575                     }
34576                     break;
34577                 case 4:
34578                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
34579                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34580                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34581                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
34582                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
34583                         }
34584                     }
34585                     break;
34586             }
34587 #endif
34588 #if CYTHON_COMPILING_IN_CPYTHON
34589             if (unlikely(Py_SIZE(x) < 0)) {
34590                 goto raise_neg_overflow;
34591             }
34592 #else
34593             {
34594                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
34595                 if (unlikely(result < 0))
34596                     return (char) -1;
34597                 if (unlikely(result == 1))
34598                     goto raise_neg_overflow;
34599             }
34600 #endif
34601             if (sizeof(char) <= sizeof(unsigned long)) {
34602                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
34603 #ifdef HAVE_LONG_LONG
34604             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
34605                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
34606 #endif
34607             }
34608         } else {
34609 #if CYTHON_USE_PYLONG_INTERNALS
34610             const digit* digits = ((PyLongObject*)x)->ob_digit;
34611             switch (Py_SIZE(x)) {
34612                 case  0: return (char) 0;
34613                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
34614                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
34615                 case -2:
34616                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
34617                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34618                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34619                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
34620                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34621                         }
34622                     }
34623                     break;
34624                 case 2:
34625                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
34626                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34627                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34628                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
34629                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34630                         }
34631                     }
34632                     break;
34633                 case -3:
34634                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
34635                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34636                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34637                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
34638                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34639                         }
34640                     }
34641                     break;
34642                 case 3:
34643                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
34644                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34645                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34646                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
34647                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34648                         }
34649                     }
34650                     break;
34651                 case -4:
34652                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
34653                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34654                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34655                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
34656                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34657                         }
34658                     }
34659                     break;
34660                 case 4:
34661                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
34662                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34663                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34664                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
34665                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34666                         }
34667                     }
34668                     break;
34669             }
34670 #endif
34671             if (sizeof(char) <= sizeof(long)) {
34672                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
34673 #ifdef HAVE_LONG_LONG
34674             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
34675                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
34676 #endif
34677             }
34678         }
34679         {
34680 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
34681             PyErr_SetString(PyExc_RuntimeError,
34682                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
34683 #else
34684             char val;
34685             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
34686  #if PY_MAJOR_VERSION < 3
34687             if (likely(v) && !PyLong_Check(v)) {
34688                 PyObject *tmp = v;
34689                 v = PyNumber_Long(tmp);
34690                 Py_DECREF(tmp);
34691             }
34692  #endif
34693             if (likely(v)) {
34694                 int one = 1; int is_little = (int)*(unsigned char *)&one;
34695                 unsigned char *bytes = (unsigned char *)&val;
34696                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
34697                                               bytes, sizeof(val),
34698                                               is_little, !is_unsigned);
34699                 Py_DECREF(v);
34700                 if (likely(!ret))
34701                     return val;
34702             }
34703 #endif
34704             return (char) -1;
34705         }
34706     } else {
34707         char val;
34708         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
34709         if (!tmp) return (char) -1;
34710         val = __Pyx_PyInt_As_char(tmp);
34711         Py_DECREF(tmp);
34712         return val;
34713     }
34714 raise_overflow:
34715     PyErr_SetString(PyExc_OverflowError,
34716         "value too large to convert to char");
34717     return (char) -1;
34718 raise_neg_overflow:
34719     PyErr_SetString(PyExc_OverflowError,
34720         "can't convert negative value to char");
34721     return (char) -1;
34722 }
34723 
34724 /* CIntToPy */
__Pyx_PyInt_From_unsigned_char(unsigned char value)34725   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
34726 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34727 #pragma GCC diagnostic push
34728 #pragma GCC diagnostic ignored "-Wconversion"
34729 #endif
34730     const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
34731 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34732 #pragma GCC diagnostic pop
34733 #endif
34734     const int is_unsigned = neg_one > const_zero;
34735     if (is_unsigned) {
34736         if (sizeof(unsigned char) < sizeof(long)) {
34737             return PyInt_FromLong((long) value);
34738         } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
34739             return PyLong_FromUnsignedLong((unsigned long) value);
34740 #ifdef HAVE_LONG_LONG
34741         } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
34742             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34743 #endif
34744         }
34745     } else {
34746         if (sizeof(unsigned char) <= sizeof(long)) {
34747             return PyInt_FromLong((long) value);
34748 #ifdef HAVE_LONG_LONG
34749         } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
34750             return PyLong_FromLongLong((PY_LONG_LONG) value);
34751 #endif
34752         }
34753     }
34754     {
34755         int one = 1; int little = (int)*(unsigned char *)&one;
34756         unsigned char *bytes = (unsigned char *)&value;
34757         return _PyLong_FromByteArray(bytes, sizeof(unsigned char),
34758                                      little, !is_unsigned);
34759     }
34760 }
34761 
34762 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_char(PyObject * x)34763   static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
34764 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34765 #pragma GCC diagnostic push
34766 #pragma GCC diagnostic ignored "-Wconversion"
34767 #endif
34768     const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
34769 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34770 #pragma GCC diagnostic pop
34771 #endif
34772     const int is_unsigned = neg_one > const_zero;
34773 #if PY_MAJOR_VERSION < 3
34774     if (likely(PyInt_Check(x))) {
34775         if (sizeof(unsigned char) < sizeof(long)) {
34776             __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x))
34777         } else {
34778             long val = PyInt_AS_LONG(x);
34779             if (is_unsigned && unlikely(val < 0)) {
34780                 goto raise_neg_overflow;
34781             }
34782             return (unsigned char) val;
34783         }
34784     } else
34785 #endif
34786     if (likely(PyLong_Check(x))) {
34787         if (is_unsigned) {
34788 #if CYTHON_USE_PYLONG_INTERNALS
34789             const digit* digits = ((PyLongObject*)x)->ob_digit;
34790             switch (Py_SIZE(x)) {
34791                 case  0: return (unsigned char) 0;
34792                 case  1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, digits[0])
34793                 case 2:
34794                     if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
34795                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34796                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34797                         } else if (8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT) {
34798                             return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
34799                         }
34800                     }
34801                     break;
34802                 case 3:
34803                     if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
34804                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34805                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34806                         } else if (8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT) {
34807                             return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
34808                         }
34809                     }
34810                     break;
34811                 case 4:
34812                     if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
34813                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34814                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34815                         } else if (8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT) {
34816                             return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
34817                         }
34818                     }
34819                     break;
34820             }
34821 #endif
34822 #if CYTHON_COMPILING_IN_CPYTHON
34823             if (unlikely(Py_SIZE(x) < 0)) {
34824                 goto raise_neg_overflow;
34825             }
34826 #else
34827             {
34828                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
34829                 if (unlikely(result < 0))
34830                     return (unsigned char) -1;
34831                 if (unlikely(result == 1))
34832                     goto raise_neg_overflow;
34833             }
34834 #endif
34835             if (sizeof(unsigned char) <= sizeof(unsigned long)) {
34836                 __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
34837 #ifdef HAVE_LONG_LONG
34838             } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
34839                 __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
34840 #endif
34841             }
34842         } else {
34843 #if CYTHON_USE_PYLONG_INTERNALS
34844             const digit* digits = ((PyLongObject*)x)->ob_digit;
34845             switch (Py_SIZE(x)) {
34846                 case  0: return (unsigned char) 0;
34847                 case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, (sdigit) (-(sdigit)digits[0]))
34848                 case  1: __PYX_VERIFY_RETURN_INT(unsigned char,  digit, +digits[0])
34849                 case -2:
34850                     if (8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT) {
34851                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34852                             __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34853                         } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
34854                             return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
34855                         }
34856                     }
34857                     break;
34858                 case 2:
34859                     if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
34860                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
34861                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34862                         } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
34863                             return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
34864                         }
34865                     }
34866                     break;
34867                 case -3:
34868                     if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
34869                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34870                             __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34871                         } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
34872                             return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
34873                         }
34874                     }
34875                     break;
34876                 case 3:
34877                     if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
34878                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
34879                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34880                         } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
34881                             return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
34882                         }
34883                     }
34884                     break;
34885                 case -4:
34886                     if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
34887                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34888                             __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34889                         } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
34890                             return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
34891                         }
34892                     }
34893                     break;
34894                 case 4:
34895                     if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
34896                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
34897                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34898                         } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
34899                             return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
34900                         }
34901                     }
34902                     break;
34903             }
34904 #endif
34905             if (sizeof(unsigned char) <= sizeof(long)) {
34906                 __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x))
34907 #ifdef HAVE_LONG_LONG
34908             } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
34909                 __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x))
34910 #endif
34911             }
34912         }
34913         {
34914 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
34915             PyErr_SetString(PyExc_RuntimeError,
34916                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
34917 #else
34918             unsigned char val;
34919             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
34920  #if PY_MAJOR_VERSION < 3
34921             if (likely(v) && !PyLong_Check(v)) {
34922                 PyObject *tmp = v;
34923                 v = PyNumber_Long(tmp);
34924                 Py_DECREF(tmp);
34925             }
34926  #endif
34927             if (likely(v)) {
34928                 int one = 1; int is_little = (int)*(unsigned char *)&one;
34929                 unsigned char *bytes = (unsigned char *)&val;
34930                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
34931                                               bytes, sizeof(val),
34932                                               is_little, !is_unsigned);
34933                 Py_DECREF(v);
34934                 if (likely(!ret))
34935                     return val;
34936             }
34937 #endif
34938             return (unsigned char) -1;
34939         }
34940     } else {
34941         unsigned char val;
34942         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
34943         if (!tmp) return (unsigned char) -1;
34944         val = __Pyx_PyInt_As_unsigned_char(tmp);
34945         Py_DECREF(tmp);
34946         return val;
34947     }
34948 raise_overflow:
34949     PyErr_SetString(PyExc_OverflowError,
34950         "value too large to convert to unsigned char");
34951     return (unsigned char) -1;
34952 raise_neg_overflow:
34953     PyErr_SetString(PyExc_OverflowError,
34954         "can't convert negative value to unsigned char");
34955     return (unsigned char) -1;
34956 }
34957 
34958 /* CIntToPy */
__Pyx_PyInt_From_short(short value)34959   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value) {
34960 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34961 #pragma GCC diagnostic push
34962 #pragma GCC diagnostic ignored "-Wconversion"
34963 #endif
34964     const short neg_one = (short) -1, const_zero = (short) 0;
34965 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34966 #pragma GCC diagnostic pop
34967 #endif
34968     const int is_unsigned = neg_one > const_zero;
34969     if (is_unsigned) {
34970         if (sizeof(short) < sizeof(long)) {
34971             return PyInt_FromLong((long) value);
34972         } else if (sizeof(short) <= sizeof(unsigned long)) {
34973             return PyLong_FromUnsignedLong((unsigned long) value);
34974 #ifdef HAVE_LONG_LONG
34975         } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
34976             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34977 #endif
34978         }
34979     } else {
34980         if (sizeof(short) <= sizeof(long)) {
34981             return PyInt_FromLong((long) value);
34982 #ifdef HAVE_LONG_LONG
34983         } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
34984             return PyLong_FromLongLong((PY_LONG_LONG) value);
34985 #endif
34986         }
34987     }
34988     {
34989         int one = 1; int little = (int)*(unsigned char *)&one;
34990         unsigned char *bytes = (unsigned char *)&value;
34991         return _PyLong_FromByteArray(bytes, sizeof(short),
34992                                      little, !is_unsigned);
34993     }
34994 }
34995 
34996 /* CIntFromPy */
__Pyx_PyInt_As_short(PyObject * x)34997   static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *x) {
34998 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34999 #pragma GCC diagnostic push
35000 #pragma GCC diagnostic ignored "-Wconversion"
35001 #endif
35002     const short neg_one = (short) -1, const_zero = (short) 0;
35003 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35004 #pragma GCC diagnostic pop
35005 #endif
35006     const int is_unsigned = neg_one > const_zero;
35007 #if PY_MAJOR_VERSION < 3
35008     if (likely(PyInt_Check(x))) {
35009         if (sizeof(short) < sizeof(long)) {
35010             __PYX_VERIFY_RETURN_INT(short, long, PyInt_AS_LONG(x))
35011         } else {
35012             long val = PyInt_AS_LONG(x);
35013             if (is_unsigned && unlikely(val < 0)) {
35014                 goto raise_neg_overflow;
35015             }
35016             return (short) val;
35017         }
35018     } else
35019 #endif
35020     if (likely(PyLong_Check(x))) {
35021         if (is_unsigned) {
35022 #if CYTHON_USE_PYLONG_INTERNALS
35023             const digit* digits = ((PyLongObject*)x)->ob_digit;
35024             switch (Py_SIZE(x)) {
35025                 case  0: return (short) 0;
35026                 case  1: __PYX_VERIFY_RETURN_INT(short, digit, digits[0])
35027                 case 2:
35028                     if (8 * sizeof(short) > 1 * PyLong_SHIFT) {
35029                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35030                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35031                         } else if (8 * sizeof(short) >= 2 * PyLong_SHIFT) {
35032                             return (short) (((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
35033                         }
35034                     }
35035                     break;
35036                 case 3:
35037                     if (8 * sizeof(short) > 2 * PyLong_SHIFT) {
35038                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35039                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35040                         } else if (8 * sizeof(short) >= 3 * PyLong_SHIFT) {
35041                             return (short) (((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
35042                         }
35043                     }
35044                     break;
35045                 case 4:
35046                     if (8 * sizeof(short) > 3 * PyLong_SHIFT) {
35047                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35048                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35049                         } else if (8 * sizeof(short) >= 4 * PyLong_SHIFT) {
35050                             return (short) (((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
35051                         }
35052                     }
35053                     break;
35054             }
35055 #endif
35056 #if CYTHON_COMPILING_IN_CPYTHON
35057             if (unlikely(Py_SIZE(x) < 0)) {
35058                 goto raise_neg_overflow;
35059             }
35060 #else
35061             {
35062                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35063                 if (unlikely(result < 0))
35064                     return (short) -1;
35065                 if (unlikely(result == 1))
35066                     goto raise_neg_overflow;
35067             }
35068 #endif
35069             if (sizeof(short) <= sizeof(unsigned long)) {
35070                 __PYX_VERIFY_RETURN_INT_EXC(short, unsigned long, PyLong_AsUnsignedLong(x))
35071 #ifdef HAVE_LONG_LONG
35072             } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
35073                 __PYX_VERIFY_RETURN_INT_EXC(short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35074 #endif
35075             }
35076         } else {
35077 #if CYTHON_USE_PYLONG_INTERNALS
35078             const digit* digits = ((PyLongObject*)x)->ob_digit;
35079             switch (Py_SIZE(x)) {
35080                 case  0: return (short) 0;
35081                 case -1: __PYX_VERIFY_RETURN_INT(short, sdigit, (sdigit) (-(sdigit)digits[0]))
35082                 case  1: __PYX_VERIFY_RETURN_INT(short,  digit, +digits[0])
35083                 case -2:
35084                     if (8 * sizeof(short) - 1 > 1 * PyLong_SHIFT) {
35085                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35086                             __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35087                         } else if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
35088                             return (short) (((short)-1)*(((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
35089                         }
35090                     }
35091                     break;
35092                 case 2:
35093                     if (8 * sizeof(short) > 1 * PyLong_SHIFT) {
35094                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35095                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35096                         } else if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
35097                             return (short) ((((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
35098                         }
35099                     }
35100                     break;
35101                 case -3:
35102                     if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
35103                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35104                             __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35105                         } else if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
35106                             return (short) (((short)-1)*(((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
35107                         }
35108                     }
35109                     break;
35110                 case 3:
35111                     if (8 * sizeof(short) > 2 * PyLong_SHIFT) {
35112                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35113                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35114                         } else if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
35115                             return (short) ((((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
35116                         }
35117                     }
35118                     break;
35119                 case -4:
35120                     if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
35121                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35122                             __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35123                         } else if (8 * sizeof(short) - 1 > 4 * PyLong_SHIFT) {
35124                             return (short) (((short)-1)*(((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
35125                         }
35126                     }
35127                     break;
35128                 case 4:
35129                     if (8 * sizeof(short) > 3 * PyLong_SHIFT) {
35130                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35131                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35132                         } else if (8 * sizeof(short) - 1 > 4 * PyLong_SHIFT) {
35133                             return (short) ((((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
35134                         }
35135                     }
35136                     break;
35137             }
35138 #endif
35139             if (sizeof(short) <= sizeof(long)) {
35140                 __PYX_VERIFY_RETURN_INT_EXC(short, long, PyLong_AsLong(x))
35141 #ifdef HAVE_LONG_LONG
35142             } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
35143                 __PYX_VERIFY_RETURN_INT_EXC(short, PY_LONG_LONG, PyLong_AsLongLong(x))
35144 #endif
35145             }
35146         }
35147         {
35148 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
35149             PyErr_SetString(PyExc_RuntimeError,
35150                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
35151 #else
35152             short val;
35153             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
35154  #if PY_MAJOR_VERSION < 3
35155             if (likely(v) && !PyLong_Check(v)) {
35156                 PyObject *tmp = v;
35157                 v = PyNumber_Long(tmp);
35158                 Py_DECREF(tmp);
35159             }
35160  #endif
35161             if (likely(v)) {
35162                 int one = 1; int is_little = (int)*(unsigned char *)&one;
35163                 unsigned char *bytes = (unsigned char *)&val;
35164                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
35165                                               bytes, sizeof(val),
35166                                               is_little, !is_unsigned);
35167                 Py_DECREF(v);
35168                 if (likely(!ret))
35169                     return val;
35170             }
35171 #endif
35172             return (short) -1;
35173         }
35174     } else {
35175         short val;
35176         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35177         if (!tmp) return (short) -1;
35178         val = __Pyx_PyInt_As_short(tmp);
35179         Py_DECREF(tmp);
35180         return val;
35181     }
35182 raise_overflow:
35183     PyErr_SetString(PyExc_OverflowError,
35184         "value too large to convert to short");
35185     return (short) -1;
35186 raise_neg_overflow:
35187     PyErr_SetString(PyExc_OverflowError,
35188         "can't convert negative value to short");
35189     return (short) -1;
35190 }
35191 
35192 /* CIntToPy */
__Pyx_PyInt_From_unsigned_short(unsigned short value)35193   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value) {
35194 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35195 #pragma GCC diagnostic push
35196 #pragma GCC diagnostic ignored "-Wconversion"
35197 #endif
35198     const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
35199 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35200 #pragma GCC diagnostic pop
35201 #endif
35202     const int is_unsigned = neg_one > const_zero;
35203     if (is_unsigned) {
35204         if (sizeof(unsigned short) < sizeof(long)) {
35205             return PyInt_FromLong((long) value);
35206         } else if (sizeof(unsigned short) <= sizeof(unsigned long)) {
35207             return PyLong_FromUnsignedLong((unsigned long) value);
35208 #ifdef HAVE_LONG_LONG
35209         } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
35210             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35211 #endif
35212         }
35213     } else {
35214         if (sizeof(unsigned short) <= sizeof(long)) {
35215             return PyInt_FromLong((long) value);
35216 #ifdef HAVE_LONG_LONG
35217         } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
35218             return PyLong_FromLongLong((PY_LONG_LONG) value);
35219 #endif
35220         }
35221     }
35222     {
35223         int one = 1; int little = (int)*(unsigned char *)&one;
35224         unsigned char *bytes = (unsigned char *)&value;
35225         return _PyLong_FromByteArray(bytes, sizeof(unsigned short),
35226                                      little, !is_unsigned);
35227     }
35228 }
35229 
35230 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_short(PyObject * x)35231   static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
35232 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35233 #pragma GCC diagnostic push
35234 #pragma GCC diagnostic ignored "-Wconversion"
35235 #endif
35236     const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
35237 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35238 #pragma GCC diagnostic pop
35239 #endif
35240     const int is_unsigned = neg_one > const_zero;
35241 #if PY_MAJOR_VERSION < 3
35242     if (likely(PyInt_Check(x))) {
35243         if (sizeof(unsigned short) < sizeof(long)) {
35244             __PYX_VERIFY_RETURN_INT(unsigned short, long, PyInt_AS_LONG(x))
35245         } else {
35246             long val = PyInt_AS_LONG(x);
35247             if (is_unsigned && unlikely(val < 0)) {
35248                 goto raise_neg_overflow;
35249             }
35250             return (unsigned short) val;
35251         }
35252     } else
35253 #endif
35254     if (likely(PyLong_Check(x))) {
35255         if (is_unsigned) {
35256 #if CYTHON_USE_PYLONG_INTERNALS
35257             const digit* digits = ((PyLongObject*)x)->ob_digit;
35258             switch (Py_SIZE(x)) {
35259                 case  0: return (unsigned short) 0;
35260                 case  1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, digits[0])
35261                 case 2:
35262                     if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
35263                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35264                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35265                         } else if (8 * sizeof(unsigned short) >= 2 * PyLong_SHIFT) {
35266                             return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
35267                         }
35268                     }
35269                     break;
35270                 case 3:
35271                     if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
35272                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35273                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35274                         } else if (8 * sizeof(unsigned short) >= 3 * PyLong_SHIFT) {
35275                             return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
35276                         }
35277                     }
35278                     break;
35279                 case 4:
35280                     if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
35281                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35282                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35283                         } else if (8 * sizeof(unsigned short) >= 4 * PyLong_SHIFT) {
35284                             return (unsigned short) (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
35285                         }
35286                     }
35287                     break;
35288             }
35289 #endif
35290 #if CYTHON_COMPILING_IN_CPYTHON
35291             if (unlikely(Py_SIZE(x) < 0)) {
35292                 goto raise_neg_overflow;
35293             }
35294 #else
35295             {
35296                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35297                 if (unlikely(result < 0))
35298                     return (unsigned short) -1;
35299                 if (unlikely(result == 1))
35300                     goto raise_neg_overflow;
35301             }
35302 #endif
35303             if (sizeof(unsigned short) <= sizeof(unsigned long)) {
35304                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned long, PyLong_AsUnsignedLong(x))
35305 #ifdef HAVE_LONG_LONG
35306             } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
35307                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35308 #endif
35309             }
35310         } else {
35311 #if CYTHON_USE_PYLONG_INTERNALS
35312             const digit* digits = ((PyLongObject*)x)->ob_digit;
35313             switch (Py_SIZE(x)) {
35314                 case  0: return (unsigned short) 0;
35315                 case -1: __PYX_VERIFY_RETURN_INT(unsigned short, sdigit, (sdigit) (-(sdigit)digits[0]))
35316                 case  1: __PYX_VERIFY_RETURN_INT(unsigned short,  digit, +digits[0])
35317                 case -2:
35318                     if (8 * sizeof(unsigned short) - 1 > 1 * PyLong_SHIFT) {
35319                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35320                             __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35321                         } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
35322                             return (unsigned short) (((unsigned short)-1)*(((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
35323                         }
35324                     }
35325                     break;
35326                 case 2:
35327                     if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
35328                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35329                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35330                         } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
35331                             return (unsigned short) ((((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
35332                         }
35333                     }
35334                     break;
35335                 case -3:
35336                     if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
35337                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35338                             __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35339                         } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
35340                             return (unsigned short) (((unsigned short)-1)*(((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
35341                         }
35342                     }
35343                     break;
35344                 case 3:
35345                     if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
35346                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35347                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35348                         } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
35349                             return (unsigned short) ((((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
35350                         }
35351                     }
35352                     break;
35353                 case -4:
35354                     if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
35355                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35356                             __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35357                         } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
35358                             return (unsigned short) (((unsigned short)-1)*(((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
35359                         }
35360                     }
35361                     break;
35362                 case 4:
35363                     if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
35364                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35365                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35366                         } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
35367                             return (unsigned short) ((((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
35368                         }
35369                     }
35370                     break;
35371             }
35372 #endif
35373             if (sizeof(unsigned short) <= sizeof(long)) {
35374                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, long, PyLong_AsLong(x))
35375 #ifdef HAVE_LONG_LONG
35376             } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
35377                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, PY_LONG_LONG, PyLong_AsLongLong(x))
35378 #endif
35379             }
35380         }
35381         {
35382 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
35383             PyErr_SetString(PyExc_RuntimeError,
35384                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
35385 #else
35386             unsigned short val;
35387             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
35388  #if PY_MAJOR_VERSION < 3
35389             if (likely(v) && !PyLong_Check(v)) {
35390                 PyObject *tmp = v;
35391                 v = PyNumber_Long(tmp);
35392                 Py_DECREF(tmp);
35393             }
35394  #endif
35395             if (likely(v)) {
35396                 int one = 1; int is_little = (int)*(unsigned char *)&one;
35397                 unsigned char *bytes = (unsigned char *)&val;
35398                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
35399                                               bytes, sizeof(val),
35400                                               is_little, !is_unsigned);
35401                 Py_DECREF(v);
35402                 if (likely(!ret))
35403                     return val;
35404             }
35405 #endif
35406             return (unsigned short) -1;
35407         }
35408     } else {
35409         unsigned short val;
35410         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35411         if (!tmp) return (unsigned short) -1;
35412         val = __Pyx_PyInt_As_unsigned_short(tmp);
35413         Py_DECREF(tmp);
35414         return val;
35415     }
35416 raise_overflow:
35417     PyErr_SetString(PyExc_OverflowError,
35418         "value too large to convert to unsigned short");
35419     return (unsigned short) -1;
35420 raise_neg_overflow:
35421     PyErr_SetString(PyExc_OverflowError,
35422         "can't convert negative value to unsigned short");
35423     return (unsigned short) -1;
35424 }
35425 
35426 /* BytesContains */
__Pyx_BytesContains(PyObject * bytes,char character)35427   static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) {
35428     const Py_ssize_t length = PyBytes_GET_SIZE(bytes);
35429     char* char_start = PyBytes_AS_STRING(bytes);
35430     return memchr(char_start, (unsigned char)character, (size_t)length) != NULL;
35431 }
35432 
35433 /* CIntToPy */
__Pyx_PyInt_From_unsigned_int(unsigned int value)35434   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
35435 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35436 #pragma GCC diagnostic push
35437 #pragma GCC diagnostic ignored "-Wconversion"
35438 #endif
35439     const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
35440 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35441 #pragma GCC diagnostic pop
35442 #endif
35443     const int is_unsigned = neg_one > const_zero;
35444     if (is_unsigned) {
35445         if (sizeof(unsigned int) < sizeof(long)) {
35446             return PyInt_FromLong((long) value);
35447         } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
35448             return PyLong_FromUnsignedLong((unsigned long) value);
35449 #ifdef HAVE_LONG_LONG
35450         } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
35451             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35452 #endif
35453         }
35454     } else {
35455         if (sizeof(unsigned int) <= sizeof(long)) {
35456             return PyInt_FromLong((long) value);
35457 #ifdef HAVE_LONG_LONG
35458         } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
35459             return PyLong_FromLongLong((PY_LONG_LONG) value);
35460 #endif
35461         }
35462     }
35463     {
35464         int one = 1; int little = (int)*(unsigned char *)&one;
35465         unsigned char *bytes = (unsigned char *)&value;
35466         return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
35467                                      little, !is_unsigned);
35468     }
35469 }
35470 
35471 /* CIntToPy */
__Pyx_PyInt_From_npy_int64(npy_int64 value)35472   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
35473 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35474 #pragma GCC diagnostic push
35475 #pragma GCC diagnostic ignored "-Wconversion"
35476 #endif
35477     const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
35478 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35479 #pragma GCC diagnostic pop
35480 #endif
35481     const int is_unsigned = neg_one > const_zero;
35482     if (is_unsigned) {
35483         if (sizeof(npy_int64) < sizeof(long)) {
35484             return PyInt_FromLong((long) value);
35485         } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
35486             return PyLong_FromUnsignedLong((unsigned long) value);
35487 #ifdef HAVE_LONG_LONG
35488         } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
35489             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35490 #endif
35491         }
35492     } else {
35493         if (sizeof(npy_int64) <= sizeof(long)) {
35494             return PyInt_FromLong((long) value);
35495 #ifdef HAVE_LONG_LONG
35496         } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
35497             return PyLong_FromLongLong((PY_LONG_LONG) value);
35498 #endif
35499         }
35500     }
35501     {
35502         int one = 1; int little = (int)*(unsigned char *)&one;
35503         unsigned char *bytes = (unsigned char *)&value;
35504         return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
35505                                      little, !is_unsigned);
35506     }
35507 }
35508 
35509 /* CIntFromPy */
__Pyx_PyInt_As_npy_int64(PyObject * x)35510   static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
35511 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35512 #pragma GCC diagnostic push
35513 #pragma GCC diagnostic ignored "-Wconversion"
35514 #endif
35515     const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
35516 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35517 #pragma GCC diagnostic pop
35518 #endif
35519     const int is_unsigned = neg_one > const_zero;
35520 #if PY_MAJOR_VERSION < 3
35521     if (likely(PyInt_Check(x))) {
35522         if (sizeof(npy_int64) < sizeof(long)) {
35523             __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
35524         } else {
35525             long val = PyInt_AS_LONG(x);
35526             if (is_unsigned && unlikely(val < 0)) {
35527                 goto raise_neg_overflow;
35528             }
35529             return (npy_int64) val;
35530         }
35531     } else
35532 #endif
35533     if (likely(PyLong_Check(x))) {
35534         if (is_unsigned) {
35535 #if CYTHON_USE_PYLONG_INTERNALS
35536             const digit* digits = ((PyLongObject*)x)->ob_digit;
35537             switch (Py_SIZE(x)) {
35538                 case  0: return (npy_int64) 0;
35539                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0])
35540                 case 2:
35541                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
35542                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35543                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35544                         } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) {
35545                             return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
35546                         }
35547                     }
35548                     break;
35549                 case 3:
35550                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
35551                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35552                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35553                         } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) {
35554                             return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
35555                         }
35556                     }
35557                     break;
35558                 case 4:
35559                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
35560                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35561                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35562                         } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) {
35563                             return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
35564                         }
35565                     }
35566                     break;
35567             }
35568 #endif
35569 #if CYTHON_COMPILING_IN_CPYTHON
35570             if (unlikely(Py_SIZE(x) < 0)) {
35571                 goto raise_neg_overflow;
35572             }
35573 #else
35574             {
35575                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35576                 if (unlikely(result < 0))
35577                     return (npy_int64) -1;
35578                 if (unlikely(result == 1))
35579                     goto raise_neg_overflow;
35580             }
35581 #endif
35582             if (sizeof(npy_int64) <= sizeof(unsigned long)) {
35583                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
35584 #ifdef HAVE_LONG_LONG
35585             } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
35586                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35587 #endif
35588             }
35589         } else {
35590 #if CYTHON_USE_PYLONG_INTERNALS
35591             const digit* digits = ((PyLongObject*)x)->ob_digit;
35592             switch (Py_SIZE(x)) {
35593                 case  0: return (npy_int64) 0;
35594                 case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0]))
35595                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64,  digit, +digits[0])
35596                 case -2:
35597                     if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) {
35598                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35599                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35600                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
35601                             return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
35602                         }
35603                     }
35604                     break;
35605                 case 2:
35606                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
35607                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35608                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35609                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
35610                             return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
35611                         }
35612                     }
35613                     break;
35614                 case -3:
35615                     if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
35616                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35617                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35618                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
35619                             return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
35620                         }
35621                     }
35622                     break;
35623                 case 3:
35624                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
35625                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35626                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35627                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
35628                             return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
35629                         }
35630                     }
35631                     break;
35632                 case -4:
35633                     if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
35634                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35635                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35636                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
35637                             return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
35638                         }
35639                     }
35640                     break;
35641                 case 4:
35642                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
35643                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35644                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35645                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
35646                             return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
35647                         }
35648                     }
35649                     break;
35650             }
35651 #endif
35652             if (sizeof(npy_int64) <= sizeof(long)) {
35653                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
35654 #ifdef HAVE_LONG_LONG
35655             } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
35656                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
35657 #endif
35658             }
35659         }
35660         {
35661 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
35662             PyErr_SetString(PyExc_RuntimeError,
35663                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
35664 #else
35665             npy_int64 val;
35666             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
35667  #if PY_MAJOR_VERSION < 3
35668             if (likely(v) && !PyLong_Check(v)) {
35669                 PyObject *tmp = v;
35670                 v = PyNumber_Long(tmp);
35671                 Py_DECREF(tmp);
35672             }
35673  #endif
35674             if (likely(v)) {
35675                 int one = 1; int is_little = (int)*(unsigned char *)&one;
35676                 unsigned char *bytes = (unsigned char *)&val;
35677                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
35678                                               bytes, sizeof(val),
35679                                               is_little, !is_unsigned);
35680                 Py_DECREF(v);
35681                 if (likely(!ret))
35682                     return val;
35683             }
35684 #endif
35685             return (npy_int64) -1;
35686         }
35687     } else {
35688         npy_int64 val;
35689         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35690         if (!tmp) return (npy_int64) -1;
35691         val = __Pyx_PyInt_As_npy_int64(tmp);
35692         Py_DECREF(tmp);
35693         return val;
35694     }
35695 raise_overflow:
35696     PyErr_SetString(PyExc_OverflowError,
35697         "value too large to convert to npy_int64");
35698     return (npy_int64) -1;
35699 raise_neg_overflow:
35700     PyErr_SetString(PyExc_OverflowError,
35701         "can't convert negative value to npy_int64");
35702     return (npy_int64) -1;
35703 }
35704 
35705 /* ImportNumPyArray */
__Pyx__ImportNumPyArray(void)35706   static PyObject* __Pyx__ImportNumPyArray(void) {
35707     PyObject *numpy_module, *ndarray_object = NULL;
35708     numpy_module = __Pyx_Import(__pyx_n_s_numpy, NULL, 0);
35709     if (likely(numpy_module)) {
35710         ndarray_object = PyObject_GetAttrString(numpy_module, "ndarray");
35711         Py_DECREF(numpy_module);
35712     }
35713     if (unlikely(!ndarray_object)) {
35714         PyErr_Clear();
35715     }
35716     if (unlikely(!ndarray_object || !PyObject_TypeCheck(ndarray_object, &PyType_Type))) {
35717         Py_XDECREF(ndarray_object);
35718         Py_INCREF(Py_None);
35719         ndarray_object = Py_None;
35720     }
35721     return ndarray_object;
35722 }
__Pyx_ImportNumPyArrayTypeIfAvailable(void)35723 static CYTHON_INLINE PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void) {
35724     if (unlikely(!__pyx_numpy_ndarray)) {
35725         __pyx_numpy_ndarray = __Pyx__ImportNumPyArray();
35726     }
35727     Py_INCREF(__pyx_numpy_ndarray);
35728     return __pyx_numpy_ndarray;
35729 }
35730 
35731 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)35732   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
35733 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35734 #pragma GCC diagnostic push
35735 #pragma GCC diagnostic ignored "-Wconversion"
35736 #endif
35737     const int neg_one = (int) -1, const_zero = (int) 0;
35738 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35739 #pragma GCC diagnostic pop
35740 #endif
35741     const int is_unsigned = neg_one > const_zero;
35742 #if PY_MAJOR_VERSION < 3
35743     if (likely(PyInt_Check(x))) {
35744         if (sizeof(int) < sizeof(long)) {
35745             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
35746         } else {
35747             long val = PyInt_AS_LONG(x);
35748             if (is_unsigned && unlikely(val < 0)) {
35749                 goto raise_neg_overflow;
35750             }
35751             return (int) val;
35752         }
35753     } else
35754 #endif
35755     if (likely(PyLong_Check(x))) {
35756         if (is_unsigned) {
35757 #if CYTHON_USE_PYLONG_INTERNALS
35758             const digit* digits = ((PyLongObject*)x)->ob_digit;
35759             switch (Py_SIZE(x)) {
35760                 case  0: return (int) 0;
35761                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
35762                 case 2:
35763                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
35764                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35765                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35766                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
35767                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35768                         }
35769                     }
35770                     break;
35771                 case 3:
35772                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
35773                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35774                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35775                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
35776                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35777                         }
35778                     }
35779                     break;
35780                 case 4:
35781                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
35782                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35783                             __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])))
35784                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
35785                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35786                         }
35787                     }
35788                     break;
35789             }
35790 #endif
35791 #if CYTHON_COMPILING_IN_CPYTHON
35792             if (unlikely(Py_SIZE(x) < 0)) {
35793                 goto raise_neg_overflow;
35794             }
35795 #else
35796             {
35797                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35798                 if (unlikely(result < 0))
35799                     return (int) -1;
35800                 if (unlikely(result == 1))
35801                     goto raise_neg_overflow;
35802             }
35803 #endif
35804             if (sizeof(int) <= sizeof(unsigned long)) {
35805                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
35806 #ifdef HAVE_LONG_LONG
35807             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
35808                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35809 #endif
35810             }
35811         } else {
35812 #if CYTHON_USE_PYLONG_INTERNALS
35813             const digit* digits = ((PyLongObject*)x)->ob_digit;
35814             switch (Py_SIZE(x)) {
35815                 case  0: return (int) 0;
35816                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
35817                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
35818                 case -2:
35819                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
35820                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35821                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35822                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
35823                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35824                         }
35825                     }
35826                     break;
35827                 case 2:
35828                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
35829                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35830                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35831                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
35832                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35833                         }
35834                     }
35835                     break;
35836                 case -3:
35837                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
35838                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35839                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35840                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
35841                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35842                         }
35843                     }
35844                     break;
35845                 case 3:
35846                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
35847                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35848                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35849                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
35850                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35851                         }
35852                     }
35853                     break;
35854                 case -4:
35855                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
35856                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35857                             __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])))
35858                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
35859                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35860                         }
35861                     }
35862                     break;
35863                 case 4:
35864                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
35865                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35866                             __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])))
35867                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
35868                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35869                         }
35870                     }
35871                     break;
35872             }
35873 #endif
35874             if (sizeof(int) <= sizeof(long)) {
35875                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
35876 #ifdef HAVE_LONG_LONG
35877             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
35878                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
35879 #endif
35880             }
35881         }
35882         {
35883 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
35884             PyErr_SetString(PyExc_RuntimeError,
35885                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
35886 #else
35887             int val;
35888             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
35889  #if PY_MAJOR_VERSION < 3
35890             if (likely(v) && !PyLong_Check(v)) {
35891                 PyObject *tmp = v;
35892                 v = PyNumber_Long(tmp);
35893                 Py_DECREF(tmp);
35894             }
35895  #endif
35896             if (likely(v)) {
35897                 int one = 1; int is_little = (int)*(unsigned char *)&one;
35898                 unsigned char *bytes = (unsigned char *)&val;
35899                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
35900                                               bytes, sizeof(val),
35901                                               is_little, !is_unsigned);
35902                 Py_DECREF(v);
35903                 if (likely(!ret))
35904                     return val;
35905             }
35906 #endif
35907             return (int) -1;
35908         }
35909     } else {
35910         int val;
35911         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35912         if (!tmp) return (int) -1;
35913         val = __Pyx_PyInt_As_int(tmp);
35914         Py_DECREF(tmp);
35915         return val;
35916     }
35917 raise_overflow:
35918     PyErr_SetString(PyExc_OverflowError,
35919         "value too large to convert to int");
35920     return (int) -1;
35921 raise_neg_overflow:
35922     PyErr_SetString(PyExc_OverflowError,
35923         "can't convert negative value to int");
35924     return (int) -1;
35925 }
35926 
35927 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)35928   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
35929 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35930 #pragma GCC diagnostic push
35931 #pragma GCC diagnostic ignored "-Wconversion"
35932 #endif
35933     const long neg_one = (long) -1, const_zero = (long) 0;
35934 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35935 #pragma GCC diagnostic pop
35936 #endif
35937     const int is_unsigned = neg_one > const_zero;
35938 #if PY_MAJOR_VERSION < 3
35939     if (likely(PyInt_Check(x))) {
35940         if (sizeof(long) < sizeof(long)) {
35941             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
35942         } else {
35943             long val = PyInt_AS_LONG(x);
35944             if (is_unsigned && unlikely(val < 0)) {
35945                 goto raise_neg_overflow;
35946             }
35947             return (long) val;
35948         }
35949     } else
35950 #endif
35951     if (likely(PyLong_Check(x))) {
35952         if (is_unsigned) {
35953 #if CYTHON_USE_PYLONG_INTERNALS
35954             const digit* digits = ((PyLongObject*)x)->ob_digit;
35955             switch (Py_SIZE(x)) {
35956                 case  0: return (long) 0;
35957                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
35958                 case 2:
35959                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
35960                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35961                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35962                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
35963                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35964                         }
35965                     }
35966                     break;
35967                 case 3:
35968                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
35969                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35970                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35971                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
35972                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35973                         }
35974                     }
35975                     break;
35976                 case 4:
35977                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
35978                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35979                             __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])))
35980                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
35981                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35982                         }
35983                     }
35984                     break;
35985             }
35986 #endif
35987 #if CYTHON_COMPILING_IN_CPYTHON
35988             if (unlikely(Py_SIZE(x) < 0)) {
35989                 goto raise_neg_overflow;
35990             }
35991 #else
35992             {
35993                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35994                 if (unlikely(result < 0))
35995                     return (long) -1;
35996                 if (unlikely(result == 1))
35997                     goto raise_neg_overflow;
35998             }
35999 #endif
36000             if (sizeof(long) <= sizeof(unsigned long)) {
36001                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
36002 #ifdef HAVE_LONG_LONG
36003             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
36004                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36005 #endif
36006             }
36007         } else {
36008 #if CYTHON_USE_PYLONG_INTERNALS
36009             const digit* digits = ((PyLongObject*)x)->ob_digit;
36010             switch (Py_SIZE(x)) {
36011                 case  0: return (long) 0;
36012                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
36013                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
36014                 case -2:
36015                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
36016                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36017                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36018                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
36019                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36020                         }
36021                     }
36022                     break;
36023                 case 2:
36024                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
36025                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36026                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36027                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
36028                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36029                         }
36030                     }
36031                     break;
36032                 case -3:
36033                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
36034                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36035                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36036                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
36037                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36038                         }
36039                     }
36040                     break;
36041                 case 3:
36042                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
36043                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36044                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36045                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
36046                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36047                         }
36048                     }
36049                     break;
36050                 case -4:
36051                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
36052                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36053                             __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])))
36054                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
36055                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36056                         }
36057                     }
36058                     break;
36059                 case 4:
36060                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
36061                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36062                             __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])))
36063                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
36064                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36065                         }
36066                     }
36067                     break;
36068             }
36069 #endif
36070             if (sizeof(long) <= sizeof(long)) {
36071                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
36072 #ifdef HAVE_LONG_LONG
36073             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
36074                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
36075 #endif
36076             }
36077         }
36078         {
36079 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
36080             PyErr_SetString(PyExc_RuntimeError,
36081                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
36082 #else
36083             long val;
36084             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
36085  #if PY_MAJOR_VERSION < 3
36086             if (likely(v) && !PyLong_Check(v)) {
36087                 PyObject *tmp = v;
36088                 v = PyNumber_Long(tmp);
36089                 Py_DECREF(tmp);
36090             }
36091  #endif
36092             if (likely(v)) {
36093                 int one = 1; int is_little = (int)*(unsigned char *)&one;
36094                 unsigned char *bytes = (unsigned char *)&val;
36095                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
36096                                               bytes, sizeof(val),
36097                                               is_little, !is_unsigned);
36098                 Py_DECREF(v);
36099                 if (likely(!ret))
36100                     return val;
36101             }
36102 #endif
36103             return (long) -1;
36104         }
36105     } else {
36106         long val;
36107         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
36108         if (!tmp) return (long) -1;
36109         val = __Pyx_PyInt_As_long(tmp);
36110         Py_DECREF(tmp);
36111         return val;
36112     }
36113 raise_overflow:
36114     PyErr_SetString(PyExc_OverflowError,
36115         "value too large to convert to long");
36116     return (long) -1;
36117 raise_neg_overflow:
36118     PyErr_SetString(PyExc_OverflowError,
36119         "can't convert negative value to long");
36120     return (long) -1;
36121 }
36122 
36123 /* CIntToPy */
__Pyx_PyInt_From_int(int value)36124   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
36125 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36126 #pragma GCC diagnostic push
36127 #pragma GCC diagnostic ignored "-Wconversion"
36128 #endif
36129     const int neg_one = (int) -1, const_zero = (int) 0;
36130 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36131 #pragma GCC diagnostic pop
36132 #endif
36133     const int is_unsigned = neg_one > const_zero;
36134     if (is_unsigned) {
36135         if (sizeof(int) < sizeof(long)) {
36136             return PyInt_FromLong((long) value);
36137         } else if (sizeof(int) <= sizeof(unsigned long)) {
36138             return PyLong_FromUnsignedLong((unsigned long) value);
36139 #ifdef HAVE_LONG_LONG
36140         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
36141             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
36142 #endif
36143         }
36144     } else {
36145         if (sizeof(int) <= sizeof(long)) {
36146             return PyInt_FromLong((long) value);
36147 #ifdef HAVE_LONG_LONG
36148         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
36149             return PyLong_FromLongLong((PY_LONG_LONG) value);
36150 #endif
36151         }
36152     }
36153     {
36154         int one = 1; int little = (int)*(unsigned char *)&one;
36155         unsigned char *bytes = (unsigned char *)&value;
36156         return _PyLong_FromByteArray(bytes, sizeof(int),
36157                                      little, !is_unsigned);
36158     }
36159 }
36160 
36161 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(PyObject * obj,int writable_flag)36162   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(PyObject *obj, int writable_flag) {
36163     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
36164     __Pyx_BufFmt_StackElem stack[1];
36165     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
36166     int retcode;
36167     if (obj == Py_None) {
36168         result.memview = (struct __pyx_memoryview_obj *) Py_None;
36169         return result;
36170     }
36171     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
36172                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
36173                                                  &__Pyx_TypeInfo_PY_LONG_LONG, stack,
36174                                                  &result, obj);
36175     if (unlikely(retcode == -1))
36176         goto __pyx_fail;
36177     return result;
36178 __pyx_fail:
36179     result.memview = NULL;
36180     result.data = NULL;
36181     return result;
36182 }
36183 
36184 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)36185   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
36186     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
36187     __Pyx_BufFmt_StackElem stack[1];
36188     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
36189     int retcode;
36190     if (obj == Py_None) {
36191         result.memview = (struct __pyx_memoryview_obj *) Py_None;
36192         return result;
36193     }
36194     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
36195                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
36196                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
36197                                                  &result, obj);
36198     if (unlikely(retcode == -1))
36199         goto __pyx_fail;
36200     return result;
36201 __pyx_fail:
36202     result.memview = NULL;
36203     result.data = NULL;
36204     return result;
36205 }
36206 
36207 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)36208   static int __Pyx_check_binary_version(void) {
36209     char ctversion[4], rtversion[4];
36210     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
36211     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
36212     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
36213         char message[200];
36214         PyOS_snprintf(message, sizeof(message),
36215                       "compiletime version %s of module '%.100s' "
36216                       "does not match runtime version %s",
36217                       ctversion, __Pyx_MODULE_NAME, rtversion);
36218         return PyErr_WarnEx(NULL, message, 1);
36219     }
36220     return 0;
36221 }
36222 
36223 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)36224   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
36225     while (t->p) {
36226         #if PY_MAJOR_VERSION < 3
36227         if (t->is_unicode) {
36228             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
36229         } else if (t->intern) {
36230             *t->p = PyString_InternFromString(t->s);
36231         } else {
36232             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
36233         }
36234         #else
36235         if (t->is_unicode | t->is_str) {
36236             if (t->intern) {
36237                 *t->p = PyUnicode_InternFromString(t->s);
36238             } else if (t->encoding) {
36239                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
36240             } else {
36241                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
36242             }
36243         } else {
36244             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
36245         }
36246         #endif
36247         if (!*t->p)
36248             return -1;
36249         if (PyObject_Hash(*t->p) == -1)
36250             return -1;
36251         ++t;
36252     }
36253     return 0;
36254 }
36255 
__Pyx_PyUnicode_FromString(const char * c_str)36256 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
36257     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
36258 }
__Pyx_PyObject_AsString(PyObject * o)36259 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
36260     Py_ssize_t ignore;
36261     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
36262 }
36263 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36264 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)36265 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36266     char* defenc_c;
36267     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
36268     if (!defenc) return NULL;
36269     defenc_c = PyBytes_AS_STRING(defenc);
36270 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36271     {
36272         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
36273         char* c;
36274         for (c = defenc_c; c < end; c++) {
36275             if ((unsigned char) (*c) >= 128) {
36276                 PyUnicode_AsASCIIString(o);
36277                 return NULL;
36278             }
36279         }
36280     }
36281 #endif
36282     *length = PyBytes_GET_SIZE(defenc);
36283     return defenc_c;
36284 }
36285 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)36286 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36287     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
36288 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36289     if (likely(PyUnicode_IS_ASCII(o))) {
36290         *length = PyUnicode_GET_LENGTH(o);
36291         return PyUnicode_AsUTF8(o);
36292     } else {
36293         PyUnicode_AsASCIIString(o);
36294         return NULL;
36295     }
36296 #else
36297     return PyUnicode_AsUTF8AndSize(o, length);
36298 #endif
36299 }
36300 #endif
36301 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)36302 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36303 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36304     if (
36305 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36306             __Pyx_sys_getdefaultencoding_not_ascii &&
36307 #endif
36308             PyUnicode_Check(o)) {
36309         return __Pyx_PyUnicode_AsStringAndSize(o, length);
36310     } else
36311 #endif
36312 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
36313     if (PyByteArray_Check(o)) {
36314         *length = PyByteArray_GET_SIZE(o);
36315         return PyByteArray_AS_STRING(o);
36316     } else
36317 #endif
36318     {
36319         char* result;
36320         int r = PyBytes_AsStringAndSize(o, &result, length);
36321         if (unlikely(r < 0)) {
36322             return NULL;
36323         } else {
36324             return result;
36325         }
36326     }
36327 }
__Pyx_PyObject_IsTrue(PyObject * x)36328 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
36329    int is_true = x == Py_True;
36330    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
36331    else return PyObject_IsTrue(x);
36332 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)36333 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
36334     int retval;
36335     if (unlikely(!x)) return -1;
36336     retval = __Pyx_PyObject_IsTrue(x);
36337     Py_DECREF(x);
36338     return retval;
36339 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)36340 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
36341 #if PY_MAJOR_VERSION >= 3
36342     if (PyLong_Check(result)) {
36343         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
36344                 "__int__ returned non-int (type %.200s).  "
36345                 "The ability to return an instance of a strict subclass of int "
36346                 "is deprecated, and may be removed in a future version of Python.",
36347                 Py_TYPE(result)->tp_name)) {
36348             Py_DECREF(result);
36349             return NULL;
36350         }
36351         return result;
36352     }
36353 #endif
36354     PyErr_Format(PyExc_TypeError,
36355                  "__%.4s__ returned non-%.4s (type %.200s)",
36356                  type_name, type_name, Py_TYPE(result)->tp_name);
36357     Py_DECREF(result);
36358     return NULL;
36359 }
__Pyx_PyNumber_IntOrLong(PyObject * x)36360 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
36361 #if CYTHON_USE_TYPE_SLOTS
36362   PyNumberMethods *m;
36363 #endif
36364   const char *name = NULL;
36365   PyObject *res = NULL;
36366 #if PY_MAJOR_VERSION < 3
36367   if (likely(PyInt_Check(x) || PyLong_Check(x)))
36368 #else
36369   if (likely(PyLong_Check(x)))
36370 #endif
36371     return __Pyx_NewRef(x);
36372 #if CYTHON_USE_TYPE_SLOTS
36373   m = Py_TYPE(x)->tp_as_number;
36374   #if PY_MAJOR_VERSION < 3
36375   if (m && m->nb_int) {
36376     name = "int";
36377     res = m->nb_int(x);
36378   }
36379   else if (m && m->nb_long) {
36380     name = "long";
36381     res = m->nb_long(x);
36382   }
36383   #else
36384   if (likely(m && m->nb_int)) {
36385     name = "int";
36386     res = m->nb_int(x);
36387   }
36388   #endif
36389 #else
36390   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
36391     res = PyNumber_Int(x);
36392   }
36393 #endif
36394   if (likely(res)) {
36395 #if PY_MAJOR_VERSION < 3
36396     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
36397 #else
36398     if (unlikely(!PyLong_CheckExact(res))) {
36399 #endif
36400         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
36401     }
36402   }
36403   else if (!PyErr_Occurred()) {
36404     PyErr_SetString(PyExc_TypeError,
36405                     "an integer is required");
36406   }
36407   return res;
36408 }
36409 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
36410   Py_ssize_t ival;
36411   PyObject *x;
36412 #if PY_MAJOR_VERSION < 3
36413   if (likely(PyInt_CheckExact(b))) {
36414     if (sizeof(Py_ssize_t) >= sizeof(long))
36415         return PyInt_AS_LONG(b);
36416     else
36417         return PyInt_AsSsize_t(b);
36418   }
36419 #endif
36420   if (likely(PyLong_CheckExact(b))) {
36421     #if CYTHON_USE_PYLONG_INTERNALS
36422     const digit* digits = ((PyLongObject*)b)->ob_digit;
36423     const Py_ssize_t size = Py_SIZE(b);
36424     if (likely(__Pyx_sst_abs(size) <= 1)) {
36425         ival = likely(size) ? digits[0] : 0;
36426         if (size == -1) ival = -ival;
36427         return ival;
36428     } else {
36429       switch (size) {
36430          case 2:
36431            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36432              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36433            }
36434            break;
36435          case -2:
36436            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36437              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36438            }
36439            break;
36440          case 3:
36441            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36442              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36443            }
36444            break;
36445          case -3:
36446            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36447              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36448            }
36449            break;
36450          case 4:
36451            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36452              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]));
36453            }
36454            break;
36455          case -4:
36456            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36457              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]));
36458            }
36459            break;
36460       }
36461     }
36462     #endif
36463     return PyLong_AsSsize_t(b);
36464   }
36465   x = PyNumber_Index(b);
36466   if (!x) return -1;
36467   ival = PyInt_AsSsize_t(x);
36468   Py_DECREF(x);
36469   return ival;
36470 }
36471 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
36472   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
36473 }
36474 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
36475     return PyInt_FromSize_t(ival);
36476 }
36477 
36478 
36479 #endif /* Py_PYTHON_H */
36480