Debian Codegraph @

pymusic/pymusic.cpp

raw
1 /* Generated by Cython 0.29.32 */
2
3 /* BEGIN: Cython Metadata
4 {
5 "distutils": {
6 "depends": [
7 "mpi_compat.h",
8 "music/music_c.h",
9 "music/pymusic_c.h"
10 ],
11 "language": "c++",
12 "name": "pymusic",
13 "sources": [
14 "pymusic.pyx"
15 ]
16 },
17 "module_name": "pymusic"
18 }
19 END: Cython Metadata */
20
21 #ifndef PY_SSIZE_T_CLEAN
22 #define PY_SSIZE_T_CLEAN
23 #endif /* PY_SSIZE_T_CLEAN */
24 #include "Python.h"
25 #ifndef Py_PYTHON_H
26 #error Python headers needed to compile C extensions, please install development version of Python.
27 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
28 #error Cython requires Python 2.6+ or Python 3.3+.
29 #else
30 #define CYTHON_ABI "0_29_32"
31 #define CYTHON_HEX_VERSION 0x001D20F0
32 #define CYTHON_FUTURE_DIVISION 0
33 #include <stddef.h>
34 #ifndef offsetof
35 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
36 #endif
37 #if !defined(WIN32) && !defined(MS_WINDOWS)
38 #ifndef __stdcall
39 #define __stdcall
40 #endif
41 #ifndef __cdecl
42 #define __cdecl
43 #endif
44 #ifndef __fastcall
45 #define __fastcall
46 #endif
47 #endif
48 #ifndef DL_IMPORT
49 #define DL_IMPORT(t) t
50 #endif
51 #ifndef DL_EXPORT
52 #define DL_EXPORT(t) t
53 #endif
54 #define __PYX_COMMA ,
55 #ifndef HAVE_LONG_LONG
56 #if PY_VERSION_HEX >= 0x02070000
57 #define HAVE_LONG_LONG
58 #endif
59 #endif
60 #ifndef PY_LONG_LONG
61 #define PY_LONG_LONG LONG_LONG
62 #endif
63 #ifndef Py_HUGE_VAL
64 #define Py_HUGE_VAL HUGE_VAL
65 #endif
66 #ifdef PYPY_VERSION
67 #define CYTHON_COMPILING_IN_PYPY 1
68 #define CYTHON_COMPILING_IN_PYSTON 0
69 #define CYTHON_COMPILING_IN_CPYTHON 0
70 #define CYTHON_COMPILING_IN_NOGIL 0
71 #undef CYTHON_USE_TYPE_SLOTS
72 #define CYTHON_USE_TYPE_SLOTS 0
73 #undef CYTHON_USE_PYTYPE_LOOKUP
74 #define CYTHON_USE_PYTYPE_LOOKUP 0
75 #if PY_VERSION_HEX < 0x03050000
76 #undef CYTHON_USE_ASYNC_SLOTS
77 #define CYTHON_USE_ASYNC_SLOTS 0
78 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
79 #define CYTHON_USE_ASYNC_SLOTS 1
80 #endif
81 #undef CYTHON_USE_PYLIST_INTERNALS
82 #define CYTHON_USE_PYLIST_INTERNALS 0
83 #undef CYTHON_USE_UNICODE_INTERNALS
84 #define CYTHON_USE_UNICODE_INTERNALS 0
85 #undef CYTHON_USE_UNICODE_WRITER
86 #define CYTHON_USE_UNICODE_WRITER 0
87 #undef CYTHON_USE_PYLONG_INTERNALS
88 #define CYTHON_USE_PYLONG_INTERNALS 0
89 #undef CYTHON_AVOID_BORROWED_REFS
90 #define CYTHON_AVOID_BORROWED_REFS 1
91 #undef CYTHON_ASSUME_SAFE_MACROS
92 #define CYTHON_ASSUME_SAFE_MACROS 0
93 #undef CYTHON_UNPACK_METHODS
94 #define CYTHON_UNPACK_METHODS 0
95 #undef CYTHON_FAST_THREAD_STATE
96 #define CYTHON_FAST_THREAD_STATE 0
97 #undef CYTHON_FAST_PYCALL
98 #define CYTHON_FAST_PYCALL 0
99 #undef CYTHON_PEP489_MULTI_PHASE_INIT
100 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
101 #undef CYTHON_USE_TP_FINALIZE
102 #define CYTHON_USE_TP_FINALIZE 0
103 #undef CYTHON_USE_DICT_VERSIONS
104 #define CYTHON_USE_DICT_VERSIONS 0
105 #undef CYTHON_USE_EXC_INFO_STACK
106 #define CYTHON_USE_EXC_INFO_STACK 0
107 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
108 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
109 #endif
110 #elif defined(PYSTON_VERSION)
111 #define CYTHON_COMPILING_IN_PYPY 0
112 #define CYTHON_COMPILING_IN_PYSTON 1
113 #define CYTHON_COMPILING_IN_CPYTHON 0
114 #define CYTHON_COMPILING_IN_NOGIL 0
115 #ifndef CYTHON_USE_TYPE_SLOTS
116 #define CYTHON_USE_TYPE_SLOTS 1
117 #endif
118 #undef CYTHON_USE_PYTYPE_LOOKUP
119 #define CYTHON_USE_PYTYPE_LOOKUP 0
120 #undef CYTHON_USE_ASYNC_SLOTS
121 #define CYTHON_USE_ASYNC_SLOTS 0
122 #undef CYTHON_USE_PYLIST_INTERNALS
123 #define CYTHON_USE_PYLIST_INTERNALS 0
124 #ifndef CYTHON_USE_UNICODE_INTERNALS
125 #define CYTHON_USE_UNICODE_INTERNALS 1
126 #endif
127 #undef CYTHON_USE_UNICODE_WRITER
128 #define CYTHON_USE_UNICODE_WRITER 0
129 #undef CYTHON_USE_PYLONG_INTERNALS
130 #define CYTHON_USE_PYLONG_INTERNALS 0
131 #ifndef CYTHON_AVOID_BORROWED_REFS
132 #define CYTHON_AVOID_BORROWED_REFS 0
133 #endif
134 #ifndef CYTHON_ASSUME_SAFE_MACROS
135 #define CYTHON_ASSUME_SAFE_MACROS 1
136 #endif
137 #ifndef CYTHON_UNPACK_METHODS
138 #define CYTHON_UNPACK_METHODS 1
139 #endif
140 #undef CYTHON_FAST_THREAD_STATE
141 #define CYTHON_FAST_THREAD_STATE 0
142 #undef CYTHON_FAST_PYCALL
143 #define CYTHON_FAST_PYCALL 0
144 #undef CYTHON_PEP489_MULTI_PHASE_INIT
145 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
146 #undef CYTHON_USE_TP_FINALIZE
147 #define CYTHON_USE_TP_FINALIZE 0
148 #undef CYTHON_USE_DICT_VERSIONS
149 #define CYTHON_USE_DICT_VERSIONS 0
150 #undef CYTHON_USE_EXC_INFO_STACK
151 #define CYTHON_USE_EXC_INFO_STACK 0
152 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
153 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
154 #endif
155 #elif defined(PY_NOGIL)
156 #define CYTHON_COMPILING_IN_PYPY 0
157 #define CYTHON_COMPILING_IN_PYSTON 0
158 #define CYTHON_COMPILING_IN_CPYTHON 0
159 #define CYTHON_COMPILING_IN_NOGIL 1
160 #ifndef CYTHON_USE_TYPE_SLOTS
161 #define CYTHON_USE_TYPE_SLOTS 1
162 #endif
163 #undef CYTHON_USE_PYTYPE_LOOKUP
164 #define CYTHON_USE_PYTYPE_LOOKUP 0
165 #ifndef CYTHON_USE_ASYNC_SLOTS
166 #define CYTHON_USE_ASYNC_SLOTS 1
167 #endif
168 #undef CYTHON_USE_PYLIST_INTERNALS
169 #define CYTHON_USE_PYLIST_INTERNALS 0
170 #ifndef CYTHON_USE_UNICODE_INTERNALS
171 #define CYTHON_USE_UNICODE_INTERNALS 1
172 #endif
173 #undef CYTHON_USE_UNICODE_WRITER
174 #define CYTHON_USE_UNICODE_WRITER 0
175 #undef CYTHON_USE_PYLONG_INTERNALS
176 #define CYTHON_USE_PYLONG_INTERNALS 0
177 #ifndef CYTHON_AVOID_BORROWED_REFS
178 #define CYTHON_AVOID_BORROWED_REFS 0
179 #endif
180 #ifndef CYTHON_ASSUME_SAFE_MACROS
181 #define CYTHON_ASSUME_SAFE_MACROS 1
182 #endif
183 #ifndef CYTHON_UNPACK_METHODS
184 #define CYTHON_UNPACK_METHODS 1
185 #endif
186 #undef CYTHON_FAST_THREAD_STATE
187 #define CYTHON_FAST_THREAD_STATE 0
188 #undef CYTHON_FAST_PYCALL
189 #define CYTHON_FAST_PYCALL 0
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
192 #endif
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE 1
195 #endif
196 #undef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS 0
198 #undef CYTHON_USE_EXC_INFO_STACK
199 #define CYTHON_USE_EXC_INFO_STACK 0
200 #else
201 #define CYTHON_COMPILING_IN_PYPY 0
202 #define CYTHON_COMPILING_IN_PYSTON 0
203 #define CYTHON_COMPILING_IN_CPYTHON 1
204 #define CYTHON_COMPILING_IN_NOGIL 0
205 #ifndef CYTHON_USE_TYPE_SLOTS
206 #define CYTHON_USE_TYPE_SLOTS 1
207 #endif
208 #if PY_VERSION_HEX < 0x02070000
209 #undef CYTHON_USE_PYTYPE_LOOKUP
210 #define CYTHON_USE_PYTYPE_LOOKUP 0
211 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
212 #define CYTHON_USE_PYTYPE_LOOKUP 1
213 #endif
214 #if PY_MAJOR_VERSION < 3
215 #undef CYTHON_USE_ASYNC_SLOTS
216 #define CYTHON_USE_ASYNC_SLOTS 0
217 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
218 #define CYTHON_USE_ASYNC_SLOTS 1
219 #endif
220 #if PY_VERSION_HEX < 0x02070000
221 #undef CYTHON_USE_PYLONG_INTERNALS
222 #define CYTHON_USE_PYLONG_INTERNALS 0
223 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
224 #define CYTHON_USE_PYLONG_INTERNALS 1
225 #endif
226 #ifndef CYTHON_USE_PYLIST_INTERNALS
227 #define CYTHON_USE_PYLIST_INTERNALS 1
228 #endif
229 #ifndef CYTHON_USE_UNICODE_INTERNALS
230 #define CYTHON_USE_UNICODE_INTERNALS 1
231 #endif
232 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
233 #undef CYTHON_USE_UNICODE_WRITER
234 #define CYTHON_USE_UNICODE_WRITER 0
235 #elif !defined(CYTHON_USE_UNICODE_WRITER)
236 #define CYTHON_USE_UNICODE_WRITER 1
237 #endif
238 #ifndef CYTHON_AVOID_BORROWED_REFS
239 #define CYTHON_AVOID_BORROWED_REFS 0
240 #endif
241 #ifndef CYTHON_ASSUME_SAFE_MACROS
242 #define CYTHON_ASSUME_SAFE_MACROS 1
243 #endif
244 #ifndef CYTHON_UNPACK_METHODS
245 #define CYTHON_UNPACK_METHODS 1
246 #endif
247 #if PY_VERSION_HEX >= 0x030B00A4
248 #undef CYTHON_FAST_THREAD_STATE
249 #define CYTHON_FAST_THREAD_STATE 0
250 #elif !defined(CYTHON_FAST_THREAD_STATE)
251 #define CYTHON_FAST_THREAD_STATE 1
252 #endif
253 #ifndef CYTHON_FAST_PYCALL
254 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
255 #endif
256 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
257 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
258 #endif
259 #ifndef CYTHON_USE_TP_FINALIZE
260 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
261 #endif
262 #ifndef CYTHON_USE_DICT_VERSIONS
263 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
264 #endif
265 #if PY_VERSION_HEX >= 0x030B00A4
266 #undef CYTHON_USE_EXC_INFO_STACK
267 #define CYTHON_USE_EXC_INFO_STACK 0
268 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
269 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
270 #endif
271 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
272 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
273 #endif
274 #endif
275 #if !defined(CYTHON_FAST_PYCCALL)
276 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
277 #endif
278 #if CYTHON_USE_PYLONG_INTERNALS
279 #if PY_MAJOR_VERSION < 3
280 #include "longintrepr.h"
281 #endif
282 #undef SHIFT
283 #undef BASE
284 #undef MASK
285 #ifdef SIZEOF_VOID_P
286 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
287 #endif
288 #endif
289 #ifndef __has_attribute
290 #define __has_attribute(x) 0
291 #endif
292 #ifndef __has_cpp_attribute
293 #define __has_cpp_attribute(x) 0
294 #endif
295 #ifndef CYTHON_RESTRICT
296 #if defined(__GNUC__)
297 #define CYTHON_RESTRICT __restrict__
298 #elif defined(_MSC_VER) && _MSC_VER >= 1400
299 #define CYTHON_RESTRICT __restrict
300 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
301 #define CYTHON_RESTRICT restrict
302 #else
303 #define CYTHON_RESTRICT
304 #endif
305 #endif
306 #ifndef CYTHON_UNUSED
307 # if defined(__GNUC__)
308 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
309 # define CYTHON_UNUSED __attribute__ ((__unused__))
310 # else
311 # define CYTHON_UNUSED
312 # endif
313 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
314 # define CYTHON_UNUSED __attribute__ ((__unused__))
315 # else
316 # define CYTHON_UNUSED
317 # endif
318 #endif
319 #ifndef CYTHON_MAYBE_UNUSED_VAR
320 # if defined(__cplusplus)
321 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
322 # else
323 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
324 # endif
325 #endif
326 #ifndef CYTHON_NCP_UNUSED
327 # if CYTHON_COMPILING_IN_CPYTHON
328 # define CYTHON_NCP_UNUSED
329 # else
330 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
331 # endif
332 #endif
333 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
334 #ifdef _MSC_VER
335 #ifndef _MSC_STDINT_H_
336 #if _MSC_VER < 1300
337 typedef unsigned char uint8_t;
338 typedef unsigned int uint32_t;
339 #else
340 typedef unsigned __int8 uint8_t;
341 typedef unsigned __int32 uint32_t;
342 #endif
343 #endif
344 #else
345 #include <stdint.h>
346 #endif
347 #ifndef CYTHON_FALLTHROUGH
348 #if defined(__cplusplus) && __cplusplus >= 201103L
349 #if __has_cpp_attribute(fallthrough)
350 #define CYTHON_FALLTHROUGH [[fallthrough]]
351 #elif __has_cpp_attribute(clang::fallthrough)
352 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
353 #elif __has_cpp_attribute(gnu::fallthrough)
354 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
355 #endif
356 #endif
357 #ifndef CYTHON_FALLTHROUGH
358 #if __has_attribute(fallthrough)
359 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
360 #else
361 #define CYTHON_FALLTHROUGH
362 #endif
363 #endif
364 #if defined(__clang__ ) && defined(__apple_build_version__)
365 #if __apple_build_version__ < 7000000
366 #undef CYTHON_FALLTHROUGH
367 #define CYTHON_FALLTHROUGH
368 #endif
369 #endif
370 #endif
371
372 #ifndef __cplusplus
373 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
374 #endif
375 #ifndef CYTHON_INLINE
376 #if defined(__clang__)
377 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
378 #else
379 #define CYTHON_INLINE inline
380 #endif
381 #endif
382 template<typename T>
383 void __Pyx_call_destructor(T& x) {
384 x.~T();
385 }
386 template<typename T>
387 class __Pyx_FakeReference {
388 public:
389 __Pyx_FakeReference() : ptr(NULL) { }
390 __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
391 T *operator->() { return ptr; }
392 T *operator&() { return ptr; }
393 operator T&() { return *ptr; }
394 template<typename U> bool operator ==(U other) { return *ptr == other; }
395 template<typename U> bool operator !=(U other) { return *ptr != other; }
396 private:
397 T *ptr;
398 };
399
400 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
401 #define Py_OptimizeFlag 0
402 #endif
403 #define __PYX_BUILD_PY_SSIZE_T "n"
404 #define CYTHON_FORMAT_SSIZE_T "z"
405 #if PY_MAJOR_VERSION < 3
406 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
407 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
408 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
409 #define __Pyx_DefaultClassType PyClass_Type
410 #else
411 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
412 #define __Pyx_DefaultClassType PyType_Type
413 #if PY_VERSION_HEX >= 0x030B00A1
414 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
415 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
416 PyObject *fv, PyObject *cell, PyObject* fn,
417 PyObject *name, int fline, PyObject *lnos) {
418 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
419 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
420 const char *fn_cstr=NULL;
421 const char *name_cstr=NULL;
422 PyCodeObject* co=NULL;
423 PyObject *type, *value, *traceback;
424 PyErr_Fetch(&type, &value, &traceback);
425 if (!(kwds=PyDict_New())) goto end;
426 if (!(argcount=PyLong_FromLong(a))) goto end;
427 if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
428 if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
429 if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
430 if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
431 if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
432 if (!(nlocals=PyLong_FromLong(l))) goto end;
433 if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
434 if (!(stacksize=PyLong_FromLong(s))) goto end;
435 if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
436 if (!(flags=PyLong_FromLong(f))) goto end;
437 if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
438 if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
439 if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
440 if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
441 if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
442 if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
443 if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
444 if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
445 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
446 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
447 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
448 if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
449 if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
450 if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
451 Py_XDECREF((PyObject*)co);
452 co = (PyCodeObject*)call_result;
453 call_result = NULL;
454 if (0) {
455 cleanup_code_too:
456 Py_XDECREF((PyObject*)co);
457 co = NULL;
458 }
459 end:
460 Py_XDECREF(kwds);
461 Py_XDECREF(argcount);
462 Py_XDECREF(posonlyargcount);
463 Py_XDECREF(kwonlyargcount);
464 Py_XDECREF(nlocals);
465 Py_XDECREF(stacksize);
466 Py_XDECREF(replace);
467 Py_XDECREF(call_result);
468 Py_XDECREF(empty);
469 if (type) {
470 PyErr_Restore(type, value, traceback);
471 }
472 return co;
473 }
474 #else
475 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
476 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
477 #endif
478 #define __Pyx_DefaultClassType PyType_Type
479 #endif
480 #ifndef Py_TPFLAGS_CHECKTYPES
481 #define Py_TPFLAGS_CHECKTYPES 0
482 #endif
483 #ifndef Py_TPFLAGS_HAVE_INDEX
484 #define Py_TPFLAGS_HAVE_INDEX 0
485 #endif
486 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
487 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
488 #endif
489 #ifndef Py_TPFLAGS_HAVE_FINALIZE
490 #define Py_TPFLAGS_HAVE_FINALIZE 0
491 #endif
492 #ifndef METH_STACKLESS
493 #define METH_STACKLESS 0
494 #endif
495 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
496 #ifndef METH_FASTCALL
497 #define METH_FASTCALL 0x80
498 #endif
499 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
500 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
501 Py_ssize_t nargs, PyObject *kwnames);
502 #else
503 #define __Pyx_PyCFunctionFast _PyCFunctionFast
504 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
505 #endif
506 #if CYTHON_FAST_PYCCALL
507 #define __Pyx_PyFastCFunction_Check(func)\
508 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
509 #else
510 #define __Pyx_PyFastCFunction_Check(func) 0
511 #endif
512 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
513 #define PyObject_Malloc(s) PyMem_Malloc(s)
514 #define PyObject_Free(p) PyMem_Free(p)
515 #define PyObject_Realloc(p) PyMem_Realloc(p)
516 #endif
517 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
518 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
519 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
520 #define PyMem_RawFree(p) PyMem_Free(p)
521 #endif
522 #if CYTHON_COMPILING_IN_PYSTON
523 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
524 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
525 #else
526 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
527 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
528 #endif
529 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
530 #define __Pyx_PyThreadState_Current PyThreadState_GET()
531 #elif PY_VERSION_HEX >= 0x03060000
532 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
533 #elif PY_VERSION_HEX >= 0x03000000
534 #define __Pyx_PyThreadState_Current PyThreadState_GET()
535 #else
536 #define __Pyx_PyThreadState_Current _PyThreadState_Current
537 #endif
538 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
539 #include "pythread.h"
540 #define Py_tss_NEEDS_INIT 0
541 typedef int Py_tss_t;
542 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
543 *key = PyThread_create_key();
544 return 0;
545 }
546 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
547 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
548 *key = Py_tss_NEEDS_INIT;
549 return key;
550 }
551 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
552 PyObject_Free(key);
553 }
554 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
555 return *key != Py_tss_NEEDS_INIT;
556 }
557 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
558 PyThread_delete_key(*key);
559 *key = Py_tss_NEEDS_INIT;
560 }
561 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
562 return PyThread_set_key_value(*key, value);
563 }
564 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
565 return PyThread_get_key_value(*key);
566 }
567 #endif
568 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
569 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
570 #else
571 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
572 #endif
573 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
574 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
575 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
576 #else
577 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
578 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
579 #endif
580 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
581 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
582 #else
583 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
584 #endif
585 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
586 #define CYTHON_PEP393_ENABLED 1
587 #if defined(PyUnicode_IS_READY)
588 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
589 0 : _PyUnicode_Ready((PyObject *)(op)))
590 #else
591 #define __Pyx_PyUnicode_READY(op) (0)
592 #endif
593 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
594 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
595 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
596 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
597 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
598 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
599 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
600 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
601 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
602 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
603 #else
604 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
605 #endif
606 #else
607 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
608 #endif
609 #else
610 #define CYTHON_PEP393_ENABLED 0
611 #define PyUnicode_1BYTE_KIND 1
612 #define PyUnicode_2BYTE_KIND 2
613 #define PyUnicode_4BYTE_KIND 4
614 #define __Pyx_PyUnicode_READY(op) (0)
615 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
616 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
617 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
618 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
619 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
620 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
621 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
622 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
623 #endif
624 #if CYTHON_COMPILING_IN_PYPY
625 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
626 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
627 #else
628 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
629 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
630 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
631 #endif
632 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
633 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
634 #endif
635 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
636 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
637 #endif
638 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
639 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
640 #endif
641 #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))
642 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
643 #if PY_MAJOR_VERSION >= 3
644 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
645 #else
646 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
647 #endif
648 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
649 #define PyObject_ASCII(o) PyObject_Repr(o)
650 #endif
651 #if PY_MAJOR_VERSION >= 3
652 #define PyBaseString_Type PyUnicode_Type
653 #define PyStringObject PyUnicodeObject
654 #define PyString_Type PyUnicode_Type
655 #define PyString_Check PyUnicode_Check
656 #define PyString_CheckExact PyUnicode_CheckExact
657 #ifndef PyObject_Unicode
658 #define PyObject_Unicode PyObject_Str
659 #endif
660 #endif
661 #if PY_MAJOR_VERSION >= 3
662 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
663 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
664 #else
665 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
666 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
667 #endif
668 #ifndef PySet_CheckExact
669 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
670 #endif
671 #if PY_VERSION_HEX >= 0x030900A4
672 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
673 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
674 #else
675 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
676 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
677 #endif
678 #if CYTHON_ASSUME_SAFE_MACROS
679 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
680 #else
681 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
682 #endif
683 #if PY_MAJOR_VERSION >= 3
684 #define PyIntObject PyLongObject
685 #define PyInt_Type PyLong_Type
686 #define PyInt_Check(op) PyLong_Check(op)
687 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
688 #define PyInt_FromString PyLong_FromString
689 #define PyInt_FromUnicode PyLong_FromUnicode
690 #define PyInt_FromLong PyLong_FromLong
691 #define PyInt_FromSize_t PyLong_FromSize_t
692 #define PyInt_FromSsize_t PyLong_FromSsize_t
693 #define PyInt_AsLong PyLong_AsLong
694 #define PyInt_AS_LONG PyLong_AS_LONG
695 #define PyInt_AsSsize_t PyLong_AsSsize_t
696 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
697 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
698 #define PyNumber_Int PyNumber_Long
699 #endif
700 #if PY_MAJOR_VERSION >= 3
701 #define PyBoolObject PyLongObject
702 #endif
703 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
704 #ifndef PyUnicode_InternFromString
705 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
706 #endif
707 #endif
708 #if PY_VERSION_HEX < 0x030200A4
709 typedef long Py_hash_t;
710 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
711 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
712 #else
713 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
714 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
715 #endif
716 #if PY_MAJOR_VERSION >= 3
717 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
718 #else
719 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
720 #endif
721 #if CYTHON_USE_ASYNC_SLOTS
722 #if PY_VERSION_HEX >= 0x030500B1
723 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
724 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
725 #else
726 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
727 #endif
728 #else
729 #define __Pyx_PyType_AsAsync(obj) NULL
730 #endif
731 #ifndef __Pyx_PyAsyncMethodsStruct
732 typedef struct {
733 unaryfunc am_await;
734 unaryfunc am_aiter;
735 unaryfunc am_anext;
736 } __Pyx_PyAsyncMethodsStruct;
737 #endif
738
739 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
740 #if !defined(_USE_MATH_DEFINES)
741 #define _USE_MATH_DEFINES
742 #endif
743 #endif
744 #include <math.h>
745 #ifdef NAN
746 #define __PYX_NAN() ((float) NAN)
747 #else
748 static CYTHON_INLINE float __PYX_NAN() {
749 float value;
750 memset(&value, 0xFF, sizeof(value));
751 return value;
752 }
753 #endif
754 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
755 #define __Pyx_truncl trunc
756 #else
757 #define __Pyx_truncl truncl
758 #endif
759
760 #define __PYX_MARK_ERR_POS(f_index, lineno) \
761 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
762 #define __PYX_ERR(f_index, lineno, Ln_error) \
763 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
764
765 #ifndef __PYX_EXTERN_C
766 #ifdef __cplusplus
767 #define __PYX_EXTERN_C extern "C"
768 #else
769 #define __PYX_EXTERN_C extern
770 #endif
771 #endif
772
773 #define __PYX_HAVE__pymusic
774 #define __PYX_HAVE_API__pymusic
775 /* Early includes */
776 #include "mpi_compat.h"
777 #include "mpi.h"
778 #include <string.h>
779 #include <string>
780 #include "ios"
781 #include "new"
782 #include "stdexcept"
783 #include "typeinfo"
784 #include <stdio.h>
785 #include "music/predict_rank.hh"
786 #include "music/message.hh"
787 #include "music/music_c.h"
788 #include "music/event.hh"
789 #include "music/data_map.hh"
790 #include "music/index_map.hh"
791 #include "music/permutation_index.hh"
792 #include "music/linear_index.hh"
793 #include "music/array_data.hh"
794 #include "music/port.hh"
795 #include "music/setup.hh"
796 #include "music/runtime.hh"
797 #include "music/pymusic_c.h"
798 #include <stdlib.h>
799 #include "pythread.h"
800 #ifdef _OPENMP
801 #include <omp.h>
802 #endif /* _OPENMP */
803
804 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
805 #define CYTHON_WITHOUT_ASSERTIONS
806 #endif
807
808 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
809 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
810
811 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
812 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
813 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 1
814 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
815 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
816 #define __Pyx_uchar_cast(c) ((unsigned char)c)
817 #define __Pyx_long_cast(x) ((long)x)
818 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
819 (sizeof(type) < sizeof(Py_ssize_t)) ||\
820 (sizeof(type) > sizeof(Py_ssize_t) &&\
821 likely(v < (type)PY_SSIZE_T_MAX ||\
822 v == (type)PY_SSIZE_T_MAX) &&\
823 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
824 v == (type)PY_SSIZE_T_MIN))) ||\
825 (sizeof(type) == sizeof(Py_ssize_t) &&\
826 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
827 v == (type)PY_SSIZE_T_MAX))) )
828 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
829 return (size_t) i < (size_t) limit;
830 }
831 #if defined (__cplusplus) && __cplusplus >= 201103L
832 #include <cstdlib>
833 #define __Pyx_sst_abs(value) std::abs(value)
834 #elif SIZEOF_INT >= SIZEOF_SIZE_T
835 #define __Pyx_sst_abs(value) abs(value)
836 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
837 #define __Pyx_sst_abs(value) labs(value)
838 #elif defined (_MSC_VER)
839 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
840 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
841 #define __Pyx_sst_abs(value) llabs(value)
842 #elif defined (__GNUC__)
843 #define __Pyx_sst_abs(value) __builtin_llabs(value)
844 #else
845 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
846 #endif
847 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
848 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
849 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
850 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
851 #define __Pyx_PyBytes_FromString PyBytes_FromString
852 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
853 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
854 #if PY_MAJOR_VERSION < 3
855 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
856 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
857 #else
858 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
859 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
860 #endif
861 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
862 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
863 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
864 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
865 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
866 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
867 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
868 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
869 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
870 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
871 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
872 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
873 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
874 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
875 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
876 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
877 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
878 const Py_UNICODE *u_end = u;
879 while (*u_end++) ;
880 return (size_t)(u_end - u - 1);
881 }
882 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
883 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
884 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
885 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
886 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
887 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
888 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
889 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
890 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
891 #define __Pyx_PySequence_Tuple(obj)\
892 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
893 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
894 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
895 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
896 #if CYTHON_ASSUME_SAFE_MACROS
897 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
898 #else
899 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
900 #endif
901 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
902 #if PY_MAJOR_VERSION >= 3
903 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
904 #else
905 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
906 #endif
907 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
908 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
909 static int __Pyx_sys_getdefaultencoding_not_ascii;
910 static int __Pyx_init_sys_getdefaultencoding_params(void) {
911 PyObject* sys;
912 PyObject* default_encoding = NULL;
913 PyObject* ascii_chars_u = NULL;
914 PyObject* ascii_chars_b = NULL;
915 const char* default_encoding_c;
916 sys = PyImport_ImportModule("sys");
917 if (!sys) goto bad;
918 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
919 Py_DECREF(sys);
920 if (!default_encoding) goto bad;
921 default_encoding_c = PyBytes_AsString(default_encoding);
922 if (!default_encoding_c) goto bad;
923 if (strcmp(default_encoding_c, "ascii") == 0) {
924 __Pyx_sys_getdefaultencoding_not_ascii = 0;
925 } else {
926 char ascii_chars[128];
927 int c;
928 for (c = 0; c < 128; c++) {
929 ascii_chars[c] = c;
930 }
931 __Pyx_sys_getdefaultencoding_not_ascii = 1;
932 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
933 if (!ascii_chars_u) goto bad;
934 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
935 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
936 PyErr_Format(
937 PyExc_ValueError,
938 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
939 default_encoding_c);
940 goto bad;
941 }
942 Py_DECREF(ascii_chars_u);
943 Py_DECREF(ascii_chars_b);
944 }
945 Py_DECREF(default_encoding);
946 return 0;
947 bad:
948 Py_XDECREF(default_encoding);
949 Py_XDECREF(ascii_chars_u);
950 Py_XDECREF(ascii_chars_b);
951 return -1;
952 }
953 #endif
954 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
955 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
956 #else
957 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
958 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
959 static char* __PYX_DEFAULT_STRING_ENCODING;
960 static int __Pyx_init_sys_getdefaultencoding_params(void) {
961 PyObject* sys;
962 PyObject* default_encoding = NULL;
963 char* default_encoding_c;
964 sys = PyImport_ImportModule("sys");
965 if (!sys) goto bad;
966 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
967 Py_DECREF(sys);
968 if (!default_encoding) goto bad;
969 default_encoding_c = PyBytes_AsString(default_encoding);
970 if (!default_encoding_c) goto bad;
971 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
972 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
973 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
974 Py_DECREF(default_encoding);
975 return 0;
976 bad:
977 Py_XDECREF(default_encoding);
978 return -1;
979 }
980 #endif
981 #endif
982
983
984 /* Test for GCC > 2.95 */
985 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
986 #define likely(x) __builtin_expect(!!(x), 1)
987 #define unlikely(x) __builtin_expect(!!(x), 0)
988 #else /* !__GNUC__ or GCC < 2.95 */
989 #define likely(x) (x)
990 #define unlikely(x) (x)
991 #endif /* __GNUC__ */
992 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
993
994 static PyObject *__pyx_m = NULL;
995 static PyObject *__pyx_d;
996 static PyObject *__pyx_b;
997 static PyObject *__pyx_cython_runtime = NULL;
998 static PyObject *__pyx_empty_tuple;
999 static PyObject *__pyx_empty_bytes;
1000 static PyObject *__pyx_empty_unicode;
1001 static int __pyx_lineno;
1002 static int __pyx_clineno = 0;
1003 static const char * __pyx_cfilenm= __FILE__;
1004 static const char *__pyx_filename;
1005
1006
1007 static const char *__pyx_f[] = {
1008 "pymusic.pyx",
1009 "stringsource",
1010 "array.pxd",
1011 "MPI.pxd",
1012 "type.pxd",
1013 "bool.pxd",
1014 "complex.pxd",
1015 "music/pybuffer.pxd",
1016 };
1017
1018 /*--- Type declarations ---*/
1019 #ifndef _ARRAYARRAY_H
1020 struct arrayobject;
1021 typedef struct arrayobject arrayobject;
1022 #endif
1023 struct PyMPIDatatypeObject;
1024 struct PyMPIStatusObject;
1025 struct PyMPIRequestObject;
1026 struct PyMPIPrequestObject;
1027 struct PyMPIGrequestObject;
1028 struct PyMPIMessageObject;
1029 struct PyMPIOpObject;
1030 struct PyMPIGroupObject;
1031 struct PyMPIInfoObject;
1032 struct PyMPIErrhandlerObject;
1033 struct PyMPICommObject;
1034 struct PyMPIIntracommObject;
1035 struct PyMPITopocommObject;
1036 struct PyMPICartcommObject;
1037 struct PyMPIGraphcommObject;
1038 struct PyMPIDistgraphcommObject;
1039 struct PyMPIIntercommObject;
1040 struct PyMPIWinObject;
1041 struct PyMPIFileObject;
1042 struct __pyx_obj_5music_8pybuffer_Buffer;
1043 struct __pyx_obj_7pymusic_Setup;
1044 struct __pyx_obj_7pymusic_Runtime;
1045 struct __pyx_obj_7pymusic_Port;
1046 struct __pyx_obj_7pymusic_ContInputPort;
1047 struct __pyx_obj_7pymusic_ContOutputPort;
1048 struct __pyx_obj_7pymusic_EventInputPort;
1049 struct __pyx_obj_7pymusic_EventOutputPort;
1050 struct __pyx_obj_7pymusic_MessageInputPort;
1051 struct __pyx_obj_7pymusic_MessageOutputPort;
1052 struct __pyx_obj_7pymusic_DataMap;
1053 struct __pyx_obj_7pymusic_IndexMap;
1054 struct __pyx_obj_7pymusic_EventHandler;
1055 struct __pyx_obj_7pymusic_MessageHandler;
1056 struct __pyx_obj_7pymusic__Index;
1057 struct __pyx_obj_7pymusic___pyx_scope_struct____iter__;
1058 struct __pyx_t_7pymusic_Args;
1059 typedef struct __pyx_t_7pymusic_Args __pyx_t_7pymusic_Args;
1060
1061 /* "pymusic.pyx":48
1062 * # argv = [exec, op[1], ..., op[argc-1], NULL]
1063 * # """
1064 * ctypedef struct Args: # <<<<<<<<<<<<<<
1065 * int argc
1066 * char** argv
1067 */
1068 struct __pyx_t_7pymusic_Args {
1069 int argc;
1070 char **argv;
1071 };
1072
1073 /* "mpi4py/MPI.pxd":28
1074 * ctypedef MPI_Count Count "MPI_Count"
1075 *
1076 * ctypedef public api class Datatype [ # <<<<<<<<<<<<<<
1077 * type PyMPIDatatype_Type,
1078 * object PyMPIDatatypeObject,
1079 */
1080 struct PyMPIDatatypeObject {
1081 PyObject_HEAD
1082 MPI_Datatype ob_mpi;
1083 unsigned int flags;
1084 PyObject *__weakref__;
1085 };
1086 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1087
1088 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1089
1090 /* "mpi4py/MPI.pxd":36
1091 * cdef object __weakref__
1092 *
1093 * ctypedef public api class Status [ # <<<<<<<<<<<<<<
1094 * type PyMPIStatus_Type,
1095 * object PyMPIStatusObject,
1096 */
1097 struct PyMPIStatusObject {
1098 PyObject_HEAD
1099 MPI_Status ob_mpi;
1100 unsigned int flags;
1101 PyObject *__weakref__;
1102 };
1103 typedef struct PyMPIStatusObject PyMPIStatusObject;
1104
1105 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1106
1107 /* "mpi4py/MPI.pxd":44
1108 * cdef object __weakref__
1109 *
1110 * ctypedef public api class Request [ # <<<<<<<<<<<<<<
1111 * type PyMPIRequest_Type,
1112 * object PyMPIRequestObject,
1113 */
1114 struct PyMPIRequestObject {
1115 PyObject_HEAD
1116 MPI_Request ob_mpi;
1117 unsigned int flags;
1118 PyObject *__weakref__;
1119 PyObject *ob_buf;
1120 };
1121 typedef struct PyMPIRequestObject PyMPIRequestObject;
1122
1123 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1124
1125 /* "mpi4py/MPI.pxd":53
1126 * cdef object ob_buf
1127 *
1128 * ctypedef public api class Prequest(Request) [ # <<<<<<<<<<<<<<
1129 * type PyMPIPrequest_Type,
1130 * object PyMPIPrequestObject,
1131 */
1132 struct PyMPIPrequestObject {
1133 struct PyMPIRequestObject __pyx_base;
1134 };
1135 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1136
1137 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1138
1139 /* "mpi4py/MPI.pxd":59
1140 * pass
1141 *
1142 * ctypedef public api class Grequest(Request) [ # <<<<<<<<<<<<<<
1143 * type PyMPIGrequest_Type,
1144 * object PyMPIGrequestObject,
1145 */
1146 struct PyMPIGrequestObject {
1147 struct PyMPIRequestObject __pyx_base;
1148 MPI_Request ob_grequest;
1149 };
1150 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1151
1152 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1153
1154 /* "mpi4py/MPI.pxd":65
1155 * cdef MPI_Request ob_grequest
1156 *
1157 * ctypedef public api class Message [ # <<<<<<<<<<<<<<
1158 * type PyMPIMessage_Type,
1159 * object PyMPIMessageObject,
1160 */
1161 struct PyMPIMessageObject {
1162 PyObject_HEAD
1163 MPI_Message ob_mpi;
1164 unsigned int flags;
1165 PyObject *__weakref__;
1166 PyObject *ob_buf;
1167 };
1168 typedef struct PyMPIMessageObject PyMPIMessageObject;
1169
1170 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1171
1172 /* "mpi4py/MPI.pxd":74
1173 * cdef object ob_buf
1174 *
1175 * ctypedef public api class Op [ # <<<<<<<<<<<<<<
1176 * type PyMPIOp_Type,
1177 * object PyMPIOpObject,
1178 */
1179 struct PyMPIOpObject {
1180 PyObject_HEAD
1181 MPI_Op ob_mpi;
1182 unsigned int flags;
1183 PyObject *__weakref__;
1184 PyObject *(*ob_func)(PyObject *, PyObject *);
1185 int ob_usrid;
1186 };
1187 typedef struct PyMPIOpObject PyMPIOpObject;
1188
1189 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1190
1191 /* "mpi4py/MPI.pxd":84
1192 * cdef int ob_usrid
1193 *
1194 * ctypedef public api class Group [ # <<<<<<<<<<<<<<
1195 * type PyMPIGroup_Type,
1196 * object PyMPIGroupObject,
1197 */
1198 struct PyMPIGroupObject {
1199 PyObject_HEAD
1200 MPI_Group ob_mpi;
1201 unsigned int flags;
1202 PyObject *__weakref__;
1203 };
1204 typedef struct PyMPIGroupObject PyMPIGroupObject;
1205
1206 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1207
1208 /* "mpi4py/MPI.pxd":92
1209 * cdef object __weakref__
1210 *
1211 * ctypedef public api class Info [ # <<<<<<<<<<<<<<
1212 * type PyMPIInfo_Type,
1213 * object PyMPIInfoObject,
1214 */
1215 struct PyMPIInfoObject {
1216 PyObject_HEAD
1217 MPI_Info ob_mpi;
1218 unsigned int flags;
1219 PyObject *__weakref__;
1220 };
1221 typedef struct PyMPIInfoObject PyMPIInfoObject;
1222
1223 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1224
1225 /* "mpi4py/MPI.pxd":100
1226 * cdef object __weakref__
1227 *
1228 * ctypedef public api class Errhandler [ # <<<<<<<<<<<<<<
1229 * type PyMPIErrhandler_Type,
1230 * object PyMPIErrhandlerObject,
1231 */
1232 struct PyMPIErrhandlerObject {
1233 PyObject_HEAD
1234 MPI_Errhandler ob_mpi;
1235 unsigned int flags;
1236 PyObject *__weakref__;
1237 };
1238 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1239
1240 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1241
1242 /* "mpi4py/MPI.pxd":108
1243 * cdef object __weakref__
1244 *
1245 * ctypedef public api class Comm [ # <<<<<<<<<<<<<<
1246 * type PyMPIComm_Type,
1247 * object PyMPICommObject,
1248 */
1249 struct PyMPICommObject {
1250 PyObject_HEAD
1251 MPI_Comm ob_mpi;
1252 unsigned int flags;
1253 PyObject *__weakref__;
1254 };
1255 typedef struct PyMPICommObject PyMPICommObject;
1256
1257 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1258
1259 /* "mpi4py/MPI.pxd":116
1260 * cdef object __weakref__
1261 *
1262 * ctypedef public api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
1263 * type PyMPIIntracomm_Type,
1264 * object PyMPIIntracommObject,
1265 */
1266 struct PyMPIIntracommObject {
1267 struct PyMPICommObject __pyx_base;
1268 };
1269 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1270
1271 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1272
1273 /* "mpi4py/MPI.pxd":122
1274 * pass
1275 *
1276 * ctypedef public api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
1277 * type PyMPITopocomm_Type,
1278 * object PyMPITopocommObject,
1279 */
1280 struct PyMPITopocommObject {
1281 struct PyMPIIntracommObject __pyx_base;
1282 };
1283 typedef struct PyMPITopocommObject PyMPITopocommObject;
1284
1285 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1286
1287 /* "mpi4py/MPI.pxd":128
1288 * pass
1289 *
1290 * ctypedef public api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
1291 * type PyMPICartcomm_Type,
1292 * object PyMPICartcommObject,
1293 */
1294 struct PyMPICartcommObject {
1295 struct PyMPITopocommObject __pyx_base;
1296 };
1297 typedef struct PyMPICartcommObject PyMPICartcommObject;
1298
1299 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1300
1301 /* "mpi4py/MPI.pxd":134
1302 * pass
1303 *
1304 * ctypedef public api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1305 * type PyMPIGraphcomm_Type,
1306 * object PyMPIGraphcommObject,
1307 */
1308 struct PyMPIGraphcommObject {
1309 struct PyMPITopocommObject __pyx_base;
1310 };
1311 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1312
1313 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1314
1315 /* "mpi4py/MPI.pxd":140
1316 * pass
1317 *
1318 * ctypedef public api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1319 * type PyMPIDistgraphcomm_Type,
1320 * object PyMPIDistgraphcommObject,
1321 */
1322 struct PyMPIDistgraphcommObject {
1323 struct PyMPITopocommObject __pyx_base;
1324 };
1325 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1326
1327 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1328
1329 /* "mpi4py/MPI.pxd":146
1330 * pass
1331 *
1332 * ctypedef public api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
1333 * type PyMPIIntercomm_Type,
1334 * object PyMPIIntercommObject,
1335 */
1336 struct PyMPIIntercommObject {
1337 struct PyMPICommObject __pyx_base;
1338 };
1339 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1340
1341 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1342
1343 /* "mpi4py/MPI.pxd":152
1344 * pass
1345 *
1346 * ctypedef public api class Win [ # <<<<<<<<<<<<<<
1347 * type PyMPIWin_Type,
1348 * object PyMPIWinObject,
1349 */
1350 struct PyMPIWinObject {
1351 PyObject_HEAD
1352 MPI_Win ob_mpi;
1353 unsigned int flags;
1354 PyObject *__weakref__;
1355 PyObject *ob_mem;
1356 };
1357 typedef struct PyMPIWinObject PyMPIWinObject;
1358
1359 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1360
1361 /* "mpi4py/MPI.pxd":161
1362 * cdef object ob_mem
1363 *
1364 * ctypedef public api class File [ # <<<<<<<<<<<<<<
1365 * type PyMPIFile_Type,
1366 * object PyMPIFileObject,
1367 */
1368 struct PyMPIFileObject {
1369 PyObject_HEAD
1370 MPI_File ob_mpi;
1371 unsigned int flags;
1372 PyObject *__weakref__;
1373 };
1374 typedef struct PyMPIFileObject PyMPIFileObject;
1375
1376 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1377
1378 /* "music/pybuffer.pxd":49
1379 * int PyBuffer_FillInfo(Py_buffer*, object, void*, Py_ssize_t, bint, int) except -1
1380 *
1381 * cdef class Buffer(object): # <<<<<<<<<<<<<<
1382 * cdef Py_buffer pybuf
1383 * cdef MPI.Datatype dtype
1384 */
1385 struct __pyx_obj_5music_8pybuffer_Buffer {
1386 PyObject_HEAD
1387 Py_buffer pybuf;
1388 struct PyMPIDatatypeObject *dtype;
1389 Py_ssize_t items;
1390 };
1391
1392
1393 /* "pymusic.pxd":173
1394 * ###########################################################
1395 *
1396 * cdef class Setup(object): # <<<<<<<<<<<<<<
1397 * cdef CSetup* ptr
1398 * cdef list argv
1399 */
1400 struct __pyx_obj_7pymusic_Setup {
1401 PyObject_HEAD
1402 struct __pyx_vtabstruct_7pymusic_Setup *__pyx_vtab;
1403 MUSIC::Setup *ptr;
1404 PyObject *argv;
1405 int provided;
1406 struct PyMPIIntracommObject *comm;
1407 PyObject *ports;
1408 };
1409
1410
1411 /* "pymusic.pxd":185
1412 * ###########################################################
1413 *
1414 * cdef class Runtime(object): # <<<<<<<<<<<<<<
1415 * cdef CRuntime* ptr
1416 * cdef readonly MPI.Intracomm comm
1417 */
1418 struct __pyx_obj_7pymusic_Runtime {
1419 PyObject_HEAD
1420 MUSIC::Runtime *ptr;
1421 struct PyMPIIntracommObject *comm;
1422 PyObject *ports;
1423 int isFinalized;
1424 };
1425
1426
1427 /* "pymusic.pxd":193
1428 * ###########################################################
1429 *
1430 * cdef class Port(object): # <<<<<<<<<<<<<<
1431 * cdef CPort* ptr
1432 * cpdef object null(self)
1433 */
1434 struct __pyx_obj_7pymusic_Port {
1435 PyObject_HEAD
1436 struct __pyx_vtabstruct_7pymusic_Port *__pyx_vtab;
1437 MUSIC::Port *ptr;
1438 };
1439
1440
1441 /* "pymusic.pxd":200
1442 * ## a capital crime ^^^^
1443 *
1444 * cdef class ContInputPort(Port): # <<<<<<<<<<<<<<
1445 * pass
1446 *
1447 */
1448 struct __pyx_obj_7pymusic_ContInputPort {
1449 struct __pyx_obj_7pymusic_Port __pyx_base;
1450 };
1451
1452
1453 /* "pymusic.pxd":203
1454 * pass
1455 *
1456 * cdef class ContOutputPort(Port): # <<<<<<<<<<<<<<
1457 * pass
1458 *
1459 */
1460 struct __pyx_obj_7pymusic_ContOutputPort {
1461 struct __pyx_obj_7pymusic_Port __pyx_base;
1462 };
1463
1464
1465 /* "pymusic.pxd":206
1466 * pass
1467 *
1468 * cdef class EventInputPort(Port): # <<<<<<<<<<<<<<
1469 * cdef set events
1470 * cpdef object null(self)
1471 */
1472 struct __pyx_obj_7pymusic_EventInputPort {
1473 struct __pyx_obj_7pymusic_Port __pyx_base;
1474 PyObject *events;
1475 };
1476
1477
1478 /* "pymusic.pxd":210
1479 * cpdef object null(self)
1480 *
1481 * cdef class EventOutputPort(Port): # <<<<<<<<<<<<<<
1482 * pass
1483 *
1484 */
1485 struct __pyx_obj_7pymusic_EventOutputPort {
1486 struct __pyx_obj_7pymusic_Port __pyx_base;
1487 };
1488
1489
1490 /* "pymusic.pxd":213
1491 * pass
1492 *
1493 * cdef class MessageInputPort(Port): # <<<<<<<<<<<<<<
1494 * cdef set events
1495 * cpdef object null(self)
1496 */
1497 struct __pyx_obj_7pymusic_MessageInputPort {
1498 struct __pyx_obj_7pymusic_Port __pyx_base;
1499 PyObject *events;
1500 };
1501
1502
1503 /* "pymusic.pxd":217
1504 * cpdef object null(self)
1505 *
1506 * cdef class MessageOutputPort(Port): # <<<<<<<<<<<<<<
1507 * cdef bint pickled
1508 *
1509 */
1510 struct __pyx_obj_7pymusic_MessageOutputPort {
1511 struct __pyx_obj_7pymusic_Port __pyx_base;
1512 int pickled;
1513 };
1514
1515
1516 /* "pymusic.pxd":224
1517 * from music.pybuffer cimport Buffer
1518 *
1519 * cdef class DataMap(object): # <<<<<<<<<<<<<<
1520 * cdef CDataMap* ptr
1521 * cdef Buffer buf
1522 */
1523 struct __pyx_obj_7pymusic_DataMap {
1524 PyObject_HEAD
1525 MUSIC::DataMap *ptr;
1526 struct __pyx_obj_5music_8pybuffer_Buffer *buf;
1527 };
1528
1529
1530 /* "pymusic.pxd":228
1531 * cdef Buffer buf
1532 *
1533 * cdef class IndexMap(object): # <<<<<<<<<<<<<<
1534 * cdef CIndexMap* ptr
1535 * cdef Buffer buf
1536 */
1537 struct __pyx_obj_7pymusic_IndexMap {
1538 PyObject_HEAD
1539 MUSIC::IndexMap *ptr;
1540 struct __pyx_obj_5music_8pybuffer_Buffer *buf;
1541 };
1542
1543
1544 /* "pymusic.pxd":232
1545 * cdef Buffer buf
1546 *
1547 * cdef class EventHandler: # <<<<<<<<<<<<<<
1548 * cdef CEventHandler* ptr
1549 * cdef object func
1550 */
1551 struct __pyx_obj_7pymusic_EventHandler {
1552 PyObject_HEAD
1553 MUSIC::EventHandler *ptr;
1554 PyObject *func;
1555 };
1556
1557
1558 /* "pymusic.pxd":236
1559 * cdef object func
1560 *
1561 * cdef class MessageHandler: # <<<<<<<<<<<<<<
1562 * cdef CMessageHandler* ptr
1563 * cdef object func
1564 */
1565 struct __pyx_obj_7pymusic_MessageHandler {
1566 PyObject_HEAD
1567 MUSIC::MessageHandler *ptr;
1568 PyObject *func;
1569 };
1570
1571
1572 /* "pymusic.pyx":643
1573 * def __dealloc__(self): del self.ptr
1574 *
1575 * cdef class _Index: # <<<<<<<<<<<<<<
1576 * """
1577 * Internal: the type of the variable Index
1578 */
1579 struct __pyx_obj_7pymusic__Index {
1580 PyObject_HEAD
1581 int GLOBAL;
1582 int LOCAL;
1583 PyObject *backmap;
1584 };
1585
1586
1587 /* "pymusic.pyx":545
1588 * self.ptr.finalize()
1589 *
1590 * def __iter__(self): # <<<<<<<<<<<<<<
1591 * cdef CRuntime* ptr = self.ptr
1592 * while True:
1593 */
1594 struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ {
1595 PyObject_HEAD
1596 MUSIC::Runtime *__pyx_v_ptr;
1597 struct __pyx_obj_7pymusic_Runtime *__pyx_v_self;
1598 };
1599
1600
1601
1602 /* "pymusic.pyx":348
1603 *
1604 * import sys
1605 * cdef class Setup(object): # <<<<<<<<<<<<<<
1606 * """
1607 * API to setup the music interface.
1608 */
1609
1610 struct __pyx_vtabstruct_7pymusic_Setup {
1611 PyObject *(*null)(struct __pyx_obj_7pymusic_Setup *);
1612 struct PyMPIIntracommObject *(*getcomm)(struct __pyx_obj_7pymusic_Setup *, int __pyx_skip_dispatch);
1613 };
1614 static struct __pyx_vtabstruct_7pymusic_Setup *__pyx_vtabptr_7pymusic_Setup;
1615
1616
1617 /* "pymusic.pyx":90
1618 * ###########################################################
1619 *
1620 * cdef class Port(object): # <<<<<<<<<<<<<<
1621 * """
1622 * Base Port class.
1623 */
1624
1625 struct __pyx_vtabstruct_7pymusic_Port {
1626 PyObject *(*null)(struct __pyx_obj_7pymusic_Port *, int __pyx_skip_dispatch);
1627 };
1628 static struct __pyx_vtabstruct_7pymusic_Port *__pyx_vtabptr_7pymusic_Port;
1629
1630
1631 /* "pymusic.pyx":138
1632 * return self.ptr.width()
1633 *
1634 * cdef class ContInputPort(Port): # <<<<<<<<<<<<<<
1635 * """
1636 * ContInputPort maps data indices between sources and sinks. This is
1637 */
1638
1639 struct __pyx_vtabstruct_7pymusic_ContInputPort {
1640 struct __pyx_vtabstruct_7pymusic_Port __pyx_base;
1641 };
1642 static struct __pyx_vtabstruct_7pymusic_ContInputPort *__pyx_vtabptr_7pymusic_ContInputPort;
1643
1644
1645 /* "pymusic.pyx":178
1646 * mapImpl(ptr, d.ptr, delay, maxBuffered, interpolate)
1647 *
1648 * cdef class ContOutputPort(Port): # <<<<<<<<<<<<<<
1649 * """
1650 * ContOutputPort maps data indices between sources and sinks. This
1651 */
1652
1653 struct __pyx_vtabstruct_7pymusic_ContOutputPort {
1654 struct __pyx_vtabstruct_7pymusic_Port __pyx_base;
1655 };
1656 static struct __pyx_vtabstruct_7pymusic_ContOutputPort *__pyx_vtabptr_7pymusic_ContOutputPort;
1657
1658
1659 /* "pymusic.pyx":207
1660 * mapImpl(ptr, d.ptr, maxBuffered)
1661 *
1662 * cdef class EventInputPort(Port): # <<<<<<<<<<<<<<
1663 * """
1664 * Event sink. Maps 'events' to handlers. Events are spike-like
1665 */
1666
1667 struct __pyx_vtabstruct_7pymusic_EventInputPort {
1668 struct __pyx_vtabstruct_7pymusic_Port __pyx_base;
1669 };
1670 static struct __pyx_vtabstruct_7pymusic_EventInputPort *__pyx_vtabptr_7pymusic_EventInputPort;
1671
1672
1673 /* "pymusic.pyx":252
1674 * self.events.add(eh)
1675 *
1676 * cdef class EventOutputPort(Port): # <<<<<<<<<<<<<<
1677 * """
1678 * Map events from this sink. See EventInputPort for description of
1679 */
1680
1681 struct __pyx_vtabstruct_7pymusic_EventOutputPort {
1682 struct __pyx_vtabstruct_7pymusic_Port __pyx_base;
1683 };
1684 static struct __pyx_vtabstruct_7pymusic_EventOutputPort *__pyx_vtabptr_7pymusic_EventOutputPort;
1685
1686
1687 /* "pymusic.pyx":277
1688 * insertEventImpl(ptr, time, index)
1689 *
1690 * cdef class MessageInputPort(Port): # <<<<<<<<<<<<<<
1691 * """
1692 * Maps 'events' to handlers.
1693 */
1694
1695 struct __pyx_vtabstruct_7pymusic_MessageInputPort {
1696 struct __pyx_vtabstruct_7pymusic_Port __pyx_base;
1697 };
1698 static struct __pyx_vtabstruct_7pymusic_MessageInputPort *__pyx_vtabptr_7pymusic_MessageInputPort;
1699
1700
1701 /* "pymusic.pyx":313
1702 * self.events.add(eh)
1703 *
1704 * cdef class MessageOutputPort(Port): # <<<<<<<<<<<<<<
1705 * """
1706 * The source of "messages". A message is a python object that is
1707 */
1708
1709 struct __pyx_vtabstruct_7pymusic_MessageOutputPort {
1710 struct __pyx_vtabstruct_7pymusic_Port __pyx_base;
1711 };
1712 static struct __pyx_vtabstruct_7pymusic_MessageOutputPort *__pyx_vtabptr_7pymusic_MessageOutputPort;
1713
1714 /* --- Runtime support code (head) --- */
1715 /* Refnanny.proto */
1716 #ifndef CYTHON_REFNANNY
1717 #define CYTHON_REFNANNY 0
1718 #endif
1719 #if CYTHON_REFNANNY
1720 typedef struct {
1721 void (*INCREF)(void*, PyObject*, int);
1722 void (*DECREF)(void*, PyObject*, int);
1723 void (*GOTREF)(void*, PyObject*, int);
1724 void (*GIVEREF)(void*, PyObject*, int);
1725 void* (*SetupContext)(const char*, int, const char*);
1726 void (*FinishContext)(void**);
1727 } __Pyx_RefNannyAPIStruct;
1728 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1729 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1730 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1731 #ifdef WITH_THREAD
1732 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1733 if (acquire_gil) {\
1734 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1735 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1736 PyGILState_Release(__pyx_gilstate_save);\
1737 } else {\
1738 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1739 }
1740 #else
1741 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1742 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1743 #endif
1744 #define __Pyx_RefNannyFinishContext()\
1745 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1746 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1747 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1748 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1749 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1750 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1751 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1752 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1753 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1754 #else
1755 #define __Pyx_RefNannyDeclarations
1756 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1757 #define __Pyx_RefNannyFinishContext()
1758 #define __Pyx_INCREF(r) Py_INCREF(r)
1759 #define __Pyx_DECREF(r) Py_DECREF(r)
1760 #define __Pyx_GOTREF(r)
1761 #define __Pyx_GIVEREF(r)
1762 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1763 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1764 #define __Pyx_XGOTREF(r)
1765 #define __Pyx_XGIVEREF(r)
1766 #endif
1767 #define __Pyx_XDECREF_SET(r, v) do {\
1768 PyObject *tmp = (PyObject *) r;\
1769 r = v; __Pyx_XDECREF(tmp);\
1770 } while (0)
1771 #define __Pyx_DECREF_SET(r, v) do {\
1772 PyObject *tmp = (PyObject *) r;\
1773 r = v; __Pyx_DECREF(tmp);\
1774 } while (0)
1775 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1776 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1777
1778 /* PyObjectGetAttrStr.proto */
1779 #if CYTHON_USE_TYPE_SLOTS
1780 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1781 #else
1782 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1783 #endif
1784
1785 /* GetBuiltinName.proto */
1786 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1787
1788 /* PyDictVersioning.proto */
1789 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1790 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1791 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1792 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1793 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1794 (cache_var) = (value);
1795 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1796 static PY_UINT64_T __pyx_dict_version = 0;\
1797 static PyObject *__pyx_dict_cached_value = NULL;\
1798 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1799 (VAR) = __pyx_dict_cached_value;\
1800 } else {\
1801 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1802 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1803 }\
1804 }
1805 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1806 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1807 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1808 #else
1809 #define __PYX_GET_DICT_VERSION(dict) (0)
1810 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1811 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1812 #endif
1813
1814 /* GetModuleGlobalName.proto */
1815 #if CYTHON_USE_DICT_VERSIONS
1816 #define __Pyx_GetModuleGlobalName(var, name) {\
1817 static PY_UINT64_T __pyx_dict_version = 0;\
1818 static PyObject *__pyx_dict_cached_value = NULL;\
1819 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1820 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1821 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1822 }
1823 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1824 PY_UINT64_T __pyx_dict_version;\
1825 PyObject *__pyx_dict_cached_value;\
1826 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1827 }
1828 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1829 #else
1830 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1831 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1832 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1833 #endif
1834
1835 /* PyFunctionFastCall.proto */
1836 #if CYTHON_FAST_PYCALL
1837 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1838 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1839 #if 1 || PY_VERSION_HEX < 0x030600B1
1840 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1841 #else
1842 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1843 #endif
1844 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1845 (sizeof(char [1 - 2*!(cond)]) - 1)
1846 #ifndef Py_MEMBER_SIZE
1847 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1848 #endif
1849 #if CYTHON_FAST_PYCALL
1850 static size_t __pyx_pyframe_localsplus_offset = 0;
1851 #include "frameobject.h"
1852 #if PY_VERSION_HEX >= 0x030b00a6
1853 #ifndef Py_BUILD_CORE
1854 #define Py_BUILD_CORE 1
1855 #endif
1856 #include "internal/pycore_frame.h"
1857 #endif
1858 #define __Pxy_PyFrame_Initialize_Offsets()\
1859 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1860 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1861 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1862 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1863 #endif // CYTHON_FAST_PYCALL
1864 #endif
1865
1866 /* PyCFunctionFastCall.proto */
1867 #if CYTHON_FAST_PYCCALL
1868 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1869 #else
1870 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1871 #endif
1872
1873 /* PyObjectCall.proto */
1874 #if CYTHON_COMPILING_IN_CPYTHON
1875 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1876 #else
1877 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1878 #endif
1879
1880 /* RaiseArgTupleInvalid.proto */
1881 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1882 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1883
1884 /* RaiseDoubleKeywords.proto */
1885 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1886
1887 /* ParseKeywords.proto */
1888 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1889 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1890 const char* function_name);
1891
1892 /* PyObjectCall2Args.proto */
1893 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1894
1895 /* PyObjectCallMethO.proto */
1896 #if CYTHON_COMPILING_IN_CPYTHON
1897 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1898 #endif
1899
1900 /* PyObjectCallOneArg.proto */
1901 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1902
1903 /* PyThreadStateGet.proto */
1904 #if CYTHON_FAST_THREAD_STATE
1905 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1906 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1907 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1908 #else
1909 #define __Pyx_PyThreadState_declare
1910 #define __Pyx_PyThreadState_assign
1911 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1912 #endif
1913
1914 /* PyErrFetchRestore.proto */
1915 #if CYTHON_FAST_THREAD_STATE
1916 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1917 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1918 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1919 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1920 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1921 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1922 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1923 #if CYTHON_COMPILING_IN_CPYTHON
1924 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1925 #else
1926 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1927 #endif
1928 #else
1929 #define __Pyx_PyErr_Clear() PyErr_Clear()
1930 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1931 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1932 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1933 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1934 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1935 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1936 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1937 #endif
1938
1939 /* RaiseException.proto */
1940 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1941
1942 /* GetItemInt.proto */
1943 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1944 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1945 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1946 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1947 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1948 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1949 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1950 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1951 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1952 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1953 int wraparound, int boundscheck);
1954 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1955 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1956 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1957 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1958 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1959 int wraparound, int boundscheck);
1960 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1961 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1962 int is_list, int wraparound, int boundscheck);
1963
1964 /* PyObjectCallNoArg.proto */
1965 #if CYTHON_COMPILING_IN_CPYTHON
1966 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1967 #else
1968 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1969 #endif
1970
1971 /* GetTopmostException.proto */
1972 #if CYTHON_USE_EXC_INFO_STACK
1973 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1974 #endif
1975
1976 /* SaveResetException.proto */
1977 #if CYTHON_FAST_THREAD_STATE
1978 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1979 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1980 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1981 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1982 #else
1983 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1984 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1985 #endif
1986
1987 /* GetException.proto */
1988 #if CYTHON_FAST_THREAD_STATE
1989 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1990 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1991 #else
1992 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1993 #endif
1994
1995 /* WriteUnraisableException.proto */
1996 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1997 int lineno, const char *filename,
1998 int full_traceback, int nogil);
1999
2000 /* ArgTypeTest.proto */
2001 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2002 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2003 __Pyx__ArgTypeTest(obj, type, name, exact))
2004 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2005
2006 /* KeywordStringCheck.proto */
2007 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
2008
2009 /* ListCompAppend.proto */
2010 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2011 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2012 PyListObject* L = (PyListObject*) list;
2013 Py_ssize_t len = Py_SIZE(list);
2014 if (likely(L->allocated > len)) {
2015 Py_INCREF(x);
2016 PyList_SET_ITEM(list, len, x);
2017 __Pyx_SET_SIZE(list, len + 1);
2018 return 0;
2019 }
2020 return PyList_Append(list, x);
2021 }
2022 #else
2023 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2024 #endif
2025
2026 /* SwapException.proto */
2027 #if CYTHON_FAST_THREAD_STATE
2028 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2029 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2030 #else
2031 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2032 #endif
2033
2034 /* IterFinish.proto */
2035 static CYTHON_INLINE int __Pyx_IterFinish(void);
2036
2037 /* set_iter.proto */
2038 static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
2039 Py_ssize_t* p_orig_length, int* p_source_is_set);
2040 static CYTHON_INLINE int __Pyx_set_iter_next(
2041 PyObject* iter_obj, Py_ssize_t orig_length,
2042 Py_ssize_t* ppos, PyObject **value,
2043 int source_is_set);
2044
2045 /* PyObjectSetAttrStr.proto */
2046 #if CYTHON_USE_TYPE_SLOTS
2047 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
2048 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
2049 #else
2050 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
2051 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
2052 #endif
2053
2054 /* ExtTypeTest.proto */
2055 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2056
2057 /* PyErrExceptionMatches.proto */
2058 #if CYTHON_FAST_THREAD_STATE
2059 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2060 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2061 #else
2062 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2063 #endif
2064
2065 /* DictGetItem.proto */
2066 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2067 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2068 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2069 (likely(PyDict_CheckExact(obj)) ?\
2070 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2071 #else
2072 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2073 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2074 #endif
2075
2076 /* CallNextTpTraverse.proto */
2077 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
2078
2079 /* CallNextTpClear.proto */
2080 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2081
2082 /* IncludeStringH.proto */
2083 #include <string.h>
2084
2085 /* PyObject_GenericGetAttrNoDict.proto */
2086 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2087 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2088 #else
2089 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2090 #endif
2091
2092 /* PyObject_GenericGetAttr.proto */
2093 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2094 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2095 #else
2096 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2097 #endif
2098
2099 /* SetVTable.proto */
2100 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2101
2102 /* PyObjectGetAttrStrNoError.proto */
2103 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2104
2105 /* SetupReduce.proto */
2106 static int __Pyx_setup_reduce(PyObject* type_obj);
2107
2108 /* TypeImport.proto */
2109 #ifndef __PYX_HAVE_RT_ImportType_proto
2110 #define __PYX_HAVE_RT_ImportType_proto
2111 enum __Pyx_ImportType_CheckSize {
2112 __Pyx_ImportType_CheckSize_Error = 0,
2113 __Pyx_ImportType_CheckSize_Warn = 1,
2114 __Pyx_ImportType_CheckSize_Ignore = 2
2115 };
2116 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2117 #endif
2118
2119 /* Import.proto */
2120 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2121
2122 /* ImportFrom.proto */
2123 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2124
2125 /* CalculateMetaclass.proto */
2126 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2127
2128 /* Py3ClassCreate.proto */
2129 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2130 PyObject *mkw, PyObject *modname, PyObject *doc);
2131 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2132 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2133
2134 /* FetchCommonType.proto */
2135 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2136
2137 /* CythonFunctionShared.proto */
2138 #define __Pyx_CyFunction_USED 1
2139 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2140 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2141 #define __Pyx_CYFUNCTION_CCLASS 0x04
2142 #define __Pyx_CyFunction_GetClosure(f)\
2143 (((__pyx_CyFunctionObject *) (f))->func_closure)
2144 #define __Pyx_CyFunction_GetClassObj(f)\
2145 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2146 #define __Pyx_CyFunction_Defaults(type, f)\
2147 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2148 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2149 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2150 typedef struct {
2151 PyCFunctionObject func;
2152 #if PY_VERSION_HEX < 0x030500A0
2153 PyObject *func_weakreflist;
2154 #endif
2155 PyObject *func_dict;
2156 PyObject *func_name;
2157 PyObject *func_qualname;
2158 PyObject *func_doc;
2159 PyObject *func_globals;
2160 PyObject *func_code;
2161 PyObject *func_closure;
2162 PyObject *func_classobj;
2163 void *defaults;
2164 int defaults_pyobjects;
2165 size_t defaults_size; // used by FusedFunction for copying defaults
2166 int flags;
2167 PyObject *defaults_tuple;
2168 PyObject *defaults_kwdict;
2169 PyObject *(*defaults_getter)(PyObject *);
2170 PyObject *func_annotations;
2171 } __pyx_CyFunctionObject;
2172 static PyTypeObject *__pyx_CyFunctionType = 0;
2173 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2174 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2175 int flags, PyObject* qualname,
2176 PyObject *self,
2177 PyObject *module, PyObject *globals,
2178 PyObject* code);
2179 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2180 size_t size,
2181 int pyobjects);
2182 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2183 PyObject *tuple);
2184 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2185 PyObject *dict);
2186 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2187 PyObject *dict);
2188 static int __pyx_CyFunction_init(void);
2189
2190 /* CythonFunction.proto */
2191 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2192 int flags, PyObject* qualname,
2193 PyObject *closure,
2194 PyObject *module, PyObject *globals,
2195 PyObject* code);
2196
2197 /* SetNameInClass.proto */
2198 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2199 #define __Pyx_SetNameInClass(ns, name, value)\
2200 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2201 #elif CYTHON_COMPILING_IN_CPYTHON
2202 #define __Pyx_SetNameInClass(ns, name, value)\
2203 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2204 #else
2205 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2206 #endif
2207
2208 /* CLineInTraceback.proto */
2209 #ifdef CYTHON_CLINE_IN_TRACEBACK
2210 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2211 #else
2212 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2213 #endif
2214
2215 /* CodeObjectCache.proto */
2216 typedef struct {
2217 PyCodeObject* code_object;
2218 int code_line;
2219 } __Pyx_CodeObjectCacheEntry;
2220 struct __Pyx_CodeObjectCache {
2221 int count;
2222 int max_count;
2223 __Pyx_CodeObjectCacheEntry* entries;
2224 };
2225 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2226 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2227 static PyCodeObject *__pyx_find_code_object(int code_line);
2228 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2229
2230 /* AddTraceback.proto */
2231 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2232 int py_line, const char *filename);
2233
2234 /* ArrayAPI.proto */
2235 #ifndef _ARRAYARRAY_H
2236 #define _ARRAYARRAY_H
2237 typedef struct arraydescr {
2238 int typecode;
2239 int itemsize;
2240 PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
2241 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
2242 #if PY_MAJOR_VERSION >= 3
2243 char *formats;
2244 #endif
2245 } arraydescr;
2246 struct arrayobject {
2247 PyObject_HEAD
2248 Py_ssize_t ob_size;
2249 union {
2250 char *ob_item;
2251 float *as_floats;
2252 double *as_doubles;
2253 int *as_ints;
2254 unsigned int *as_uints;
2255 unsigned char *as_uchars;
2256 signed char *as_schars;
2257 char *as_chars;
2258 unsigned long *as_ulongs;
2259 long *as_longs;
2260 #if PY_MAJOR_VERSION >= 3
2261 unsigned long long *as_ulonglongs;
2262 long long *as_longlongs;
2263 #endif
2264 short *as_shorts;
2265 unsigned short *as_ushorts;
2266 Py_UNICODE *as_pyunicodes;
2267 void *as_voidptr;
2268 } data;
2269 Py_ssize_t allocated;
2270 struct arraydescr *ob_descr;
2271 PyObject *weakreflist;
2272 #if PY_MAJOR_VERSION >= 3
2273 int ob_exports;
2274 #endif
2275 };
2276 #ifndef NO_NEWARRAY_INLINE
2277 static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
2278 struct arraydescr *descr) {
2279 arrayobject *op;
2280 size_t nbytes;
2281 if (size < 0) {
2282 PyErr_BadInternalCall();
2283 return NULL;
2284 }
2285 nbytes = size * descr->itemsize;
2286 if (nbytes / descr->itemsize != (size_t)size) {
2287 return PyErr_NoMemory();
2288 }
2289 op = (arrayobject *) type->tp_alloc(type, 0);
2290 if (op == NULL) {
2291 return NULL;
2292 }
2293 op->ob_descr = descr;
2294 op->allocated = size;
2295 op->weakreflist = NULL;
2296 __Pyx_SET_SIZE(op, size);
2297 if (size <= 0) {
2298 op->data.ob_item = NULL;
2299 }
2300 else {
2301 op->data.ob_item = PyMem_NEW(char, nbytes);
2302 if (op->data.ob_item == NULL) {
2303 Py_DECREF(op);
2304 return PyErr_NoMemory();
2305 }
2306 }
2307 return (PyObject *) op;
2308 }
2309 #else
2310 PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
2311 struct arraydescr *descr);
2312 #endif
2313 static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
2314 void *items = (void*) self->data.ob_item;
2315 PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
2316 if (items == NULL) {
2317 PyErr_NoMemory();
2318 return -1;
2319 }
2320 self->data.ob_item = (char*) items;
2321 __Pyx_SET_SIZE(self, n);
2322 self->allocated = n;
2323 return 0;
2324 }
2325 static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
2326 void *items = (void*) self->data.ob_item;
2327 Py_ssize_t newsize;
2328 if (n < self->allocated && n*4 > self->allocated) {
2329 __Pyx_SET_SIZE(self, n);
2330 return 0;
2331 }
2332 newsize = n + (n / 2) + 1;
2333 if (newsize <= n) {
2334 PyErr_NoMemory();
2335 return -1;
2336 }
2337 PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
2338 if (items == NULL) {
2339 PyErr_NoMemory();
2340 return -1;
2341 }
2342 self->data.ob_item = (char*) items;
2343 __Pyx_SET_SIZE(self, n);
2344 self->allocated = newsize;
2345 return 0;
2346 }
2347 #endif
2348
2349 /* GCCDiagnostics.proto */
2350 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2351 #define __Pyx_HAS_GCC_DIAGNOSTIC
2352 #endif
2353
2354 /* CppExceptionConversion.proto */
2355 #ifndef __Pyx_CppExn2PyErr
2356 #include <new>
2357 #include <typeinfo>
2358 #include <stdexcept>
2359 #include <ios>
2360 static void __Pyx_CppExn2PyErr() {
2361 try {
2362 if (PyErr_Occurred())
2363 ; // let the latest Python exn pass through and ignore the current one
2364 else
2365 throw;
2366 } catch (const std::bad_alloc& exn) {
2367 PyErr_SetString(PyExc_MemoryError, exn.what());
2368 } catch (const std::bad_cast& exn) {
2369 PyErr_SetString(PyExc_TypeError, exn.what());
2370 } catch (const std::bad_typeid& exn) {
2371 PyErr_SetString(PyExc_TypeError, exn.what());
2372 } catch (const std::domain_error& exn) {
2373 PyErr_SetString(PyExc_ValueError, exn.what());
2374 } catch (const std::invalid_argument& exn) {
2375 PyErr_SetString(PyExc_ValueError, exn.what());
2376 } catch (const std::ios_base::failure& exn) {
2377 PyErr_SetString(PyExc_IOError, exn.what());
2378 } catch (const std::out_of_range& exn) {
2379 PyErr_SetString(PyExc_IndexError, exn.what());
2380 } catch (const std::overflow_error& exn) {
2381 PyErr_SetString(PyExc_OverflowError, exn.what());
2382 } catch (const std::range_error& exn) {
2383 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2384 } catch (const std::underflow_error& exn) {
2385 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2386 } catch (const std::exception& exn) {
2387 PyErr_SetString(PyExc_RuntimeError, exn.what());
2388 }
2389 catch (...)
2390 {
2391 PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
2392 }
2393 }
2394 #endif
2395
2396 /* CIntFromPy.proto */
2397 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2398
2399 /* CIntFromPy.proto */
2400 static CYTHON_INLINE MUSIC::Index::Type __Pyx_PyInt_As_MUSIC_3a__3a_Index_3a__3a_Type(PyObject *);
2401
2402 /* CIntToPy.proto */
2403 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2404
2405 /* CIntFromPy.proto */
2406 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2407
2408 /* CIntToPy.proto */
2409 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2410
2411 /* CIntToPy.proto */
2412 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MUSIC_3a__3a_Index_3a__3a_Type(MUSIC::Index::Type value);
2413
2414 /* FastTypeChecks.proto */
2415 #if CYTHON_COMPILING_IN_CPYTHON
2416 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2417 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2418 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2419 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2420 #else
2421 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2422 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2423 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2424 #endif
2425 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2426
2427 /* PyObjectGetMethod.proto */
2428 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2429
2430 /* PyObjectCallMethod1.proto */
2431 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
2432
2433 /* CoroutineBase.proto */
2434 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
2435 #if CYTHON_USE_EXC_INFO_STACK
2436 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2437 #else
2438 typedef struct {
2439 PyObject *exc_type;
2440 PyObject *exc_value;
2441 PyObject *exc_traceback;
2442 } __Pyx_ExcInfoStruct;
2443 #endif
2444 typedef struct {
2445 PyObject_HEAD
2446 __pyx_coroutine_body_t body;
2447 PyObject *closure;
2448 __Pyx_ExcInfoStruct gi_exc_state;
2449 PyObject *gi_weakreflist;
2450 PyObject *classobj;
2451 PyObject *yieldfrom;
2452 PyObject *gi_name;
2453 PyObject *gi_qualname;
2454 PyObject *gi_modulename;
2455 PyObject *gi_code;
2456 PyObject *gi_frame;
2457 int resume_label;
2458 char is_running;
2459 } __pyx_CoroutineObject;
2460 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
2461 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2462 PyObject *name, PyObject *qualname, PyObject *module_name);
2463 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
2464 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2465 PyObject *name, PyObject *qualname, PyObject *module_name);
2466 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
2467 static int __Pyx_Coroutine_clear(PyObject *self);
2468 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
2469 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
2470 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
2471 #if CYTHON_USE_EXC_INFO_STACK
2472 #define __Pyx_Coroutine_SwapException(self)
2473 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
2474 #else
2475 #define __Pyx_Coroutine_SwapException(self) {\
2476 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
2477 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
2478 }
2479 #define __Pyx_Coroutine_ResetAndClearException(self) {\
2480 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
2481 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
2482 }
2483 #endif
2484 #if CYTHON_FAST_THREAD_STATE
2485 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2486 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2487 #else
2488 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2489 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2490 #endif
2491 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2492 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2493
2494 /* PatchModuleWithCoroutine.proto */
2495 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
2496
2497 /* PatchGeneratorABC.proto */
2498 static int __Pyx_patch_abc(void);
2499
2500 /* Generator.proto */
2501 #define __Pyx_Generator_USED
2502 static PyTypeObject *__pyx_GeneratorType = 0;
2503 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
2504 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
2505 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
2506 static PyObject *__Pyx_Generator_Next(PyObject *self);
2507 static int __pyx_Generator_init(void);
2508
2509 /* CheckBinaryVersion.proto */
2510 static int __Pyx_check_binary_version(void);
2511
2512 /* FunctionExport.proto */
2513 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
2514
2515 /* InitStrings.proto */
2516 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2517
2518 static PyObject *__pyx_f_7pymusic_4Port_null(struct __pyx_obj_7pymusic_Port *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2519 static PyObject *__pyx_f_7pymusic_14EventInputPort_null(struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2520 static PyObject *__pyx_f_7pymusic_16MessageInputPort_null(struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2521 static struct PyMPIIntracommObject *__pyx_f_7pymusic_5Setup_getcomm(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2522 static PyObject *__pyx_f_7pymusic_5Setup_null(struct __pyx_obj_7pymusic_Setup *__pyx_v_self); /* proto*/
2523
2524 /* Module declarations from 'mpi4py.libmpi' */
2525
2526 /* Module declarations from 'mpi4py.MPI' */
2527 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype = 0;
2528 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status = 0;
2529 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request = 0;
2530 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest = 0;
2531 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest = 0;
2532 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message = 0;
2533 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op = 0;
2534 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group = 0;
2535 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info = 0;
2536 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler = 0;
2537 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm = 0;
2538 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm = 0;
2539 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm = 0;
2540 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm = 0;
2541 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm = 0;
2542 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = 0;
2543 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm = 0;
2544 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win = 0;
2545 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File = 0;
2546
2547 /* Module declarations from 'libcpp' */
2548
2549 /* Module declarations from 'libc.string' */
2550
2551 /* Module declarations from 'libcpp.string' */
2552
2553 /* Module declarations from 'libc.stdio' */
2554
2555 /* Module declarations from '__builtin__' */
2556
2557 /* Module declarations from 'cpython.type' */
2558 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2559
2560 /* Module declarations from 'cpython.version' */
2561
2562 /* Module declarations from 'cpython.exc' */
2563
2564 /* Module declarations from 'cpython.module' */
2565
2566 /* Module declarations from 'cpython.mem' */
2567
2568 /* Module declarations from 'cpython.tuple' */
2569
2570 /* Module declarations from 'cpython.list' */
2571
2572 /* Module declarations from 'cpython.sequence' */
2573
2574 /* Module declarations from 'cpython.mapping' */
2575
2576 /* Module declarations from 'cpython.iterator' */
2577
2578 /* Module declarations from 'cpython.number' */
2579
2580 /* Module declarations from 'cpython.int' */
2581
2582 /* Module declarations from '__builtin__' */
2583
2584 /* Module declarations from 'cpython.bool' */
2585 static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
2586
2587 /* Module declarations from 'cpython.long' */
2588
2589 /* Module declarations from 'cpython.float' */
2590
2591 /* Module declarations from '__builtin__' */
2592
2593 /* Module declarations from 'cpython.complex' */
2594 static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
2595
2596 /* Module declarations from 'cpython.string' */
2597
2598 /* Module declarations from 'cpython.unicode' */
2599
2600 /* Module declarations from 'cpython.dict' */
2601
2602 /* Module declarations from 'cpython.instance' */
2603
2604 /* Module declarations from 'cpython.function' */
2605
2606 /* Module declarations from 'cpython.method' */
2607
2608 /* Module declarations from 'cpython.weakref' */
2609
2610 /* Module declarations from 'cpython.getargs' */
2611
2612 /* Module declarations from 'cpython.pythread' */
2613
2614 /* Module declarations from 'cpython.pystate' */
2615
2616 /* Module declarations from 'cpython.cobject' */
2617
2618 /* Module declarations from 'cpython.oldbuffer' */
2619
2620 /* Module declarations from 'cpython.set' */
2621
2622 /* Module declarations from 'cpython.buffer' */
2623
2624 /* Module declarations from 'cpython.bytes' */
2625
2626 /* Module declarations from 'cpython.pycapsule' */
2627
2628 /* Module declarations from 'cpython' */
2629
2630 /* Module declarations from 'cpython.object' */
2631
2632 /* Module declarations from 'cpython.ref' */
2633
2634 /* Module declarations from 'music.pybuffer' */
2635 static PyTypeObject *__pyx_ptype_5music_8pybuffer_Buffer = 0;
2636
2637 /* Module declarations from 'libc.stdlib' */
2638
2639 /* Module declarations from 'array' */
2640
2641 /* Module declarations from 'cpython.array' */
2642 static PyTypeObject *__pyx_ptype_7cpython_5array_array = 0;
2643 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/
2644
2645 /* Module declarations from 'pymusic' */
2646 static PyTypeObject *__pyx_ptype_7pymusic_Setup = 0;
2647 static PyTypeObject *__pyx_ptype_7pymusic_Runtime = 0;
2648 static PyTypeObject *__pyx_ptype_7pymusic_Port = 0;
2649 static PyTypeObject *__pyx_ptype_7pymusic_ContInputPort = 0;
2650 static PyTypeObject *__pyx_ptype_7pymusic_ContOutputPort = 0;
2651 static PyTypeObject *__pyx_ptype_7pymusic_EventInputPort = 0;
2652 static PyTypeObject *__pyx_ptype_7pymusic_EventOutputPort = 0;
2653 static PyTypeObject *__pyx_ptype_7pymusic_MessageInputPort = 0;
2654 static PyTypeObject *__pyx_ptype_7pymusic_MessageOutputPort = 0;
2655 static PyTypeObject *__pyx_ptype_7pymusic_DataMap = 0;
2656 static PyTypeObject *__pyx_ptype_7pymusic_IndexMap = 0;
2657 static PyTypeObject *__pyx_ptype_7pymusic_EventHandler = 0;
2658 static PyTypeObject *__pyx_ptype_7pymusic_MessageHandler = 0;
2659 static PyTypeObject *__pyx_ptype_7pymusic__Index = 0;
2660 static PyTypeObject *__pyx_ptype_7pymusic___pyx_scope_struct____iter__ = 0;
2661 static __pyx_t_7pymusic_Args __pyx_f_7pymusic_argv_toc(PyObject *); /*proto*/
2662 static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
2663 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
2664 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
2665 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
2666 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
2667 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
2668 #define __Pyx_MODULE_NAME "pymusic"
2669 extern int __pyx_module_is_main_pymusic;
2670 int __pyx_module_is_main_pymusic = 0;
2671
2672 /* Implementation of 'pymusic' */
2673 static PyObject *__pyx_builtin_range;
2674 static PyObject *__pyx_builtin_TypeError;
2675 static PyObject *__pyx_builtin_xrange;
2676 static PyObject *__pyx_builtin_ValueError;
2677 static PyObject *__pyx_builtin_MemoryError;
2678 static const char __pyx_k_h[] = "h";
2679 static const char __pyx_k_i[] = "i";
2680 static const char __pyx_k_r[] = "r";
2681 static const char __pyx_k_t[] = "t";
2682 static const char __pyx_k_MPI[] = "MPI";
2683 static const char __pyx_k__29[] = "*";
2684 static const char __pyx_k_buf[] = "buf";
2685 static const char __pyx_k_doc[] = "__doc__";
2686 static const char __pyx_k_msg[] = "msg";
2687 static const char __pyx_k_ptr[] = "ptr";
2688 static const char __pyx_k_sys[] = "sys";
2689 static const char __pyx_k_var[] = "var";
2690 static const char __pyx_k_Port[] = "Port";
2691 static const char __pyx_k_args[] = "args";
2692 static const char __pyx_k_argv[] = "argv";
2693 static const char __pyx_k_base[] = "base";
2694 static const char __pyx_k_data[] = "data";
2695 static const char __pyx_k_func[] = "func";
2696 static const char __pyx_k_init[] = "__init__";
2697 static const char __pyx_k_iter[] = "__iter__";
2698 static const char __pyx_k_main[] = "__main__";
2699 static const char __pyx_k_name[] = "__name__";
2700 static const char __pyx_k_null[] = "null";
2701 static const char __pyx_k_perm[] = "perm";
2702 static const char __pyx_k_self[] = "self";
2703 static const char __pyx_k_send[] = "send";
2704 static const char __pyx_k_size[] = "size";
2705 static const char __pyx_k_test[] = "__test__";
2706 static const char __pyx_k_time[] = "time";
2707 static const char __pyx_k_Index[] = "_Index";
2708 static const char __pyx_k_LOCAL[] = "LOCAL";
2709 static const char __pyx_k_Setup[] = "Setup";
2710 static const char __pyx_k_array[] = "array";
2711 static const char __pyx_k_close[] = "close";
2712 static const char __pyx_k_delay[] = "delay";
2713 static const char __pyx_k_dumps[] = "dumps";
2714 static const char __pyx_k_index[] = "index";
2715 static const char __pyx_k_loads[] = "loads";
2716 static const char __pyx_k_range[] = "range";
2717 static const char __pyx_k_setup[] = "setup";
2718 static const char __pyx_k_throw[] = "throw";
2719 static const char __pyx_k_Buffer[] = "Buffer";
2720 static const char __pyx_k_GLOBAL[] = "GLOBAL";
2721 static const char __pyx_k_encode[] = "encode";
2722 static const char __pyx_k_format[] = "format";
2723 static const char __pyx_k_import[] = "__import__";
2724 static const char __pyx_k_module[] = "__module__";
2725 static const char __pyx_k_pickle[] = "pickle";
2726 static const char __pyx_k_reduce[] = "__reduce__";
2727 static const char __pyx_k_xrange[] = "xrange";
2728 static const char __pyx_k_DataMap[] = "DataMap";
2729 static const char __pyx_k_Index_2[] = "Index";
2730 static const char __pyx_k_NoWidth[] = "NoWidth";
2731 static const char __pyx_k_Runtime[] = "Runtime";
2732 static const char __pyx_k_cPickle[] = "cPickle";
2733 static const char __pyx_k_getcomm[] = "getcomm";
2734 static const char __pyx_k_pickled[] = "pickled";
2735 static const char __pyx_k_prepare[] = "__prepare__";
2736 static const char __pyx_k_pymusic[] = "pymusic";
2737 static const char __pyx_k_IndexMap[] = "IndexMap";
2738 static const char __pyx_k_getstate[] = "__getstate__";
2739 static const char __pyx_k_qualname[] = "__qualname__";
2740 static const char __pyx_k_required[] = "required";
2741 static const char __pyx_k_setstate[] = "__setstate__";
2742 static const char __pyx_k_COMM_NULL[] = "COMM_NULL";
2743 static const char __pyx_k_TypeError[] = "TypeError";
2744 static const char __pyx_k_index_map[] = "index_map";
2745 static const char __pyx_k_metaclass[] = "__metaclass__";
2746 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2747 static const char __pyx_k_six_moves[] = "six.moves";
2748 static const char __pyx_k_MUSICError[] = "MUSICError";
2749 static const char __pyx_k_ValueError[] = "ValueError";
2750 static const char __pyx_k_accLatency[] = "accLatency";
2751 static const char __pyx_k_mpi4py_MPI[] = "mpi4py.MPI";
2752 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2753 static const char __pyx_k_MemoryError[] = "MemoryError";
2754 static const char __pyx_k_interpolate[] = "interpolate";
2755 static const char __pyx_k_maxBuffered[] = "maxBuffered";
2756 static const char __pyx_k_predictRank[] = "predictRank";
2757 static const char __pyx_k_pymusic_pyx[] = "pymusic.pyx";
2758 static const char __pyx_k_EventHandler[] = "EventHandler";
2759 static const char __pyx_k_ContInputPort[] = "ContInputPort";
2760 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2761 static const char __pyx_k_ContOutputPort[] = "ContOutputPort";
2762 static const char __pyx_k_EventInputPort[] = "EventInputPort";
2763 static const char __pyx_k_MessageHandler[] = "MessageHandler";
2764 static const char __pyx_k_NoWidth___init[] = "NoWidth.__init__";
2765 static const char __pyx_k_Runtime___iter[] = "Runtime.__iter__";
2766 static const char __pyx_k_music_pybuffer[] = "music.pybuffer";
2767 static const char __pyx_k_EventOutputPort[] = "EventOutputPort";
2768 static const char __pyx_k_UndefinedConfig[] = "UndefinedConfig";
2769 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2770 static const char __pyx_k_HIGHEST_PROTOCOL[] = "HIGHEST_PROTOCOL";
2771 static const char __pyx_k_MessageInputPort[] = "MessageInputPort";
2772 static const char __pyx_k_No_width_defined[] = "No width defined";
2773 static const char __pyx_k_MessageOutputPort[] = "MessageOutputPort";
2774 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2775 static const char __pyx_k_argv_can_t_be_empty[] = "argv can't be empty";
2776 static const char __pyx_k_UndefinedConfig___init[] = "UndefinedConfig.__init__";
2777 static const char __pyx_k_couldn_t_allocate_argv[] = "couldn't allocate argv";
2778 static const char __pyx_k_Config_variable_is_not_defined[] = "Config variable {} is not defined";
2779 static const char __pyx_k_Thrown_if_Port_width_is_called[] = "\n Thrown if Port.width() is called, and port doesn't\n have a width defined.\n ";
2780 static const char __pyx_k_All_exceptions_in_pymusic_are_M[] = "\n All exceptions in pymusic are MUSICError's\n ";
2781 static const char __pyx_k_Thrown_if_a_configuration_value[] = "\n Thrown if a configuration value is requested\n via Setup.config(varname) for a variable name\n that has not been defined within the configuration.\n ";
2782 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2783 static PyObject *__pyx_kp_s_All_exceptions_in_pymusic_are_M;
2784 static PyObject *__pyx_n_s_Buffer;
2785 static PyObject *__pyx_n_s_COMM_NULL;
2786 static PyObject *__pyx_kp_s_Config_variable_is_not_defined;
2787 static PyObject *__pyx_n_s_ContInputPort;
2788 static PyObject *__pyx_n_s_ContOutputPort;
2789 static PyObject *__pyx_n_s_DataMap;
2790 static PyObject *__pyx_n_s_EventHandler;
2791 static PyObject *__pyx_n_s_EventInputPort;
2792 static PyObject *__pyx_n_s_EventOutputPort;
2793 static PyObject *__pyx_n_s_GLOBAL;
2794 static PyObject *__pyx_n_s_HIGHEST_PROTOCOL;
2795 static PyObject *__pyx_n_s_Index;
2796 static PyObject *__pyx_n_s_IndexMap;
2797 static PyObject *__pyx_n_s_Index_2;
2798 static PyObject *__pyx_n_s_LOCAL;
2799 static PyObject *__pyx_n_s_MPI;
2800 static PyObject *__pyx_n_s_MUSICError;
2801 static PyObject *__pyx_n_s_MemoryError;
2802 static PyObject *__pyx_n_s_MessageHandler;
2803 static PyObject *__pyx_n_s_MessageInputPort;
2804 static PyObject *__pyx_n_s_MessageOutputPort;
2805 static PyObject *__pyx_n_s_NoWidth;
2806 static PyObject *__pyx_n_s_NoWidth___init;
2807 static PyObject *__pyx_kp_s_No_width_defined;
2808 static PyObject *__pyx_n_s_Port;
2809 static PyObject *__pyx_n_s_Runtime;
2810 static PyObject *__pyx_n_s_Runtime___iter;
2811 static PyObject *__pyx_n_s_Setup;
2812 static PyObject *__pyx_kp_s_Thrown_if_Port_width_is_called;
2813 static PyObject *__pyx_kp_s_Thrown_if_a_configuration_value;
2814 static PyObject *__pyx_n_s_TypeError;
2815 static PyObject *__pyx_n_s_UndefinedConfig;
2816 static PyObject *__pyx_n_s_UndefinedConfig___init;
2817 static PyObject *__pyx_n_s_ValueError;
2818 static PyObject *__pyx_n_s__29;
2819 static PyObject *__pyx_n_s_accLatency;
2820 static PyObject *__pyx_n_s_args;
2821 static PyObject *__pyx_n_s_argv;
2822 static PyObject *__pyx_kp_s_argv_can_t_be_empty;
2823 static PyObject *__pyx_n_s_array;
2824 static PyObject *__pyx_n_s_base;
2825 static PyObject *__pyx_n_s_buf;
2826 static PyObject *__pyx_n_s_cPickle;
2827 static PyObject *__pyx_n_s_cline_in_traceback;
2828 static PyObject *__pyx_n_s_close;
2829 static PyObject *__pyx_kp_s_couldn_t_allocate_argv;
2830 static PyObject *__pyx_n_s_data;
2831 static PyObject *__pyx_n_s_delay;
2832 static PyObject *__pyx_n_s_doc;
2833 static PyObject *__pyx_n_s_dumps;
2834 static PyObject *__pyx_n_s_encode;
2835 static PyObject *__pyx_n_s_format;
2836 static PyObject *__pyx_n_s_func;
2837 static PyObject *__pyx_n_s_getcomm;
2838 static PyObject *__pyx_n_s_getstate;
2839 static PyObject *__pyx_n_s_h;
2840 static PyObject *__pyx_n_s_i;
2841 static PyObject *__pyx_n_s_import;
2842 static PyObject *__pyx_n_s_index;
2843 static PyObject *__pyx_n_s_index_map;
2844 static PyObject *__pyx_n_s_init;
2845 static PyObject *__pyx_n_s_interpolate;
2846 static PyObject *__pyx_n_s_iter;
2847 static PyObject *__pyx_n_s_loads;
2848 static PyObject *__pyx_n_s_main;
2849 static PyObject *__pyx_n_s_maxBuffered;
2850 static PyObject *__pyx_n_s_metaclass;
2851 static PyObject *__pyx_n_s_module;
2852 static PyObject *__pyx_n_s_mpi4py_MPI;
2853 static PyObject *__pyx_n_s_msg;
2854 static PyObject *__pyx_n_s_music_pybuffer;
2855 static PyObject *__pyx_n_s_name;
2856 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2857 static PyObject *__pyx_n_s_null;
2858 static PyObject *__pyx_n_s_perm;
2859 static PyObject *__pyx_n_s_pickle;
2860 static PyObject *__pyx_n_s_pickled;
2861 static PyObject *__pyx_n_s_predictRank;
2862 static PyObject *__pyx_n_s_prepare;
2863 static PyObject *__pyx_n_s_ptr;
2864 static PyObject *__pyx_n_s_pymusic;
2865 static PyObject *__pyx_kp_s_pymusic_pyx;
2866 static PyObject *__pyx_n_s_pyx_vtable;
2867 static PyObject *__pyx_n_s_qualname;
2868 static PyObject *__pyx_n_s_r;
2869 static PyObject *__pyx_n_s_range;
2870 static PyObject *__pyx_n_s_reduce;
2871 static PyObject *__pyx_n_s_reduce_cython;
2872 static PyObject *__pyx_n_s_reduce_ex;
2873 static PyObject *__pyx_n_s_required;
2874 static PyObject *__pyx_n_s_self;
2875 static PyObject *__pyx_n_s_send;
2876 static PyObject *__pyx_n_s_setstate;
2877 static PyObject *__pyx_n_s_setstate_cython;
2878 static PyObject *__pyx_n_s_setup;
2879 static PyObject *__pyx_n_s_six_moves;
2880 static PyObject *__pyx_n_s_size;
2881 static PyObject *__pyx_n_s_sys;
2882 static PyObject *__pyx_n_s_t;
2883 static PyObject *__pyx_n_s_test;
2884 static PyObject *__pyx_n_s_throw;
2885 static PyObject *__pyx_n_s_time;
2886 static PyObject *__pyx_n_s_var;
2887 static PyObject *__pyx_n_s_xrange;
2888 static PyObject *__pyx_pf_7pymusic_7NoWidth___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2889 static PyObject *__pyx_pf_7pymusic_15UndefinedConfig___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var); /* proto */
2890 static PyObject *__pyx_pf_7pymusic_predictRank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_argv); /* proto */
2891 static int __pyx_pf_7pymusic_4Port___cinit__(struct __pyx_obj_7pymusic_Port *__pyx_v_self); /* proto */
2892 static Py_hash_t __pyx_pf_7pymusic_4Port_2__hash__(struct __pyx_obj_7pymusic_Port *__pyx_v_self); /* proto */
2893 static PyObject *__pyx_pf_7pymusic_4Port_4null(struct __pyx_obj_7pymusic_Port *__pyx_v_self); /* proto */
2894 static PyObject *__pyx_pf_7pymusic_4Port_6isConnected(struct __pyx_obj_7pymusic_Port *__pyx_v_self); /* proto */
2895 static PyObject *__pyx_pf_7pymusic_4Port_8width(struct __pyx_obj_7pymusic_Port *__pyx_v_self); /* proto */
2896 static PyObject *__pyx_pf_7pymusic_4Port_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Port *__pyx_v_self); /* proto */
2897 static PyObject *__pyx_pf_7pymusic_4Port_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Port *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2898 static PyObject *__pyx_pf_7pymusic_13ContInputPort_map(struct __pyx_obj_7pymusic_ContInputPort *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_v_base, PyObject *__pyx_v_perm, double __pyx_v_delay, bool __pyx_v_interpolate, int __pyx_v_maxBuffered); /* proto */
2899 static PyObject *__pyx_pf_7pymusic_13ContInputPort_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_ContInputPort *__pyx_v_self); /* proto */
2900 static PyObject *__pyx_pf_7pymusic_13ContInputPort_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_ContInputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2901 static PyObject *__pyx_pf_7pymusic_14ContOutputPort_map(struct __pyx_obj_7pymusic_ContOutputPort *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_v_base, PyObject *__pyx_v_perm, int __pyx_v_maxBuffered); /* proto */
2902 static PyObject *__pyx_pf_7pymusic_14ContOutputPort_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_ContOutputPort *__pyx_v_self); /* proto */
2903 static PyObject *__pyx_pf_7pymusic_14ContOutputPort_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_ContOutputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2904 static int __pyx_pf_7pymusic_14EventInputPort___cinit__(struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self); /* proto */
2905 static PyObject *__pyx_pf_7pymusic_14EventInputPort_2null(struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self); /* proto */
2906 static PyObject *__pyx_pf_7pymusic_14EventInputPort_4map(struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self, PyObject *__pyx_v_func, MUSIC::Index::Type __pyx_v_t, double __pyx_v_accLatency, int __pyx_v_maxBuffered, PyObject *__pyx_v_perm, int __pyx_v_base, int __pyx_v_size); /* proto */
2907 static PyObject *__pyx_pf_7pymusic_14EventInputPort_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self); /* proto */
2908 static PyObject *__pyx_pf_7pymusic_14EventInputPort_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2909 static PyObject *__pyx_pf_7pymusic_15EventOutputPort_map(struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_self, MUSIC::Index::Type __pyx_v_t, int __pyx_v_maxBuffered, PyObject *__pyx_v_perm, int __pyx_v_base, int __pyx_v_size); /* proto */
2910 static PyObject *__pyx_pf_7pymusic_15EventOutputPort_2insertEvent(struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_self, double __pyx_v_time, int __pyx_v_index, CYTHON_UNUSED MUSIC::Index::Type __pyx_v_t); /* proto */
2911 static PyObject *__pyx_pf_7pymusic_15EventOutputPort_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_self); /* proto */
2912 static PyObject *__pyx_pf_7pymusic_15EventOutputPort_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2913 static int __pyx_pf_7pymusic_16MessageInputPort___cinit__(struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self); /* proto */
2914 static PyObject *__pyx_pf_7pymusic_16MessageInputPort_2null(struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self); /* proto */
2915 static PyObject *__pyx_pf_7pymusic_16MessageInputPort_4map(struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self, PyObject *__pyx_v_func, double __pyx_v_accLatency, int __pyx_v_maxBuffered, int __pyx_v_pickled); /* proto */
2916 static PyObject *__pyx_pf_7pymusic_16MessageInputPort_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self); /* proto */
2917 static PyObject *__pyx_pf_7pymusic_16MessageInputPort_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2918 static PyObject *__pyx_pf_7pymusic_17MessageOutputPort_map(struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_self, int __pyx_v_maxBuffered, int __pyx_v_pickled); /* proto */
2919 static PyObject *__pyx_pf_7pymusic_17MessageOutputPort_2insertMessage(struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_self, double __pyx_v_time, PyObject *__pyx_v_msg); /* proto */
2920 static PyObject *__pyx_pf_7pymusic_17MessageOutputPort_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_self); /* proto */
2921 static PyObject *__pyx_pf_7pymusic_17MessageOutputPort_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2922 static int __pyx_pf_7pymusic_5Setup___cinit__(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, PyObject *__pyx_v_argv, PyObject *__pyx_v_required); /* proto */
2923 static void __pyx_pf_7pymusic_5Setup_2__dealloc__(struct __pyx_obj_7pymusic_Setup *__pyx_v_self); /* proto */
2924 static PyObject *__pyx_pf_7pymusic_5Setup_4getcomm(struct __pyx_obj_7pymusic_Setup *__pyx_v_self); /* proto */
2925 static PyObject *__pyx_pf_7pymusic_5Setup_6config(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_var); /* proto */
2926 static PyObject *__pyx_pf_7pymusic_5Setup_8publishContInput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s); /* proto */
2927 static PyObject *__pyx_pf_7pymusic_5Setup_10publishContOutput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s); /* proto */
2928 static PyObject *__pyx_pf_7pymusic_5Setup_12publishEventOutput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s); /* proto */
2929 static PyObject *__pyx_pf_7pymusic_5Setup_14publishEventInput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s); /* proto */
2930 static PyObject *__pyx_pf_7pymusic_5Setup_16publishMessageOutput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s); /* proto */
2931 static PyObject *__pyx_pf_7pymusic_5Setup_18publishMessageInput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s); /* proto */
2932 static PyObject *__pyx_pf_7pymusic_5Setup_20runtime(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, double __pyx_v_timestep); /* proto */
2933 static PyObject *__pyx_pf_7pymusic_5Setup_4comm___get__(struct __pyx_obj_7pymusic_Setup *__pyx_v_self); /* proto */
2934 static PyObject *__pyx_pf_7pymusic_5Setup_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Setup *__pyx_v_self); /* proto */
2935 static PyObject *__pyx_pf_7pymusic_5Setup_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Setup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2936 static int __pyx_pf_7pymusic_7Runtime___cinit__(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self, struct __pyx_obj_7pymusic_Setup *__pyx_v_setup, double __pyx_v_h); /* proto */
2937 static void __pyx_pf_7pymusic_7Runtime_2__dealloc__(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self); /* proto */
2938 static PyObject *__pyx_pf_7pymusic_7Runtime_4time(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self); /* proto */
2939 static PyObject *__pyx_pf_7pymusic_7Runtime_6tick(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self); /* proto */
2940 static PyObject *__pyx_pf_7pymusic_7Runtime_8finalize(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self); /* proto */
2941 static PyObject *__pyx_pf_7pymusic_7Runtime_10__iter__(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self); /* proto */
2942 static PyObject *__pyx_pf_7pymusic_7Runtime_4comm___get__(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self); /* proto */
2943 static PyObject *__pyx_pf_7pymusic_7Runtime_13__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Runtime *__pyx_v_self); /* proto */
2944 static PyObject *__pyx_pf_7pymusic_7Runtime_15__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Runtime *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2945 static int __pyx_pf_7pymusic_8IndexMap___cinit__(struct __pyx_obj_7pymusic_IndexMap *__pyx_v_self, PyObject *__pyx_v_perm, int __pyx_v_base, int __pyx_v_size); /* proto */
2946 static void __pyx_pf_7pymusic_8IndexMap_2__dealloc__(struct __pyx_obj_7pymusic_IndexMap *__pyx_v_self); /* proto */
2947 static PyObject *__pyx_pf_7pymusic_8IndexMap_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_IndexMap *__pyx_v_self); /* proto */
2948 static PyObject *__pyx_pf_7pymusic_8IndexMap_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_IndexMap *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2949 static int __pyx_pf_7pymusic_7DataMap___cinit__(struct __pyx_obj_7pymusic_DataMap *__pyx_v_self, struct __pyx_obj_5music_8pybuffer_Buffer *__pyx_v_buf, struct __pyx_obj_7pymusic_IndexMap *__pyx_v_index_map, int __pyx_v_index); /* proto */
2950 static void __pyx_pf_7pymusic_7DataMap_2__dealloc__(struct __pyx_obj_7pymusic_DataMap *__pyx_v_self); /* proto */
2951 static PyObject *__pyx_pf_7pymusic_7DataMap_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_DataMap *__pyx_v_self); /* proto */
2952 static PyObject *__pyx_pf_7pymusic_7DataMap_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_DataMap *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2953 static int __pyx_pf_7pymusic_12EventHandler___cinit__(struct __pyx_obj_7pymusic_EventHandler *__pyx_v_self, PyObject *__pyx_v_func, MUSIC::Index::Type __pyx_v_t); /* proto */
2954 static void __pyx_pf_7pymusic_12EventHandler_2__dealloc__(struct __pyx_obj_7pymusic_EventHandler *__pyx_v_self); /* proto */
2955 static PyObject *__pyx_pf_7pymusic_12EventHandler_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventHandler *__pyx_v_self); /* proto */
2956 static PyObject *__pyx_pf_7pymusic_12EventHandler_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2957 static int __pyx_pf_7pymusic_6_Index___cinit__(struct __pyx_obj_7pymusic__Index *__pyx_v_self); /* proto */
2958 static PyObject *__pyx_pf_7pymusic_6_Index_2tostr(struct __pyx_obj_7pymusic__Index *__pyx_v_self, int __pyx_v_index); /* proto */
2959 static PyObject *__pyx_pf_7pymusic_6_Index_6GLOBAL___get__(struct __pyx_obj_7pymusic__Index *__pyx_v_self); /* proto */
2960 static PyObject *__pyx_pf_7pymusic_6_Index_5LOCAL___get__(struct __pyx_obj_7pymusic__Index *__pyx_v_self); /* proto */
2961 static PyObject *__pyx_pf_7pymusic_6_Index_7backmap___get__(struct __pyx_obj_7pymusic__Index *__pyx_v_self); /* proto */
2962 static PyObject *__pyx_pf_7pymusic_6_Index_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic__Index *__pyx_v_self); /* proto */
2963 static PyObject *__pyx_pf_7pymusic_6_Index_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic__Index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2964 static int __pyx_pf_7pymusic_14MessageHandler___cinit__(struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_self, PyObject *__pyx_v_func, int __pyx_v_pickled); /* proto */
2965 static void __pyx_pf_7pymusic_14MessageHandler_2__dealloc__(struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_self); /* proto */
2966 static PyObject *__pyx_pf_7pymusic_14MessageHandler_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_self); /* proto */
2967 static PyObject *__pyx_pf_7pymusic_14MessageHandler_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2968 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
2969 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2970 static PyObject *__pyx_tp_new_7pymusic_Setup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2971 static PyObject *__pyx_tp_new_7pymusic_Runtime(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2972 static PyObject *__pyx_tp_new_7pymusic_Port(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2973 static PyObject *__pyx_tp_new_7pymusic_ContInputPort(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2974 static PyObject *__pyx_tp_new_7pymusic_ContOutputPort(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2975 static PyObject *__pyx_tp_new_7pymusic_EventInputPort(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2976 static PyObject *__pyx_tp_new_7pymusic_EventOutputPort(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2977 static PyObject *__pyx_tp_new_7pymusic_MessageInputPort(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2978 static PyObject *__pyx_tp_new_7pymusic_MessageOutputPort(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2979 static PyObject *__pyx_tp_new_7pymusic_DataMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2980 static PyObject *__pyx_tp_new_7pymusic_IndexMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2981 static PyObject *__pyx_tp_new_7pymusic_EventHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2982 static PyObject *__pyx_tp_new_7pymusic_MessageHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2983 static PyObject *__pyx_tp_new_7pymusic__Index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2984 static PyObject *__pyx_tp_new_7pymusic___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2985 static PyObject *__pyx_tuple_;
2986 static PyObject *__pyx_tuple__2;
2987 static PyObject *__pyx_tuple__3;
2988 static PyObject *__pyx_tuple__4;
2989 static PyObject *__pyx_tuple__5;
2990 static PyObject *__pyx_tuple__6;
2991 static PyObject *__pyx_tuple__7;
2992 static PyObject *__pyx_tuple__8;
2993 static PyObject *__pyx_tuple__9;
2994 static PyObject *__pyx_tuple__10;
2995 static PyObject *__pyx_tuple__11;
2996 static PyObject *__pyx_tuple__12;
2997 static PyObject *__pyx_tuple__13;
2998 static PyObject *__pyx_tuple__14;
2999 static PyObject *__pyx_tuple__15;
3000 static PyObject *__pyx_tuple__16;
3001 static PyObject *__pyx_tuple__17;
3002 static PyObject *__pyx_tuple__18;
3003 static PyObject *__pyx_tuple__19;
3004 static PyObject *__pyx_tuple__20;
3005 static PyObject *__pyx_tuple__21;
3006 static PyObject *__pyx_tuple__22;
3007 static PyObject *__pyx_tuple__23;
3008 static PyObject *__pyx_tuple__24;
3009 static PyObject *__pyx_tuple__25;
3010 static PyObject *__pyx_tuple__26;
3011 static PyObject *__pyx_tuple__27;
3012 static PyObject *__pyx_tuple__28;
3013 static PyObject *__pyx_tuple__30;
3014 static PyObject *__pyx_tuple__32;
3015 static PyObject *__pyx_tuple__34;
3016 static PyObject *__pyx_codeobj__31;
3017 static PyObject *__pyx_codeobj__33;
3018 static PyObject *__pyx_codeobj__35;
3019 /* Late includes */
3020
3021 /* "pymusic.pyx":23
3022 * have a width defined.
3023 * """
3024 * def __init__(self): # <<<<<<<<<<<<<<
3025 * MUSICError.__init__(self, "No width defined")
3026 *
3027 */
3028
3029 /* Python wrapper */
3030 static PyObject *__pyx_pw_7pymusic_7NoWidth_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3031 static PyMethodDef __pyx_mdef_7pymusic_7NoWidth_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7pymusic_7NoWidth_1__init__, METH_O, 0};
3032 static PyObject *__pyx_pw_7pymusic_7NoWidth_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3033 PyObject *__pyx_r = 0;
3034 __Pyx_RefNannyDeclarations
3035 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3036 __pyx_r = __pyx_pf_7pymusic_7NoWidth___init__(__pyx_self, ((PyObject *)__pyx_v_self));
3037
3038 /* function exit code */
3039 __Pyx_RefNannyFinishContext();
3040 return __pyx_r;
3041 }
3042
3043 static PyObject *__pyx_pf_7pymusic_7NoWidth___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
3044 PyObject *__pyx_r = NULL;
3045 __Pyx_RefNannyDeclarations
3046 PyObject *__pyx_t_1 = NULL;
3047 PyObject *__pyx_t_2 = NULL;
3048 PyObject *__pyx_t_3 = NULL;
3049 int __pyx_t_4;
3050 PyObject *__pyx_t_5 = NULL;
3051 int __pyx_lineno = 0;
3052 const char *__pyx_filename = NULL;
3053 int __pyx_clineno = 0;
3054 __Pyx_RefNannySetupContext("__init__", 0);
3055
3056 /* "pymusic.pyx":24
3057 * """
3058 * def __init__(self):
3059 * MUSICError.__init__(self, "No width defined") # <<<<<<<<<<<<<<
3060 *
3061 * class UndefinedConfig(MUSICError):
3062 */
3063 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MUSICError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3064 __Pyx_GOTREF(__pyx_t_2);
3065 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
3066 __Pyx_GOTREF(__pyx_t_3);
3067 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3068 __pyx_t_2 = NULL;
3069 __pyx_t_4 = 0;
3070 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3071 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3072 if (likely(__pyx_t_2)) {
3073 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3074 __Pyx_INCREF(__pyx_t_2);
3075 __Pyx_INCREF(function);
3076 __Pyx_DECREF_SET(__pyx_t_3, function);
3077 __pyx_t_4 = 1;
3078 }
3079 }
3080 #if CYTHON_FAST_PYCALL
3081 if (PyFunction_Check(__pyx_t_3)) {
3082 PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_kp_s_No_width_defined};
3083 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3084 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3085 __Pyx_GOTREF(__pyx_t_1);
3086 } else
3087 #endif
3088 #if CYTHON_FAST_PYCCALL
3089 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3090 PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_kp_s_No_width_defined};
3091 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3092 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3093 __Pyx_GOTREF(__pyx_t_1);
3094 } else
3095 #endif
3096 {
3097 __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 24, __pyx_L1_error)
3098 __Pyx_GOTREF(__pyx_t_5);
3099 if (__pyx_t_2) {
3100 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
3101 }
3102 __Pyx_INCREF(__pyx_v_self);
3103 __Pyx_GIVEREF(__pyx_v_self);
3104 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
3105 __Pyx_INCREF(__pyx_kp_s_No_width_defined);
3106 __Pyx_GIVEREF(__pyx_kp_s_No_width_defined);
3107 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_s_No_width_defined);
3108 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3109 __Pyx_GOTREF(__pyx_t_1);
3110 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3111 }
3112 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3113 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3114
3115 /* "pymusic.pyx":23
3116 * have a width defined.
3117 * """
3118 * def __init__(self): # <<<<<<<<<<<<<<
3119 * MUSICError.__init__(self, "No width defined")
3120 *
3121 */
3122
3123 /* function exit code */
3124 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3125 goto __pyx_L0;
3126 __pyx_L1_error:;
3127 __Pyx_XDECREF(__pyx_t_1);
3128 __Pyx_XDECREF(__pyx_t_2);
3129 __Pyx_XDECREF(__pyx_t_3);
3130 __Pyx_XDECREF(__pyx_t_5);
3131 __Pyx_AddTraceback("pymusic.NoWidth.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3132 __pyx_r = NULL;
3133 __pyx_L0:;
3134 __Pyx_XGIVEREF(__pyx_r);
3135 __Pyx_RefNannyFinishContext();
3136 return __pyx_r;
3137 }
3138
3139 /* "pymusic.pyx":32
3140 * that has not been defined within the configuration.
3141 * """
3142 * def __init__(self, var): # <<<<<<<<<<<<<<
3143 * MUSICError.__init__(
3144 * self,
3145 */
3146
3147 /* Python wrapper */
3148 static PyObject *__pyx_pw_7pymusic_15UndefinedConfig_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3149 static PyMethodDef __pyx_mdef_7pymusic_15UndefinedConfig_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_15UndefinedConfig_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3150 static PyObject *__pyx_pw_7pymusic_15UndefinedConfig_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3151 PyObject *__pyx_v_self = 0;
3152 PyObject *__pyx_v_var = 0;
3153 int __pyx_lineno = 0;
3154 const char *__pyx_filename = NULL;
3155 int __pyx_clineno = 0;
3156 PyObject *__pyx_r = 0;
3157 __Pyx_RefNannyDeclarations
3158 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3159 {
3160 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var,0};
3161 PyObject* values[2] = {0,0};
3162 if (unlikely(__pyx_kwds)) {
3163 Py_ssize_t kw_args;
3164 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3165 switch (pos_args) {
3166 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3167 CYTHON_FALLTHROUGH;
3168 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3169 CYTHON_FALLTHROUGH;
3170 case 0: break;
3171 default: goto __pyx_L5_argtuple_error;
3172 }
3173 kw_args = PyDict_Size(__pyx_kwds);
3174 switch (pos_args) {
3175 case 0:
3176 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3177 else goto __pyx_L5_argtuple_error;
3178 CYTHON_FALLTHROUGH;
3179 case 1:
3180 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_var)) != 0)) kw_args--;
3181 else {
3182 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 32, __pyx_L3_error)
3183 }
3184 }
3185 if (unlikely(kw_args > 0)) {
3186 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 32, __pyx_L3_error)
3187 }
3188 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3189 goto __pyx_L5_argtuple_error;
3190 } else {
3191 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3192 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3193 }
3194 __pyx_v_self = values[0];
3195 __pyx_v_var = values[1];
3196 }
3197 goto __pyx_L4_argument_unpacking_done;
3198 __pyx_L5_argtuple_error:;
3199 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 32, __pyx_L3_error)
3200 __pyx_L3_error:;
3201 __Pyx_AddTraceback("pymusic.UndefinedConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3202 __Pyx_RefNannyFinishContext();
3203 return NULL;
3204 __pyx_L4_argument_unpacking_done:;
3205 __pyx_r = __pyx_pf_7pymusic_15UndefinedConfig___init__(__pyx_self, __pyx_v_self, __pyx_v_var);
3206
3207 /* function exit code */
3208 __Pyx_RefNannyFinishContext();
3209 return __pyx_r;
3210 }
3211
3212 static PyObject *__pyx_pf_7pymusic_15UndefinedConfig___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var) {
3213 PyObject *__pyx_r = NULL;
3214 __Pyx_RefNannyDeclarations
3215 PyObject *__pyx_t_1 = NULL;
3216 PyObject *__pyx_t_2 = NULL;
3217 PyObject *__pyx_t_3 = NULL;
3218 PyObject *__pyx_t_4 = NULL;
3219 PyObject *__pyx_t_5 = NULL;
3220 int __pyx_t_6;
3221 int __pyx_lineno = 0;
3222 const char *__pyx_filename = NULL;
3223 int __pyx_clineno = 0;
3224 __Pyx_RefNannySetupContext("__init__", 0);
3225
3226 /* "pymusic.pyx":33
3227 * """
3228 * def __init__(self, var):
3229 * MUSICError.__init__( # <<<<<<<<<<<<<<
3230 * self,
3231 * "Config variable {} is not defined".
3232 */
3233 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MUSICError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
3234 __Pyx_GOTREF(__pyx_t_2);
3235 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
3236 __Pyx_GOTREF(__pyx_t_3);
3237 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3238
3239 /* "pymusic.pyx":35
3240 * MUSICError.__init__(
3241 * self,
3242 * "Config variable {} is not defined". # <<<<<<<<<<<<<<
3243 * format(var)
3244 * )
3245 */
3246 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Config_variable_is_not_defined, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3247 __Pyx_GOTREF(__pyx_t_4);
3248
3249 /* "pymusic.pyx":36
3250 * self,
3251 * "Config variable {} is not defined".
3252 * format(var) # <<<<<<<<<<<<<<
3253 * )
3254 *
3255 */
3256 __pyx_t_5 = NULL;
3257 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3258 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3259 if (likely(__pyx_t_5)) {
3260 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3261 __Pyx_INCREF(__pyx_t_5);
3262 __Pyx_INCREF(function);
3263 __Pyx_DECREF_SET(__pyx_t_4, function);
3264 }
3265 }
3266 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_var) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_var);
3267 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3268 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
3269 __Pyx_GOTREF(__pyx_t_2);
3270 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3271 __pyx_t_4 = NULL;
3272 __pyx_t_6 = 0;
3273 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3274 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3275 if (likely(__pyx_t_4)) {
3276 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3277 __Pyx_INCREF(__pyx_t_4);
3278 __Pyx_INCREF(function);
3279 __Pyx_DECREF_SET(__pyx_t_3, function);
3280 __pyx_t_6 = 1;
3281 }
3282 }
3283 #if CYTHON_FAST_PYCALL
3284 if (PyFunction_Check(__pyx_t_3)) {
3285 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self, __pyx_t_2};
3286 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3287 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3288 __Pyx_GOTREF(__pyx_t_1);
3289 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3290 } else
3291 #endif
3292 #if CYTHON_FAST_PYCCALL
3293 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3294 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self, __pyx_t_2};
3295 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3296 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3297 __Pyx_GOTREF(__pyx_t_1);
3298 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3299 } else
3300 #endif
3301 {
3302 __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error)
3303 __Pyx_GOTREF(__pyx_t_5);
3304 if (__pyx_t_4) {
3305 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
3306 }
3307 __Pyx_INCREF(__pyx_v_self);
3308 __Pyx_GIVEREF(__pyx_v_self);
3309 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_self);
3310 __Pyx_GIVEREF(__pyx_t_2);
3311 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_2);
3312 __pyx_t_2 = 0;
3313 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3314 __Pyx_GOTREF(__pyx_t_1);
3315 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3316 }
3317 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3319
3320 /* "pymusic.pyx":32
3321 * that has not been defined within the configuration.
3322 * """
3323 * def __init__(self, var): # <<<<<<<<<<<<<<
3324 * MUSICError.__init__(
3325 * self,
3326 */
3327
3328 /* function exit code */
3329 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3330 goto __pyx_L0;
3331 __pyx_L1_error:;
3332 __Pyx_XDECREF(__pyx_t_1);
3333 __Pyx_XDECREF(__pyx_t_2);
3334 __Pyx_XDECREF(__pyx_t_3);
3335 __Pyx_XDECREF(__pyx_t_4);
3336 __Pyx_XDECREF(__pyx_t_5);
3337 __Pyx_AddTraceback("pymusic.UndefinedConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3338 __pyx_r = NULL;
3339 __pyx_L0:;
3340 __Pyx_XGIVEREF(__pyx_r);
3341 __Pyx_RefNannyFinishContext();
3342 return __pyx_r;
3343 }
3344
3345 /* "pymusic.pyx":52
3346 * char** argv
3347 *
3348 * cdef Args argv_toc(list argv): # <<<<<<<<<<<<<<
3349 * """
3350 * Convert an argv python list to a correct C argv & argc
3351 */
3352
3353 static __pyx_t_7pymusic_Args __pyx_f_7pymusic_argv_toc(PyObject *__pyx_v_argv) {
3354 __pyx_t_7pymusic_Args __pyx_v_r;
3355 long __pyx_v_i;
3356 PyObject *__pyx_v_s = NULL;
3357 __pyx_t_7pymusic_Args __pyx_r;
3358 __Pyx_RefNannyDeclarations
3359 Py_ssize_t __pyx_t_1;
3360 int __pyx_t_2;
3361 PyObject *__pyx_t_3 = NULL;
3362 PyObject *__pyx_t_4 = NULL;
3363 PyObject *__pyx_t_5 = NULL;
3364 PyObject *__pyx_t_6 = NULL;
3365 PyObject *__pyx_t_7 = NULL;
3366 PyObject *__pyx_t_8 = NULL;
3367 int __pyx_t_9;
3368 int __pyx_t_10;
3369 long __pyx_t_11;
3370 char *__pyx_t_12;
3371 int __pyx_lineno = 0;
3372 const char *__pyx_filename = NULL;
3373 int __pyx_clineno = 0;
3374 __Pyx_RefNannySetupContext("argv_toc", 0);
3375
3376 /* "pymusic.pyx":58
3377 * """
3378 * cdef Args r
3379 * r.argc = len(argv) # <<<<<<<<<<<<<<
3380 * if r.argc <= 0:
3381 * raise MUSICError("argv can't be empty")
3382 */
3383 if (unlikely(__pyx_v_argv == Py_None)) {
3384 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3385 __PYX_ERR(0, 58, __pyx_L1_error)
3386 }
3387 __pyx_t_1 = PyList_GET_SIZE(__pyx_v_argv); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 58, __pyx_L1_error)
3388 __pyx_v_r.argc = __pyx_t_1;
3389
3390 /* "pymusic.pyx":59
3391 * cdef Args r
3392 * r.argc = len(argv)
3393 * if r.argc <= 0: # <<<<<<<<<<<<<<
3394 * raise MUSICError("argv can't be empty")
3395 *
3396 */
3397 __pyx_t_2 = ((__pyx_v_r.argc <= 0) != 0);
3398 if (unlikely(__pyx_t_2)) {
3399
3400 /* "pymusic.pyx":60
3401 * r.argc = len(argv)
3402 * if r.argc <= 0:
3403 * raise MUSICError("argv can't be empty") # <<<<<<<<<<<<<<
3404 *
3405 * r.argv = <char**> malloc((r.argc+1) * sizeof(char*))
3406 */
3407 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MUSICError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
3408 __Pyx_GOTREF(__pyx_t_4);
3409 __pyx_t_5 = NULL;
3410 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3411 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3412 if (likely(__pyx_t_5)) {
3413 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3414 __Pyx_INCREF(__pyx_t_5);
3415 __Pyx_INCREF(function);
3416 __Pyx_DECREF_SET(__pyx_t_4, function);
3417 }
3418 }
3419 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_argv_can_t_be_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_argv_can_t_be_empty);
3420 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3421 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
3422 __Pyx_GOTREF(__pyx_t_3);
3423 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3424 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3425 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3426 __PYX_ERR(0, 60, __pyx_L1_error)
3427
3428 /* "pymusic.pyx":59
3429 * cdef Args r
3430 * r.argc = len(argv)
3431 * if r.argc <= 0: # <<<<<<<<<<<<<<
3432 * raise MUSICError("argv can't be empty")
3433 *
3434 */
3435 }
3436
3437 /* "pymusic.pyx":62
3438 * raise MUSICError("argv can't be empty")
3439 *
3440 * r.argv = <char**> malloc((r.argc+1) * sizeof(char*)) # <<<<<<<<<<<<<<
3441 * if r.argv is NULL:
3442 * raise MUSICError("couldn't allocate argv")
3443 */
3444 __pyx_v_r.argv = ((char **)malloc(((__pyx_v_r.argc + 1) * (sizeof(char *)))));
3445
3446 /* "pymusic.pyx":63
3447 *
3448 * r.argv = <char**> malloc((r.argc+1) * sizeof(char*))
3449 * if r.argv is NULL: # <<<<<<<<<<<<<<
3450 * raise MUSICError("couldn't allocate argv")
3451 *
3452 */
3453 __pyx_t_2 = ((__pyx_v_r.argv == NULL) != 0);
3454 if (unlikely(__pyx_t_2)) {
3455
3456 /* "pymusic.pyx":64
3457 * r.argv = <char**> malloc((r.argc+1) * sizeof(char*))
3458 * if r.argv is NULL:
3459 * raise MUSICError("couldn't allocate argv") # <<<<<<<<<<<<<<
3460 *
3461 * cdef string
3462 */
3463 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MUSICError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
3464 __Pyx_GOTREF(__pyx_t_4);
3465 __pyx_t_5 = NULL;
3466 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3467 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3468 if (likely(__pyx_t_5)) {
3469 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3470 __Pyx_INCREF(__pyx_t_5);
3471 __Pyx_INCREF(function);
3472 __Pyx_DECREF_SET(__pyx_t_4, function);
3473 }
3474 }
3475 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_couldn_t_allocate_argv) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_couldn_t_allocate_argv);
3476 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3477 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
3478 __Pyx_GOTREF(__pyx_t_3);
3479 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3480 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3481 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3482 __PYX_ERR(0, 64, __pyx_L1_error)
3483
3484 /* "pymusic.pyx":63
3485 *
3486 * r.argv = <char**> malloc((r.argc+1) * sizeof(char*))
3487 * if r.argv is NULL: # <<<<<<<<<<<<<<
3488 * raise MUSICError("couldn't allocate argv")
3489 *
3490 */
3491 }
3492
3493 /* "pymusic.pyx":67
3494 *
3495 * cdef string
3496 * try: # <<<<<<<<<<<<<<
3497 * r.argv[r.argc] = NULL
3498 * for i in range(0, r.argc):
3499 */
3500 {
3501 __Pyx_PyThreadState_declare
3502 __Pyx_PyThreadState_assign
3503 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3504 __Pyx_XGOTREF(__pyx_t_6);
3505 __Pyx_XGOTREF(__pyx_t_7);
3506 __Pyx_XGOTREF(__pyx_t_8);
3507 /*try:*/ {
3508
3509 /* "pymusic.pyx":68
3510 * cdef string
3511 * try:
3512 * r.argv[r.argc] = NULL # <<<<<<<<<<<<<<
3513 * for i in range(0, r.argc):
3514 * s = argv[i].encode()
3515 */
3516 (__pyx_v_r.argv[__pyx_v_r.argc]) = NULL;
3517
3518 /* "pymusic.pyx":69
3519 * try:
3520 * r.argv[r.argc] = NULL
3521 * for i in range(0, r.argc): # <<<<<<<<<<<<<<
3522 * s = argv[i].encode()
3523 * r.argv[i] = s
3524 */
3525 __pyx_t_9 = __pyx_v_r.argc;
3526 __pyx_t_10 = __pyx_t_9;
3527 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
3528 __pyx_v_i = __pyx_t_11;
3529
3530 /* "pymusic.pyx":70
3531 * r.argv[r.argc] = NULL
3532 * for i in range(0, r.argc):
3533 * s = argv[i].encode() # <<<<<<<<<<<<<<
3534 * r.argv[i] = s
3535 * return r
3536 */
3537 if (unlikely(__pyx_v_argv == Py_None)) {
3538 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3539 __PYX_ERR(0, 70, __pyx_L5_error)
3540 }
3541 __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_argv, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L5_error)
3542 __Pyx_GOTREF(__pyx_t_4);
3543 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L5_error)
3544 __Pyx_GOTREF(__pyx_t_5);
3545 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3546 __pyx_t_4 = NULL;
3547 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
3548 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
3549 if (likely(__pyx_t_4)) {
3550 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3551 __Pyx_INCREF(__pyx_t_4);
3552 __Pyx_INCREF(function);
3553 __Pyx_DECREF_SET(__pyx_t_5, function);
3554 }
3555 }
3556 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
3557 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3558 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L5_error)
3559 __Pyx_GOTREF(__pyx_t_3);
3560 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3561 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3);
3562 __pyx_t_3 = 0;
3563
3564 /* "pymusic.pyx":71
3565 * for i in range(0, r.argc):
3566 * s = argv[i].encode()
3567 * r.argv[i] = s # <<<<<<<<<<<<<<
3568 * return r
3569 * except:
3570 */
3571 __pyx_t_12 = __Pyx_PyObject_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L5_error)
3572 (__pyx_v_r.argv[__pyx_v_i]) = __pyx_t_12;
3573 }
3574
3575 /* "pymusic.pyx":72
3576 * s = argv[i].encode()
3577 * r.argv[i] = s
3578 * return r # <<<<<<<<<<<<<<
3579 * except:
3580 * free(r.argv)
3581 */
3582 __pyx_r = __pyx_v_r;
3583 goto __pyx_L9_try_return;
3584
3585 /* "pymusic.pyx":67
3586 *
3587 * cdef string
3588 * try: # <<<<<<<<<<<<<<
3589 * r.argv[r.argc] = NULL
3590 * for i in range(0, r.argc):
3591 */
3592 }
3593 __pyx_L5_error:;
3594 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3595 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3596 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3597
3598 /* "pymusic.pyx":73
3599 * r.argv[i] = s
3600 * return r
3601 * except: # <<<<<<<<<<<<<<
3602 * free(r.argv)
3603 * raise
3604 */
3605 /*except:*/ {
3606 __Pyx_AddTraceback("pymusic.argv_toc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3607 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 73, __pyx_L7_except_error)
3608 __Pyx_GOTREF(__pyx_t_3);
3609 __Pyx_GOTREF(__pyx_t_5);
3610 __Pyx_GOTREF(__pyx_t_4);
3611
3612 /* "pymusic.pyx":74
3613 * return r
3614 * except:
3615 * free(r.argv) # <<<<<<<<<<<<<<
3616 * raise
3617 *
3618 */
3619 free(__pyx_v_r.argv);
3620
3621 /* "pymusic.pyx":75
3622 * except:
3623 * free(r.argv)
3624 * raise # <<<<<<<<<<<<<<
3625 *
3626 * ###########################################################
3627 */
3628 __Pyx_GIVEREF(__pyx_t_3);
3629 __Pyx_GIVEREF(__pyx_t_5);
3630 __Pyx_XGIVEREF(__pyx_t_4);
3631 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_5, __pyx_t_4);
3632 __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0;
3633 __PYX_ERR(0, 75, __pyx_L7_except_error)
3634 }
3635 __pyx_L7_except_error:;
3636
3637 /* "pymusic.pyx":67
3638 *
3639 * cdef string
3640 * try: # <<<<<<<<<<<<<<
3641 * r.argv[r.argc] = NULL
3642 * for i in range(0, r.argc):
3643 */
3644 __Pyx_XGIVEREF(__pyx_t_6);
3645 __Pyx_XGIVEREF(__pyx_t_7);
3646 __Pyx_XGIVEREF(__pyx_t_8);
3647 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3648 goto __pyx_L1_error;
3649 __pyx_L9_try_return:;
3650 __Pyx_XGIVEREF(__pyx_t_6);
3651 __Pyx_XGIVEREF(__pyx_t_7);
3652 __Pyx_XGIVEREF(__pyx_t_8);
3653 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3654 goto __pyx_L0;
3655 }
3656
3657 /* "pymusic.pyx":52
3658 * char** argv
3659 *
3660 * cdef Args argv_toc(list argv): # <<<<<<<<<<<<<<
3661 * """
3662 * Convert an argv python list to a correct C argv & argc
3663 */
3664
3665 /* function exit code */
3666 __pyx_L1_error:;
3667 __Pyx_XDECREF(__pyx_t_3);
3668 __Pyx_XDECREF(__pyx_t_4);
3669 __Pyx_XDECREF(__pyx_t_5);
3670 __Pyx_WriteUnraisable("pymusic.argv_toc", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3671 __Pyx_pretend_to_initialize(&__pyx_r);
3672 __pyx_L0:;
3673 __Pyx_XDECREF(__pyx_v_s);
3674 __Pyx_RefNannyFinishContext();
3675 return __pyx_r;
3676 }
3677
3678 /* "pymusic.pyx":79
3679 * ###########################################################
3680 *
3681 * def predictRank(list argv=None): # <<<<<<<<<<<<<<
3682 * """
3683 * Map into mpidep/predict_rank for config methods.
3684 */
3685
3686 /* Python wrapper */
3687 static PyObject *__pyx_pw_7pymusic_1predictRank(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3688 static char __pyx_doc_7pymusic_predictRank[] = "\n Map into mpidep/predict_rank for config methods.\n AP: What is this really used for?\n ";
3689 static PyMethodDef __pyx_mdef_7pymusic_1predictRank = {"predictRank", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_1predictRank, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_predictRank};
3690 static PyObject *__pyx_pw_7pymusic_1predictRank(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3691 PyObject *__pyx_v_argv = 0;
3692 int __pyx_lineno = 0;
3693 const char *__pyx_filename = NULL;
3694 int __pyx_clineno = 0;
3695 PyObject *__pyx_r = 0;
3696 __Pyx_RefNannyDeclarations
3697 __Pyx_RefNannySetupContext("predictRank (wrapper)", 0);
3698 {
3699 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_argv,0};
3700 PyObject* values[1] = {0};
3701 values[0] = ((PyObject*)Py_None);
3702 if (unlikely(__pyx_kwds)) {
3703 Py_ssize_t kw_args;
3704 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3705 switch (pos_args) {
3706 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3707 CYTHON_FALLTHROUGH;
3708 case 0: break;
3709 default: goto __pyx_L5_argtuple_error;
3710 }
3711 kw_args = PyDict_Size(__pyx_kwds);
3712 switch (pos_args) {
3713 case 0:
3714 if (kw_args > 0) {
3715 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_argv);
3716 if (value) { values[0] = value; kw_args--; }
3717 }
3718 }
3719 if (unlikely(kw_args > 0)) {
3720 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predictRank") < 0)) __PYX_ERR(0, 79, __pyx_L3_error)
3721 }
3722 } else {
3723 switch (PyTuple_GET_SIZE(__pyx_args)) {
3724 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3725 CYTHON_FALLTHROUGH;
3726 case 0: break;
3727 default: goto __pyx_L5_argtuple_error;
3728 }
3729 }
3730 __pyx_v_argv = ((PyObject*)values[0]);
3731 }
3732 goto __pyx_L4_argument_unpacking_done;
3733 __pyx_L5_argtuple_error:;
3734 __Pyx_RaiseArgtupleInvalid("predictRank", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 79, __pyx_L3_error)
3735 __pyx_L3_error:;
3736 __Pyx_AddTraceback("pymusic.predictRank", __pyx_clineno, __pyx_lineno, __pyx_filename);
3737 __Pyx_RefNannyFinishContext();
3738 return NULL;
3739 __pyx_L4_argument_unpacking_done:;
3740 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_argv), (&PyList_Type), 1, "argv", 1))) __PYX_ERR(0, 79, __pyx_L1_error)
3741 __pyx_r = __pyx_pf_7pymusic_predictRank(__pyx_self, __pyx_v_argv);
3742
3743 /* function exit code */
3744 goto __pyx_L0;
3745 __pyx_L1_error:;
3746 __pyx_r = NULL;
3747 __pyx_L0:;
3748 __Pyx_RefNannyFinishContext();
3749 return __pyx_r;
3750 }
3751
3752 static PyObject *__pyx_pf_7pymusic_predictRank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_argv) {
3753 __pyx_t_7pymusic_Args __pyx_v_r;
3754 PyObject *__pyx_r = NULL;
3755 __Pyx_RefNannyDeclarations
3756 PyObject *__pyx_t_1 = NULL;
3757 int __pyx_t_2;
3758 PyObject *__pyx_t_3 = NULL;
3759 PyObject *__pyx_t_4 = NULL;
3760 int __pyx_lineno = 0;
3761 const char *__pyx_filename = NULL;
3762 int __pyx_clineno = 0;
3763 __Pyx_RefNannySetupContext("predictRank", 0);
3764
3765 /* "pymusic.pyx":84
3766 * AP: What is this really used for?
3767 * """
3768 * cdef Args r = argv_toc(argv if argv is not None else # <<<<<<<<<<<<<<
3769 * sys.argv)
3770 * return CPredictRank(r.argc, r.argv)
3771 */
3772 __pyx_t_2 = (__pyx_v_argv != ((PyObject*)Py_None));
3773 if ((__pyx_t_2 != 0)) {
3774 __Pyx_INCREF(__pyx_v_argv);
3775 __pyx_t_1 = __pyx_v_argv;
3776 } else {
3777
3778 /* "pymusic.pyx":85
3779 * """
3780 * cdef Args r = argv_toc(argv if argv is not None else
3781 * sys.argv) # <<<<<<<<<<<<<<
3782 * return CPredictRank(r.argc, r.argv)
3783 *
3784 */
3785 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
3786 __Pyx_GOTREF(__pyx_t_3);
3787 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
3788 __Pyx_GOTREF(__pyx_t_4);
3789 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3790 if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 85, __pyx_L1_error)
3791 __pyx_t_1 = __pyx_t_4;
3792 __pyx_t_4 = 0;
3793 }
3794
3795 /* "pymusic.pyx":84
3796 * AP: What is this really used for?
3797 * """
3798 * cdef Args r = argv_toc(argv if argv is not None else # <<<<<<<<<<<<<<
3799 * sys.argv)
3800 * return CPredictRank(r.argc, r.argv)
3801 */
3802 __pyx_v_r = __pyx_f_7pymusic_argv_toc(((PyObject*)__pyx_t_1));
3803 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3804
3805 /* "pymusic.pyx":86
3806 * cdef Args r = argv_toc(argv if argv is not None else
3807 * sys.argv)
3808 * return CPredictRank(r.argc, r.argv) # <<<<<<<<<<<<<<
3809 *
3810 * ###########################################################
3811 */
3812 __Pyx_XDECREF(__pyx_r);
3813 __pyx_t_1 = __Pyx_PyInt_From_int(MUSIC::predictRank(__pyx_v_r.argc, __pyx_v_r.argv)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
3814 __Pyx_GOTREF(__pyx_t_1);
3815 __pyx_r = __pyx_t_1;
3816 __pyx_t_1 = 0;
3817 goto __pyx_L0;
3818
3819 /* "pymusic.pyx":79
3820 * ###########################################################
3821 *
3822 * def predictRank(list argv=None): # <<<<<<<<<<<<<<
3823 * """
3824 * Map into mpidep/predict_rank for config methods.
3825 */
3826
3827 /* function exit code */
3828 __pyx_L1_error:;
3829 __Pyx_XDECREF(__pyx_t_1);
3830 __Pyx_XDECREF(__pyx_t_3);
3831 __Pyx_XDECREF(__pyx_t_4);
3832 __Pyx_AddTraceback("pymusic.predictRank", __pyx_clineno, __pyx_lineno, __pyx_filename);
3833 __pyx_r = NULL;
3834 __pyx_L0:;
3835 __Pyx_XGIVEREF(__pyx_r);
3836 __Pyx_RefNannyFinishContext();
3837 return __pyx_r;
3838 }
3839
3840 /* "pymusic.pyx":99
3841 * container.
3842 * """
3843 * def __cinit__(self): # <<<<<<<<<<<<<<
3844 * """
3845 * When a Port object is created, it needs to have an underlying
3846 */
3847
3848 /* Python wrapper */
3849 static int __pyx_pw_7pymusic_4Port_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3850 static int __pyx_pw_7pymusic_4Port_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3851 int __pyx_r;
3852 __Pyx_RefNannyDeclarations
3853 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3854 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
3855 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
3856 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
3857 __pyx_r = __pyx_pf_7pymusic_4Port___cinit__(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self));
3858
3859 /* function exit code */
3860 __Pyx_RefNannyFinishContext();
3861 return __pyx_r;
3862 }
3863
3864 static int __pyx_pf_7pymusic_4Port___cinit__(struct __pyx_obj_7pymusic_Port *__pyx_v_self) {
3865 int __pyx_r;
3866 __Pyx_RefNannyDeclarations
3867 __Pyx_RefNannySetupContext("__cinit__", 0);
3868
3869 /* "pymusic.pyx":104
3870 * C++ class assigned to ptr from a Setup.publish* method.
3871 * """
3872 * self.ptr = NULL # <<<<<<<<<<<<<<
3873 *
3874 * def __hash__(self):
3875 */
3876 __pyx_v_self->ptr = NULL;
3877
3878 /* "pymusic.pyx":99
3879 * container.
3880 * """
3881 * def __cinit__(self): # <<<<<<<<<<<<<<
3882 * """
3883 * When a Port object is created, it needs to have an underlying
3884 */
3885
3886 /* function exit code */
3887 __pyx_r = 0;
3888 __Pyx_RefNannyFinishContext();
3889 return __pyx_r;
3890 }
3891
3892 /* "pymusic.pyx":106
3893 * self.ptr = NULL
3894 *
3895 * def __hash__(self): # <<<<<<<<<<<<<<
3896 * """
3897 * Hash function: pointer value % to an int.
3898 */
3899
3900 /* Python wrapper */
3901 static Py_hash_t __pyx_pw_7pymusic_4Port_3__hash__(PyObject *__pyx_v_self); /*proto*/
3902 static char __pyx_doc_7pymusic_4Port_2__hash__[] = "\n Hash function: pointer value % to an int.\n ";
3903 #if CYTHON_UPDATE_DESCRIPTOR_DOC
3904 struct wrapperbase __pyx_wrapperbase_7pymusic_4Port_2__hash__;
3905 #endif
3906 static Py_hash_t __pyx_pw_7pymusic_4Port_3__hash__(PyObject *__pyx_v_self) {
3907 Py_hash_t __pyx_r;
3908 __Pyx_RefNannyDeclarations
3909 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
3910 __pyx_r = __pyx_pf_7pymusic_4Port_2__hash__(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self));
3911
3912 /* function exit code */
3913 __Pyx_RefNannyFinishContext();
3914 return __pyx_r;
3915 }
3916
3917 static Py_hash_t __pyx_pf_7pymusic_4Port_2__hash__(struct __pyx_obj_7pymusic_Port *__pyx_v_self) {
3918 Py_hash_t __pyx_r;
3919 __Pyx_RefNannyDeclarations
3920 __Pyx_RefNannySetupContext("__hash__", 0);
3921
3922 /* "pymusic.pyx":110
3923 * Hash function: pointer value % to an int.
3924 * """
3925 * return <int><size_t> self.ptr # <<<<<<<<<<<<<<
3926 *
3927 * cpdef null(self):
3928 */
3929 __pyx_r = ((int)((size_t)__pyx_v_self->ptr));
3930 goto __pyx_L0;
3931
3932 /* "pymusic.pyx":106
3933 * self.ptr = NULL
3934 *
3935 * def __hash__(self): # <<<<<<<<<<<<<<
3936 * """
3937 * Hash function: pointer value % to an int.
3938 */
3939
3940 /* function exit code */
3941 __pyx_L0:;
3942 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
3943 __Pyx_RefNannyFinishContext();
3944 return __pyx_r;
3945 }
3946
3947 /* "pymusic.pyx":112
3948 * return <int><size_t> self.ptr
3949 *
3950 * cpdef null(self): # <<<<<<<<<<<<<<
3951 * """
3952 * When Setup or Runtime no longer needs ports and so may deallocate
3953 */
3954
3955 static PyObject *__pyx_pw_7pymusic_4Port_5null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3956 static PyObject *__pyx_f_7pymusic_4Port_null(struct __pyx_obj_7pymusic_Port *__pyx_v_self, int __pyx_skip_dispatch) {
3957 PyObject *__pyx_r = NULL;
3958 __Pyx_RefNannyDeclarations
3959 PyObject *__pyx_t_1 = NULL;
3960 PyObject *__pyx_t_2 = NULL;
3961 PyObject *__pyx_t_3 = NULL;
3962 PyObject *__pyx_t_4 = NULL;
3963 int __pyx_lineno = 0;
3964 const char *__pyx_filename = NULL;
3965 int __pyx_clineno = 0;
3966 __Pyx_RefNannySetupContext("null", 0);
3967 /* Check if called by wrapper */
3968 if (unlikely(__pyx_skip_dispatch)) ;
3969 /* Check if overridden in Python */
3970 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3971 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3972 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3973 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3974 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3975 #endif
3976 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
3977 __Pyx_GOTREF(__pyx_t_1);
3978 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pymusic_4Port_5null)) {
3979 __Pyx_XDECREF(__pyx_r);
3980 __Pyx_INCREF(__pyx_t_1);
3981 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
3982 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3983 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3984 if (likely(__pyx_t_4)) {
3985 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3986 __Pyx_INCREF(__pyx_t_4);
3987 __Pyx_INCREF(function);
3988 __Pyx_DECREF_SET(__pyx_t_3, function);
3989 }
3990 }
3991 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3992 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3993 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
3994 __Pyx_GOTREF(__pyx_t_2);
3995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3996 __pyx_r = __pyx_t_2;
3997 __pyx_t_2 = 0;
3998 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3999 goto __pyx_L0;
4000 }
4001 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4002 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4003 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4004 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4005 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4006 }
4007 #endif
4008 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4009 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4010 }
4011 #endif
4012 }
4013
4014 /* "pymusic.pyx":119
4015 * the descendants
4016 * """
4017 * self.ptr = NULL # <<<<<<<<<<<<<<
4018 *
4019 * def isConnected(self):
4020 */
4021 __pyx_v_self->ptr = NULL;
4022
4023 /* "pymusic.pyx":112
4024 * return <int><size_t> self.ptr
4025 *
4026 * cpdef null(self): # <<<<<<<<<<<<<<
4027 * """
4028 * When Setup or Runtime no longer needs ports and so may deallocate
4029 */
4030
4031 /* function exit code */
4032 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4033 goto __pyx_L0;
4034 __pyx_L1_error:;
4035 __Pyx_XDECREF(__pyx_t_1);
4036 __Pyx_XDECREF(__pyx_t_2);
4037 __Pyx_XDECREF(__pyx_t_3);
4038 __Pyx_XDECREF(__pyx_t_4);
4039 __Pyx_AddTraceback("pymusic.Port.null", __pyx_clineno, __pyx_lineno, __pyx_filename);
4040 __pyx_r = 0;
4041 __pyx_L0:;
4042 __Pyx_XGIVEREF(__pyx_r);
4043 __Pyx_RefNannyFinishContext();
4044 return __pyx_r;
4045 }
4046
4047 /* Python wrapper */
4048 static PyObject *__pyx_pw_7pymusic_4Port_5null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4049 static char __pyx_doc_7pymusic_4Port_4null[] = "\n When Setup or Runtime no longer needs ports and so may deallocate\n them, we first must clear the references to them here. This\n may be overridden to give up references to other members by\n the descendants\n ";
4050 static PyObject *__pyx_pw_7pymusic_4Port_5null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4051 PyObject *__pyx_r = 0;
4052 __Pyx_RefNannyDeclarations
4053 __Pyx_RefNannySetupContext("null (wrapper)", 0);
4054 __pyx_r = __pyx_pf_7pymusic_4Port_4null(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self));
4055
4056 /* function exit code */
4057 __Pyx_RefNannyFinishContext();
4058 return __pyx_r;
4059 }
4060
4061 static PyObject *__pyx_pf_7pymusic_4Port_4null(struct __pyx_obj_7pymusic_Port *__pyx_v_self) {
4062 PyObject *__pyx_r = NULL;
4063 __Pyx_RefNannyDeclarations
4064 PyObject *__pyx_t_1 = NULL;
4065 int __pyx_lineno = 0;
4066 const char *__pyx_filename = NULL;
4067 int __pyx_clineno = 0;
4068 __Pyx_RefNannySetupContext("null", 0);
4069 __Pyx_XDECREF(__pyx_r);
4070 __pyx_t_1 = __pyx_f_7pymusic_4Port_null(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
4071 __Pyx_GOTREF(__pyx_t_1);
4072 __pyx_r = __pyx_t_1;
4073 __pyx_t_1 = 0;
4074 goto __pyx_L0;
4075
4076 /* function exit code */
4077 __pyx_L1_error:;
4078 __Pyx_XDECREF(__pyx_t_1);
4079 __Pyx_AddTraceback("pymusic.Port.null", __pyx_clineno, __pyx_lineno, __pyx_filename);
4080 __pyx_r = NULL;
4081 __pyx_L0:;
4082 __Pyx_XGIVEREF(__pyx_r);
4083 __Pyx_RefNannyFinishContext();
4084 return __pyx_r;
4085 }
4086
4087 /* "pymusic.pyx":121
4088 * self.ptr = NULL
4089 *
4090 * def isConnected(self): # <<<<<<<<<<<<<<
4091 * """
4092 * return True iff the port is actually connected via the config
4093 */
4094
4095 /* Python wrapper */
4096 static PyObject *__pyx_pw_7pymusic_4Port_7isConnected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4097 static char __pyx_doc_7pymusic_4Port_6isConnected[] = "\n return True iff the port is actually connected via the config\n file.\n ";
4098 static PyObject *__pyx_pw_7pymusic_4Port_7isConnected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4099 PyObject *__pyx_r = 0;
4100 __Pyx_RefNannyDeclarations
4101 __Pyx_RefNannySetupContext("isConnected (wrapper)", 0);
4102 __pyx_r = __pyx_pf_7pymusic_4Port_6isConnected(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self));
4103
4104 /* function exit code */
4105 __Pyx_RefNannyFinishContext();
4106 return __pyx_r;
4107 }
4108
4109 static PyObject *__pyx_pf_7pymusic_4Port_6isConnected(struct __pyx_obj_7pymusic_Port *__pyx_v_self) {
4110 PyObject *__pyx_r = NULL;
4111 __Pyx_RefNannyDeclarations
4112 PyObject *__pyx_t_1 = NULL;
4113 int __pyx_lineno = 0;
4114 const char *__pyx_filename = NULL;
4115 int __pyx_clineno = 0;
4116 __Pyx_RefNannySetupContext("isConnected", 0);
4117
4118 /* "pymusic.pyx":126
4119 * file.
4120 * """
4121 * return self.ptr.isConnected() # <<<<<<<<<<<<<<
4122 *
4123 * def width(self):
4124 */
4125 __Pyx_XDECREF(__pyx_r);
4126 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->ptr->isConnected()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
4127 __Pyx_GOTREF(__pyx_t_1);
4128 __pyx_r = __pyx_t_1;
4129 __pyx_t_1 = 0;
4130 goto __pyx_L0;
4131
4132 /* "pymusic.pyx":121
4133 * self.ptr = NULL
4134 *
4135 * def isConnected(self): # <<<<<<<<<<<<<<
4136 * """
4137 * return True iff the port is actually connected via the config
4138 */
4139
4140 /* function exit code */
4141 __pyx_L1_error:;
4142 __Pyx_XDECREF(__pyx_t_1);
4143 __Pyx_AddTraceback("pymusic.Port.isConnected", __pyx_clineno, __pyx_lineno, __pyx_filename);
4144 __pyx_r = NULL;
4145 __pyx_L0:;
4146 __Pyx_XGIVEREF(__pyx_r);
4147 __Pyx_RefNannyFinishContext();
4148 return __pyx_r;
4149 }
4150
4151 /* "pymusic.pyx":128
4152 * return self.ptr.isConnected()
4153 *
4154 * def width(self): # <<<<<<<<<<<<<<
4155 * """
4156 * Returns the width set in the MUSIC config file
4157 */
4158
4159 /* Python wrapper */
4160 static PyObject *__pyx_pw_7pymusic_4Port_9width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4161 static char __pyx_doc_7pymusic_4Port_8width[] = "\n Returns the width set in the MUSIC config file\n which defines the number of indices transferred\n along this port. If no width is defined, raise a NoWidth\n exception.\n ";
4162 static PyObject *__pyx_pw_7pymusic_4Port_9width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4163 PyObject *__pyx_r = 0;
4164 __Pyx_RefNannyDeclarations
4165 __Pyx_RefNannySetupContext("width (wrapper)", 0);
4166 __pyx_r = __pyx_pf_7pymusic_4Port_8width(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self));
4167
4168 /* function exit code */
4169 __Pyx_RefNannyFinishContext();
4170 return __pyx_r;
4171 }
4172
4173 static PyObject *__pyx_pf_7pymusic_4Port_8width(struct __pyx_obj_7pymusic_Port *__pyx_v_self) {
4174 PyObject *__pyx_r = NULL;
4175 __Pyx_RefNannyDeclarations
4176 int __pyx_t_1;
4177 PyObject *__pyx_t_2 = NULL;
4178 PyObject *__pyx_t_3 = NULL;
4179 PyObject *__pyx_t_4 = NULL;
4180 int __pyx_lineno = 0;
4181 const char *__pyx_filename = NULL;
4182 int __pyx_clineno = 0;
4183 __Pyx_RefNannySetupContext("width", 0);
4184
4185 /* "pymusic.pyx":135
4186 * exception.
4187 * """
4188 * if not self.ptr.hasWidth(): raise NoWidth() # <<<<<<<<<<<<<<
4189 * return self.ptr.width()
4190 *
4191 */
4192 __pyx_t_1 = ((!(__pyx_v_self->ptr->hasWidth() != 0)) != 0);
4193 if (unlikely(__pyx_t_1)) {
4194 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoWidth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
4195 __Pyx_GOTREF(__pyx_t_3);
4196 __pyx_t_4 = NULL;
4197 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4198 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4199 if (likely(__pyx_t_4)) {
4200 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4201 __Pyx_INCREF(__pyx_t_4);
4202 __Pyx_INCREF(function);
4203 __Pyx_DECREF_SET(__pyx_t_3, function);
4204 }
4205 }
4206 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4207 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4208 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
4209 __Pyx_GOTREF(__pyx_t_2);
4210 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4211 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4212 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4213 __PYX_ERR(0, 135, __pyx_L1_error)
4214 }
4215
4216 /* "pymusic.pyx":136
4217 * """
4218 * if not self.ptr.hasWidth(): raise NoWidth()
4219 * return self.ptr.width() # <<<<<<<<<<<<<<
4220 *
4221 * cdef class ContInputPort(Port):
4222 */
4223 __Pyx_XDECREF(__pyx_r);
4224 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->ptr->width()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
4225 __Pyx_GOTREF(__pyx_t_2);
4226 __pyx_r = __pyx_t_2;
4227 __pyx_t_2 = 0;
4228 goto __pyx_L0;
4229
4230 /* "pymusic.pyx":128
4231 * return self.ptr.isConnected()
4232 *
4233 * def width(self): # <<<<<<<<<<<<<<
4234 * """
4235 * Returns the width set in the MUSIC config file
4236 */
4237
4238 /* function exit code */
4239 __pyx_L1_error:;
4240 __Pyx_XDECREF(__pyx_t_2);
4241 __Pyx_XDECREF(__pyx_t_3);
4242 __Pyx_XDECREF(__pyx_t_4);
4243 __Pyx_AddTraceback("pymusic.Port.width", __pyx_clineno, __pyx_lineno, __pyx_filename);
4244 __pyx_r = NULL;
4245 __pyx_L0:;
4246 __Pyx_XGIVEREF(__pyx_r);
4247 __Pyx_RefNannyFinishContext();
4248 return __pyx_r;
4249 }
4250
4251 /* "(tree fragment)":1
4252 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4253 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4254 * def __setstate_cython__(self, __pyx_state):
4255 */
4256
4257 /* Python wrapper */
4258 static PyObject *__pyx_pw_7pymusic_4Port_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4259 static PyObject *__pyx_pw_7pymusic_4Port_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4260 PyObject *__pyx_r = 0;
4261 __Pyx_RefNannyDeclarations
4262 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4263 __pyx_r = __pyx_pf_7pymusic_4Port_10__reduce_cython__(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self));
4264
4265 /* function exit code */
4266 __Pyx_RefNannyFinishContext();
4267 return __pyx_r;
4268 }
4269
4270 static PyObject *__pyx_pf_7pymusic_4Port_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Port *__pyx_v_self) {
4271 PyObject *__pyx_r = NULL;
4272 __Pyx_RefNannyDeclarations
4273 PyObject *__pyx_t_1 = NULL;
4274 int __pyx_lineno = 0;
4275 const char *__pyx_filename = NULL;
4276 int __pyx_clineno = 0;
4277 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4278
4279 /* "(tree fragment)":2
4280 * def __reduce_cython__(self):
4281 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4282 * def __setstate_cython__(self, __pyx_state):
4283 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4284 */
4285 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4286 __Pyx_GOTREF(__pyx_t_1);
4287 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4289 __PYX_ERR(1, 2, __pyx_L1_error)
4290
4291 /* "(tree fragment)":1
4292 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4293 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4294 * def __setstate_cython__(self, __pyx_state):
4295 */
4296
4297 /* function exit code */
4298 __pyx_L1_error:;
4299 __Pyx_XDECREF(__pyx_t_1);
4300 __Pyx_AddTraceback("pymusic.Port.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4301 __pyx_r = NULL;
4302 __Pyx_XGIVEREF(__pyx_r);
4303 __Pyx_RefNannyFinishContext();
4304 return __pyx_r;
4305 }
4306
4307 /* "(tree fragment)":3
4308 * def __reduce_cython__(self):
4309 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4310 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4311 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4312 */
4313
4314 /* Python wrapper */
4315 static PyObject *__pyx_pw_7pymusic_4Port_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4316 static PyObject *__pyx_pw_7pymusic_4Port_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4317 PyObject *__pyx_r = 0;
4318 __Pyx_RefNannyDeclarations
4319 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4320 __pyx_r = __pyx_pf_7pymusic_4Port_12__setstate_cython__(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4321
4322 /* function exit code */
4323 __Pyx_RefNannyFinishContext();
4324 return __pyx_r;
4325 }
4326
4327 static PyObject *__pyx_pf_7pymusic_4Port_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Port *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4328 PyObject *__pyx_r = NULL;
4329 __Pyx_RefNannyDeclarations
4330 PyObject *__pyx_t_1 = NULL;
4331 int __pyx_lineno = 0;
4332 const char *__pyx_filename = NULL;
4333 int __pyx_clineno = 0;
4334 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4335
4336 /* "(tree fragment)":4
4337 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4338 * def __setstate_cython__(self, __pyx_state):
4339 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4340 */
4341 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4342 __Pyx_GOTREF(__pyx_t_1);
4343 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4344 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4345 __PYX_ERR(1, 4, __pyx_L1_error)
4346
4347 /* "(tree fragment)":3
4348 * def __reduce_cython__(self):
4349 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4350 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4351 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4352 */
4353
4354 /* function exit code */
4355 __pyx_L1_error:;
4356 __Pyx_XDECREF(__pyx_t_1);
4357 __Pyx_AddTraceback("pymusic.Port.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4358 __pyx_r = NULL;
4359 __Pyx_XGIVEREF(__pyx_r);
4360 __Pyx_RefNannyFinishContext();
4361 return __pyx_r;
4362 }
4363
4364 /* "pymusic.pyx":144
4365 * Setup.publishContInputPort(portname).
4366 * """
4367 * def map(self, # <<<<<<<<<<<<<<
4368 * object data,
4369 * int base=0,
4370 */
4371
4372 /* Python wrapper */
4373 static PyObject *__pyx_pw_7pymusic_13ContInputPort_1map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4374 static char __pyx_doc_7pymusic_13ContInputPort_map[] = "\n map data as source for this port. (Can you do a multiple mapping?)\n\n object data: object to be shared that has a buffer interface.\n That interface needs to be contiguous formed of\n simple items that can be mapped to simple MPI\n data types.\n int base (=0), object perm (=None): used to construct an\n IndexMap (with number of items in data). See that\n class for more information. Defines mapping for data\n between this input source and the output sinks.\n double delay (=0): this is the delay of measurement relative\n to \"something\" which I haven't been able to\n figure out yet --- needs to be explained.\n interpolate (=True): whether to do a linear interpolation of\n the values that are being delayed. Once\n again, needs to be better explained.\n maxBuffered (=-1): buffer up to maxBuffered ticks. If -1, use\n a \"reasonable value\" (\077\077?). What does this\n mean on the input side?\n ";
4375 static PyObject *__pyx_pw_7pymusic_13ContInputPort_1map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4376 PyObject *__pyx_v_data = 0;
4377 int __pyx_v_base;
4378 PyObject *__pyx_v_perm = 0;
4379 double __pyx_v_delay;
4380 bool __pyx_v_interpolate;
4381 int __pyx_v_maxBuffered;
4382 int __pyx_lineno = 0;
4383 const char *__pyx_filename = NULL;
4384 int __pyx_clineno = 0;
4385 PyObject *__pyx_r = 0;
4386 __Pyx_RefNannyDeclarations
4387 __Pyx_RefNannySetupContext("map (wrapper)", 0);
4388 {
4389 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_base,&__pyx_n_s_perm,&__pyx_n_s_delay,&__pyx_n_s_interpolate,&__pyx_n_s_maxBuffered,0};
4390 PyObject* values[6] = {0,0,0,0,0,0};
4391
4392 /* "pymusic.pyx":147
4393 * object data,
4394 * int base=0,
4395 * object perm=None, # <<<<<<<<<<<<<<
4396 * double delay=0,
4397 * cbool interpolate=True,
4398 */
4399 values[2] = ((PyObject *)Py_None);
4400 if (unlikely(__pyx_kwds)) {
4401 Py_ssize_t kw_args;
4402 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4403 switch (pos_args) {
4404 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4405 CYTHON_FALLTHROUGH;
4406 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4407 CYTHON_FALLTHROUGH;
4408 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4409 CYTHON_FALLTHROUGH;
4410 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4411 CYTHON_FALLTHROUGH;
4412 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4413 CYTHON_FALLTHROUGH;
4414 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4415 CYTHON_FALLTHROUGH;
4416 case 0: break;
4417 default: goto __pyx_L5_argtuple_error;
4418 }
4419 kw_args = PyDict_Size(__pyx_kwds);
4420 switch (pos_args) {
4421 case 0:
4422 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
4423 else goto __pyx_L5_argtuple_error;
4424 CYTHON_FALLTHROUGH;
4425 case 1:
4426 if (kw_args > 0) {
4427 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
4428 if (value) { values[1] = value; kw_args--; }
4429 }
4430 CYTHON_FALLTHROUGH;
4431 case 2:
4432 if (kw_args > 0) {
4433 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_perm);
4434 if (value) { values[2] = value; kw_args--; }
4435 }
4436 CYTHON_FALLTHROUGH;
4437 case 3:
4438 if (kw_args > 0) {
4439 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delay);
4440 if (value) { values[3] = value; kw_args--; }
4441 }
4442 CYTHON_FALLTHROUGH;
4443 case 4:
4444 if (kw_args > 0) {
4445 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
4446 if (value) { values[4] = value; kw_args--; }
4447 }
4448 CYTHON_FALLTHROUGH;
4449 case 5:
4450 if (kw_args > 0) {
4451 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxBuffered);
4452 if (value) { values[5] = value; kw_args--; }
4453 }
4454 }
4455 if (unlikely(kw_args > 0)) {
4456 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 144, __pyx_L3_error)
4457 }
4458 } else {
4459 switch (PyTuple_GET_SIZE(__pyx_args)) {
4460 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4461 CYTHON_FALLTHROUGH;
4462 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4463 CYTHON_FALLTHROUGH;
4464 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4465 CYTHON_FALLTHROUGH;
4466 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4467 CYTHON_FALLTHROUGH;
4468 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4469 CYTHON_FALLTHROUGH;
4470 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4471 break;
4472 default: goto __pyx_L5_argtuple_error;
4473 }
4474 }
4475 __pyx_v_data = values[0];
4476 if (values[1]) {
4477 __pyx_v_base = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error)
4478 } else {
4479 __pyx_v_base = ((int)0);
4480 }
4481 __pyx_v_perm = values[2];
4482 if (values[3]) {
4483 __pyx_v_delay = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_delay == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L3_error)
4484 } else {
4485 __pyx_v_delay = ((double)0.0);
4486 }
4487 if (values[4]) {
4488 __pyx_v_interpolate = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_interpolate == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L3_error)
4489 } else {
4490
4491 /* "pymusic.pyx":149
4492 * object perm=None,
4493 * double delay=0,
4494 * cbool interpolate=True, # <<<<<<<<<<<<<<
4495 * int maxBuffered=-1):
4496 * """
4497 */
4498 __pyx_v_interpolate = ((bool)1);
4499 }
4500 if (values[5]) {
4501 __pyx_v_maxBuffered = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_maxBuffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error)
4502 } else {
4503 __pyx_v_maxBuffered = ((int)-1);
4504 }
4505 }
4506 goto __pyx_L4_argument_unpacking_done;
4507 __pyx_L5_argtuple_error:;
4508 __Pyx_RaiseArgtupleInvalid("map", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 144, __pyx_L3_error)
4509 __pyx_L3_error:;
4510 __Pyx_AddTraceback("pymusic.ContInputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
4511 __Pyx_RefNannyFinishContext();
4512 return NULL;
4513 __pyx_L4_argument_unpacking_done:;
4514 __pyx_r = __pyx_pf_7pymusic_13ContInputPort_map(((struct __pyx_obj_7pymusic_ContInputPort *)__pyx_v_self), __pyx_v_data, __pyx_v_base, __pyx_v_perm, __pyx_v_delay, __pyx_v_interpolate, __pyx_v_maxBuffered);
4515
4516 /* "pymusic.pyx":144
4517 * Setup.publishContInputPort(portname).
4518 * """
4519 * def map(self, # <<<<<<<<<<<<<<
4520 * object data,
4521 * int base=0,
4522 */
4523
4524 /* function exit code */
4525 __Pyx_RefNannyFinishContext();
4526 return __pyx_r;
4527 }
4528
4529 static PyObject *__pyx_pf_7pymusic_13ContInputPort_map(struct __pyx_obj_7pymusic_ContInputPort *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_v_base, PyObject *__pyx_v_perm, double __pyx_v_delay, bool __pyx_v_interpolate, int __pyx_v_maxBuffered) {
4530 struct __pyx_obj_5music_8pybuffer_Buffer *__pyx_v_buf = 0;
4531 struct __pyx_obj_7pymusic_IndexMap *__pyx_v_imap = 0;
4532 struct __pyx_obj_7pymusic_DataMap *__pyx_v_d = 0;
4533 MUSIC::ContInputPort *__pyx_v_ptr;
4534 PyObject *__pyx_r = NULL;
4535 __Pyx_RefNannyDeclarations
4536 PyObject *__pyx_t_1 = NULL;
4537 PyObject *__pyx_t_2 = NULL;
4538 PyObject *__pyx_t_3 = NULL;
4539 int __pyx_lineno = 0;
4540 const char *__pyx_filename = NULL;
4541 int __pyx_clineno = 0;
4542 __Pyx_RefNannySetupContext("map", 0);
4543
4544 /* "pymusic.pyx":172
4545 * mean on the input side?
4546 * """
4547 * cdef Buffer buf = Buffer(data) # <<<<<<<<<<<<<<
4548 * cdef IndexMap imap = IndexMap(perm, base, buf.items)
4549 * cdef DataMap d = DataMap(buf, imap)
4550 */
4551 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5music_8pybuffer_Buffer), __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
4552 __Pyx_GOTREF(__pyx_t_1);
4553 __pyx_v_buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)__pyx_t_1);
4554 __pyx_t_1 = 0;
4555
4556 /* "pymusic.pyx":173
4557 * """
4558 * cdef Buffer buf = Buffer(data)
4559 * cdef IndexMap imap = IndexMap(perm, base, buf.items) # <<<<<<<<<<<<<<
4560 * cdef DataMap d = DataMap(buf, imap)
4561 * cdef CContInputPort* ptr = dc_CContInputPort(self.ptr)
4562 */
4563 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
4564 __Pyx_GOTREF(__pyx_t_1);
4565 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_buf->items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
4566 __Pyx_GOTREF(__pyx_t_2);
4567 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
4568 __Pyx_GOTREF(__pyx_t_3);
4569 __Pyx_INCREF(__pyx_v_perm);
4570 __Pyx_GIVEREF(__pyx_v_perm);
4571 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_perm);
4572 __Pyx_GIVEREF(__pyx_t_1);
4573 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
4574 __Pyx_GIVEREF(__pyx_t_2);
4575 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
4576 __pyx_t_1 = 0;
4577 __pyx_t_2 = 0;
4578 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_IndexMap), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
4579 __Pyx_GOTREF(__pyx_t_2);
4580 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4581 __pyx_v_imap = ((struct __pyx_obj_7pymusic_IndexMap *)__pyx_t_2);
4582 __pyx_t_2 = 0;
4583
4584 /* "pymusic.pyx":174
4585 * cdef Buffer buf = Buffer(data)
4586 * cdef IndexMap imap = IndexMap(perm, base, buf.items)
4587 * cdef DataMap d = DataMap(buf, imap) # <<<<<<<<<<<<<<
4588 * cdef CContInputPort* ptr = dc_CContInputPort(self.ptr)
4589 * mapImpl(ptr, d.ptr, delay, maxBuffered, interpolate)
4590 */
4591 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
4592 __Pyx_GOTREF(__pyx_t_2);
4593 __Pyx_INCREF(((PyObject *)__pyx_v_buf));
4594 __Pyx_GIVEREF(((PyObject *)__pyx_v_buf));
4595 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_buf));
4596 __Pyx_INCREF(((PyObject *)__pyx_v_imap));
4597 __Pyx_GIVEREF(((PyObject *)__pyx_v_imap));
4598 PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_imap));
4599 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_DataMap), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
4600 __Pyx_GOTREF(__pyx_t_3);
4601 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4602 __pyx_v_d = ((struct __pyx_obj_7pymusic_DataMap *)__pyx_t_3);
4603 __pyx_t_3 = 0;
4604
4605 /* "pymusic.pyx":175
4606 * cdef IndexMap imap = IndexMap(perm, base, buf.items)
4607 * cdef DataMap d = DataMap(buf, imap)
4608 * cdef CContInputPort* ptr = dc_CContInputPort(self.ptr) # <<<<<<<<<<<<<<
4609 * mapImpl(ptr, d.ptr, delay, maxBuffered, interpolate)
4610 *
4611 */
4612 __pyx_v_ptr = dynamic_cast<MUSIC::ContInputPort*>(__pyx_v_self->__pyx_base.ptr);
4613
4614 /* "pymusic.pyx":176
4615 * cdef DataMap d = DataMap(buf, imap)
4616 * cdef CContInputPort* ptr = dc_CContInputPort(self.ptr)
4617 * mapImpl(ptr, d.ptr, delay, maxBuffered, interpolate) # <<<<<<<<<<<<<<
4618 *
4619 * cdef class ContOutputPort(Port):
4620 */
4621 MUSIC::Implementer::mapImpl(__pyx_v_ptr, __pyx_v_d->ptr, __pyx_v_delay, __pyx_v_maxBuffered, __pyx_v_interpolate);
4622
4623 /* "pymusic.pyx":144
4624 * Setup.publishContInputPort(portname).
4625 * """
4626 * def map(self, # <<<<<<<<<<<<<<
4627 * object data,
4628 * int base=0,
4629 */
4630
4631 /* function exit code */
4632 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4633 goto __pyx_L0;
4634 __pyx_L1_error:;
4635 __Pyx_XDECREF(__pyx_t_1);
4636 __Pyx_XDECREF(__pyx_t_2);
4637 __Pyx_XDECREF(__pyx_t_3);
4638 __Pyx_AddTraceback("pymusic.ContInputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
4639 __pyx_r = NULL;
4640 __pyx_L0:;
4641 __Pyx_XDECREF((PyObject *)__pyx_v_buf);
4642 __Pyx_XDECREF((PyObject *)__pyx_v_imap);
4643 __Pyx_XDECREF((PyObject *)__pyx_v_d);
4644 __Pyx_XGIVEREF(__pyx_r);
4645 __Pyx_RefNannyFinishContext();
4646 return __pyx_r;
4647 }
4648
4649 /* "(tree fragment)":1
4650 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4651 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4652 * def __setstate_cython__(self, __pyx_state):
4653 */
4654
4655 /* Python wrapper */
4656 static PyObject *__pyx_pw_7pymusic_13ContInputPort_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4657 static PyObject *__pyx_pw_7pymusic_13ContInputPort_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4658 PyObject *__pyx_r = 0;
4659 __Pyx_RefNannyDeclarations
4660 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4661 __pyx_r = __pyx_pf_7pymusic_13ContInputPort_2__reduce_cython__(((struct __pyx_obj_7pymusic_ContInputPort *)__pyx_v_self));
4662
4663 /* function exit code */
4664 __Pyx_RefNannyFinishContext();
4665 return __pyx_r;
4666 }
4667
4668 static PyObject *__pyx_pf_7pymusic_13ContInputPort_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_ContInputPort *__pyx_v_self) {
4669 PyObject *__pyx_r = NULL;
4670 __Pyx_RefNannyDeclarations
4671 PyObject *__pyx_t_1 = NULL;
4672 int __pyx_lineno = 0;
4673 const char *__pyx_filename = NULL;
4674 int __pyx_clineno = 0;
4675 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4676
4677 /* "(tree fragment)":2
4678 * def __reduce_cython__(self):
4679 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4680 * def __setstate_cython__(self, __pyx_state):
4681 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4682 */
4683 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4684 __Pyx_GOTREF(__pyx_t_1);
4685 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4686 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4687 __PYX_ERR(1, 2, __pyx_L1_error)
4688
4689 /* "(tree fragment)":1
4690 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4691 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4692 * def __setstate_cython__(self, __pyx_state):
4693 */
4694
4695 /* function exit code */
4696 __pyx_L1_error:;
4697 __Pyx_XDECREF(__pyx_t_1);
4698 __Pyx_AddTraceback("pymusic.ContInputPort.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4699 __pyx_r = NULL;
4700 __Pyx_XGIVEREF(__pyx_r);
4701 __Pyx_RefNannyFinishContext();
4702 return __pyx_r;
4703 }
4704
4705 /* "(tree fragment)":3
4706 * def __reduce_cython__(self):
4707 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4708 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4709 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4710 */
4711
4712 /* Python wrapper */
4713 static PyObject *__pyx_pw_7pymusic_13ContInputPort_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4714 static PyObject *__pyx_pw_7pymusic_13ContInputPort_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4715 PyObject *__pyx_r = 0;
4716 __Pyx_RefNannyDeclarations
4717 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4718 __pyx_r = __pyx_pf_7pymusic_13ContInputPort_4__setstate_cython__(((struct __pyx_obj_7pymusic_ContInputPort *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4719
4720 /* function exit code */
4721 __Pyx_RefNannyFinishContext();
4722 return __pyx_r;
4723 }
4724
4725 static PyObject *__pyx_pf_7pymusic_13ContInputPort_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_ContInputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4726 PyObject *__pyx_r = NULL;
4727 __Pyx_RefNannyDeclarations
4728 PyObject *__pyx_t_1 = NULL;
4729 int __pyx_lineno = 0;
4730 const char *__pyx_filename = NULL;
4731 int __pyx_clineno = 0;
4732 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4733
4734 /* "(tree fragment)":4
4735 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4736 * def __setstate_cython__(self, __pyx_state):
4737 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4738 */
4739 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4740 __Pyx_GOTREF(__pyx_t_1);
4741 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4742 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4743 __PYX_ERR(1, 4, __pyx_L1_error)
4744
4745 /* "(tree fragment)":3
4746 * def __reduce_cython__(self):
4747 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4748 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4749 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4750 */
4751
4752 /* function exit code */
4753 __pyx_L1_error:;
4754 __Pyx_XDECREF(__pyx_t_1);
4755 __Pyx_AddTraceback("pymusic.ContInputPort.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4756 __pyx_r = NULL;
4757 __Pyx_XGIVEREF(__pyx_r);
4758 __Pyx_RefNannyFinishContext();
4759 return __pyx_r;
4760 }
4761
4762 /* "pymusic.pyx":184
4763 * Setup.publishContOutputPort(portname).
4764 * """
4765 * def map(self, object data, # <<<<<<<<<<<<<<
4766 * int base=0, object perm=None,
4767 * int maxBuffered=-1):
4768 */
4769
4770 /* Python wrapper */
4771 static PyObject *__pyx_pw_7pymusic_14ContOutputPort_1map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4772 static char __pyx_doc_7pymusic_14ContOutputPort_map[] = "\n map data as sink for this port. (Can you do a multiple mapping?)\n\n object data: object to be shared that has a buffer interface.\n That interface needs to be contiguous formed of\n simple items that can be mapped to simple MPI\n data types.\n int base (=0), object perm (=None): used to construct an\n IndexMap (with number of items in data). See that\n class for more information. Defines mapping for data\n between this input source and the output sinks.\n maxBuffered (=-1): buffer up to maxBuffered ticks. If -1, use\n a \"reasonable value\" (\077\077?).\n ";
4773 static PyObject *__pyx_pw_7pymusic_14ContOutputPort_1map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4774 PyObject *__pyx_v_data = 0;
4775 int __pyx_v_base;
4776 PyObject *__pyx_v_perm = 0;
4777 int __pyx_v_maxBuffered;
4778 int __pyx_lineno = 0;
4779 const char *__pyx_filename = NULL;
4780 int __pyx_clineno = 0;
4781 PyObject *__pyx_r = 0;
4782 __Pyx_RefNannyDeclarations
4783 __Pyx_RefNannySetupContext("map (wrapper)", 0);
4784 {
4785 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_base,&__pyx_n_s_perm,&__pyx_n_s_maxBuffered,0};
4786 PyObject* values[4] = {0,0,0,0};
4787
4788 /* "pymusic.pyx":185
4789 * """
4790 * def map(self, object data,
4791 * int base=0, object perm=None, # <<<<<<<<<<<<<<
4792 * int maxBuffered=-1):
4793 * """
4794 */
4795 values[2] = ((PyObject *)Py_None);
4796 if (unlikely(__pyx_kwds)) {
4797 Py_ssize_t kw_args;
4798 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4799 switch (pos_args) {
4800 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4801 CYTHON_FALLTHROUGH;
4802 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4803 CYTHON_FALLTHROUGH;
4804 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4805 CYTHON_FALLTHROUGH;
4806 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4807 CYTHON_FALLTHROUGH;
4808 case 0: break;
4809 default: goto __pyx_L5_argtuple_error;
4810 }
4811 kw_args = PyDict_Size(__pyx_kwds);
4812 switch (pos_args) {
4813 case 0:
4814 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
4815 else goto __pyx_L5_argtuple_error;
4816 CYTHON_FALLTHROUGH;
4817 case 1:
4818 if (kw_args > 0) {
4819 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
4820 if (value) { values[1] = value; kw_args--; }
4821 }
4822 CYTHON_FALLTHROUGH;
4823 case 2:
4824 if (kw_args > 0) {
4825 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_perm);
4826 if (value) { values[2] = value; kw_args--; }
4827 }
4828 CYTHON_FALLTHROUGH;
4829 case 3:
4830 if (kw_args > 0) {
4831 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxBuffered);
4832 if (value) { values[3] = value; kw_args--; }
4833 }
4834 }
4835 if (unlikely(kw_args > 0)) {
4836 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 184, __pyx_L3_error)
4837 }
4838 } else {
4839 switch (PyTuple_GET_SIZE(__pyx_args)) {
4840 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4841 CYTHON_FALLTHROUGH;
4842 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4843 CYTHON_FALLTHROUGH;
4844 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4845 CYTHON_FALLTHROUGH;
4846 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4847 break;
4848 default: goto __pyx_L5_argtuple_error;
4849 }
4850 }
4851 __pyx_v_data = values[0];
4852 if (values[1]) {
4853 __pyx_v_base = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L3_error)
4854 } else {
4855 __pyx_v_base = ((int)0);
4856 }
4857 __pyx_v_perm = values[2];
4858 if (values[3]) {
4859 __pyx_v_maxBuffered = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_maxBuffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error)
4860 } else {
4861 __pyx_v_maxBuffered = ((int)-1);
4862 }
4863 }
4864 goto __pyx_L4_argument_unpacking_done;
4865 __pyx_L5_argtuple_error:;
4866 __Pyx_RaiseArgtupleInvalid("map", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 184, __pyx_L3_error)
4867 __pyx_L3_error:;
4868 __Pyx_AddTraceback("pymusic.ContOutputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
4869 __Pyx_RefNannyFinishContext();
4870 return NULL;
4871 __pyx_L4_argument_unpacking_done:;
4872 __pyx_r = __pyx_pf_7pymusic_14ContOutputPort_map(((struct __pyx_obj_7pymusic_ContOutputPort *)__pyx_v_self), __pyx_v_data, __pyx_v_base, __pyx_v_perm, __pyx_v_maxBuffered);
4873
4874 /* "pymusic.pyx":184
4875 * Setup.publishContOutputPort(portname).
4876 * """
4877 * def map(self, object data, # <<<<<<<<<<<<<<
4878 * int base=0, object perm=None,
4879 * int maxBuffered=-1):
4880 */
4881
4882 /* function exit code */
4883 __Pyx_RefNannyFinishContext();
4884 return __pyx_r;
4885 }
4886
4887 static PyObject *__pyx_pf_7pymusic_14ContOutputPort_map(struct __pyx_obj_7pymusic_ContOutputPort *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_v_base, PyObject *__pyx_v_perm, int __pyx_v_maxBuffered) {
4888 struct __pyx_obj_5music_8pybuffer_Buffer *__pyx_v_buf = 0;
4889 struct __pyx_obj_7pymusic_IndexMap *__pyx_v_imap = 0;
4890 struct __pyx_obj_7pymusic_DataMap *__pyx_v_d = 0;
4891 MUSIC::ContOutputPort *__pyx_v_ptr;
4892 PyObject *__pyx_r = NULL;
4893 __Pyx_RefNannyDeclarations
4894 PyObject *__pyx_t_1 = NULL;
4895 PyObject *__pyx_t_2 = NULL;
4896 PyObject *__pyx_t_3 = NULL;
4897 int __pyx_lineno = 0;
4898 const char *__pyx_filename = NULL;
4899 int __pyx_clineno = 0;
4900 __Pyx_RefNannySetupContext("map", 0);
4901
4902 /* "pymusic.pyx":201
4903 * a "reasonable value" (???).
4904 * """
4905 * cdef Buffer buf = Buffer(data) # <<<<<<<<<<<<<<
4906 * cdef IndexMap imap = IndexMap(perm, base, buf.items)
4907 * cdef DataMap d = DataMap(buf, imap)
4908 */
4909 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5music_8pybuffer_Buffer), __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
4910 __Pyx_GOTREF(__pyx_t_1);
4911 __pyx_v_buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)__pyx_t_1);
4912 __pyx_t_1 = 0;
4913
4914 /* "pymusic.pyx":202
4915 * """
4916 * cdef Buffer buf = Buffer(data)
4917 * cdef IndexMap imap = IndexMap(perm, base, buf.items) # <<<<<<<<<<<<<<
4918 * cdef DataMap d = DataMap(buf, imap)
4919 * cdef CContOutputPort* ptr = dc_CContOutputPort(self.ptr)
4920 */
4921 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
4922 __Pyx_GOTREF(__pyx_t_1);
4923 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_buf->items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
4924 __Pyx_GOTREF(__pyx_t_2);
4925 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
4926 __Pyx_GOTREF(__pyx_t_3);
4927 __Pyx_INCREF(__pyx_v_perm);
4928 __Pyx_GIVEREF(__pyx_v_perm);
4929 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_perm);
4930 __Pyx_GIVEREF(__pyx_t_1);
4931 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
4932 __Pyx_GIVEREF(__pyx_t_2);
4933 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
4934 __pyx_t_1 = 0;
4935 __pyx_t_2 = 0;
4936 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_IndexMap), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
4937 __Pyx_GOTREF(__pyx_t_2);
4938 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4939 __pyx_v_imap = ((struct __pyx_obj_7pymusic_IndexMap *)__pyx_t_2);
4940 __pyx_t_2 = 0;
4941
4942 /* "pymusic.pyx":203
4943 * cdef Buffer buf = Buffer(data)
4944 * cdef IndexMap imap = IndexMap(perm, base, buf.items)
4945 * cdef DataMap d = DataMap(buf, imap) # <<<<<<<<<<<<<<
4946 * cdef CContOutputPort* ptr = dc_CContOutputPort(self.ptr)
4947 * mapImpl(ptr, d.ptr, maxBuffered)
4948 */
4949 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
4950 __Pyx_GOTREF(__pyx_t_2);
4951 __Pyx_INCREF(((PyObject *)__pyx_v_buf));
4952 __Pyx_GIVEREF(((PyObject *)__pyx_v_buf));
4953 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_buf));
4954 __Pyx_INCREF(((PyObject *)__pyx_v_imap));
4955 __Pyx_GIVEREF(((PyObject *)__pyx_v_imap));
4956 PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_imap));
4957 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_DataMap), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error)
4958 __Pyx_GOTREF(__pyx_t_3);
4959 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4960 __pyx_v_d = ((struct __pyx_obj_7pymusic_DataMap *)__pyx_t_3);
4961 __pyx_t_3 = 0;
4962
4963 /* "pymusic.pyx":204
4964 * cdef IndexMap imap = IndexMap(perm, base, buf.items)
4965 * cdef DataMap d = DataMap(buf, imap)
4966 * cdef CContOutputPort* ptr = dc_CContOutputPort(self.ptr) # <<<<<<<<<<<<<<
4967 * mapImpl(ptr, d.ptr, maxBuffered)
4968 *
4969 */
4970 __pyx_v_ptr = dynamic_cast<MUSIC::ContOutputPort*>(__pyx_v_self->__pyx_base.ptr);
4971
4972 /* "pymusic.pyx":205
4973 * cdef DataMap d = DataMap(buf, imap)
4974 * cdef CContOutputPort* ptr = dc_CContOutputPort(self.ptr)
4975 * mapImpl(ptr, d.ptr, maxBuffered) # <<<<<<<<<<<<<<
4976 *
4977 * cdef class EventInputPort(Port):
4978 */
4979 MUSIC::Implementer::mapImpl(__pyx_v_ptr, __pyx_v_d->ptr, __pyx_v_maxBuffered);
4980
4981 /* "pymusic.pyx":184
4982 * Setup.publishContOutputPort(portname).
4983 * """
4984 * def map(self, object data, # <<<<<<<<<<<<<<
4985 * int base=0, object perm=None,
4986 * int maxBuffered=-1):
4987 */
4988
4989 /* function exit code */
4990 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4991 goto __pyx_L0;
4992 __pyx_L1_error:;
4993 __Pyx_XDECREF(__pyx_t_1);
4994 __Pyx_XDECREF(__pyx_t_2);
4995 __Pyx_XDECREF(__pyx_t_3);
4996 __Pyx_AddTraceback("pymusic.ContOutputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
4997 __pyx_r = NULL;
4998 __pyx_L0:;
4999 __Pyx_XDECREF((PyObject *)__pyx_v_buf);
5000 __Pyx_XDECREF((PyObject *)__pyx_v_imap);
5001 __Pyx_XDECREF((PyObject *)__pyx_v_d);
5002 __Pyx_XGIVEREF(__pyx_r);
5003 __Pyx_RefNannyFinishContext();
5004 return __pyx_r;
5005 }
5006
5007 /* "(tree fragment)":1
5008 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5009 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5010 * def __setstate_cython__(self, __pyx_state):
5011 */
5012
5013 /* Python wrapper */
5014 static PyObject *__pyx_pw_7pymusic_14ContOutputPort_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5015 static PyObject *__pyx_pw_7pymusic_14ContOutputPort_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5016 PyObject *__pyx_r = 0;
5017 __Pyx_RefNannyDeclarations
5018 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5019 __pyx_r = __pyx_pf_7pymusic_14ContOutputPort_2__reduce_cython__(((struct __pyx_obj_7pymusic_ContOutputPort *)__pyx_v_self));
5020
5021 /* function exit code */
5022 __Pyx_RefNannyFinishContext();
5023 return __pyx_r;
5024 }
5025
5026 static PyObject *__pyx_pf_7pymusic_14ContOutputPort_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_ContOutputPort *__pyx_v_self) {
5027 PyObject *__pyx_r = NULL;
5028 __Pyx_RefNannyDeclarations
5029 PyObject *__pyx_t_1 = NULL;
5030 int __pyx_lineno = 0;
5031 const char *__pyx_filename = NULL;
5032 int __pyx_clineno = 0;
5033 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5034
5035 /* "(tree fragment)":2
5036 * def __reduce_cython__(self):
5037 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5038 * def __setstate_cython__(self, __pyx_state):
5039 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5040 */
5041 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5042 __Pyx_GOTREF(__pyx_t_1);
5043 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5044 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5045 __PYX_ERR(1, 2, __pyx_L1_error)
5046
5047 /* "(tree fragment)":1
5048 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5049 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5050 * def __setstate_cython__(self, __pyx_state):
5051 */
5052
5053 /* function exit code */
5054 __pyx_L1_error:;
5055 __Pyx_XDECREF(__pyx_t_1);
5056 __Pyx_AddTraceback("pymusic.ContOutputPort.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5057 __pyx_r = NULL;
5058 __Pyx_XGIVEREF(__pyx_r);
5059 __Pyx_RefNannyFinishContext();
5060 return __pyx_r;
5061 }
5062
5063 /* "(tree fragment)":3
5064 * def __reduce_cython__(self):
5065 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5066 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5067 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5068 */
5069
5070 /* Python wrapper */
5071 static PyObject *__pyx_pw_7pymusic_14ContOutputPort_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5072 static PyObject *__pyx_pw_7pymusic_14ContOutputPort_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5073 PyObject *__pyx_r = 0;
5074 __Pyx_RefNannyDeclarations
5075 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5076 __pyx_r = __pyx_pf_7pymusic_14ContOutputPort_4__setstate_cython__(((struct __pyx_obj_7pymusic_ContOutputPort *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5077
5078 /* function exit code */
5079 __Pyx_RefNannyFinishContext();
5080 return __pyx_r;
5081 }
5082
5083 static PyObject *__pyx_pf_7pymusic_14ContOutputPort_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_ContOutputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5084 PyObject *__pyx_r = NULL;
5085 __Pyx_RefNannyDeclarations
5086 PyObject *__pyx_t_1 = NULL;
5087 int __pyx_lineno = 0;
5088 const char *__pyx_filename = NULL;
5089 int __pyx_clineno = 0;
5090 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5091
5092 /* "(tree fragment)":4
5093 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5094 * def __setstate_cython__(self, __pyx_state):
5095 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5096 */
5097 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5098 __Pyx_GOTREF(__pyx_t_1);
5099 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5100 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5101 __PYX_ERR(1, 4, __pyx_L1_error)
5102
5103 /* "(tree fragment)":3
5104 * def __reduce_cython__(self):
5105 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5106 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5107 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5108 */
5109
5110 /* function exit code */
5111 __pyx_L1_error:;
5112 __Pyx_XDECREF(__pyx_t_1);
5113 __Pyx_AddTraceback("pymusic.ContOutputPort.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5114 __pyx_r = NULL;
5115 __Pyx_XGIVEREF(__pyx_r);
5116 __Pyx_RefNannyFinishContext();
5117 return __pyx_r;
5118 }
5119
5120 /* "pymusic.pyx":217
5121 * here and drop the reference when this object is null'd (events member).
5122 * """
5123 * def __cinit__(self): # <<<<<<<<<<<<<<
5124 * """
5125 * Store a set of references to the event handlers
5126 */
5127
5128 /* Python wrapper */
5129 static int __pyx_pw_7pymusic_14EventInputPort_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5130 static int __pyx_pw_7pymusic_14EventInputPort_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5131 int __pyx_r;
5132 __Pyx_RefNannyDeclarations
5133 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
5134 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
5135 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
5136 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
5137 __pyx_r = __pyx_pf_7pymusic_14EventInputPort___cinit__(((struct __pyx_obj_7pymusic_EventInputPort *)__pyx_v_self));
5138
5139 /* function exit code */
5140 __Pyx_RefNannyFinishContext();
5141 return __pyx_r;
5142 }
5143
5144 static int __pyx_pf_7pymusic_14EventInputPort___cinit__(struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self) {
5145 int __pyx_r;
5146 __Pyx_RefNannyDeclarations
5147 PyObject *__pyx_t_1 = NULL;
5148 int __pyx_lineno = 0;
5149 const char *__pyx_filename = NULL;
5150 int __pyx_clineno = 0;
5151 __Pyx_RefNannySetupContext("__cinit__", 0);
5152
5153 /* "pymusic.pyx":221
5154 * Store a set of references to the event handlers
5155 * """
5156 * self.events = set() # <<<<<<<<<<<<<<
5157 *
5158 * cpdef null(self):
5159 */
5160 __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
5161 __Pyx_GOTREF(__pyx_t_1);
5162 __Pyx_GIVEREF(__pyx_t_1);
5163 __Pyx_GOTREF(__pyx_v_self->events);
5164 __Pyx_DECREF(__pyx_v_self->events);
5165 __pyx_v_self->events = ((PyObject*)__pyx_t_1);
5166 __pyx_t_1 = 0;
5167
5168 /* "pymusic.pyx":217
5169 * here and drop the reference when this object is null'd (events member).
5170 * """
5171 * def __cinit__(self): # <<<<<<<<<<<<<<
5172 * """
5173 * Store a set of references to the event handlers
5174 */
5175
5176 /* function exit code */
5177 __pyx_r = 0;
5178 goto __pyx_L0;
5179 __pyx_L1_error:;
5180 __Pyx_XDECREF(__pyx_t_1);
5181 __Pyx_AddTraceback("pymusic.EventInputPort.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5182 __pyx_r = -1;
5183 __pyx_L0:;
5184 __Pyx_RefNannyFinishContext();
5185 return __pyx_r;
5186 }
5187
5188 /* "pymusic.pyx":223
5189 * self.events = set()
5190 *
5191 * cpdef null(self): # <<<<<<<<<<<<<<
5192 * """
5193 * Not just null pointer, but give up the associated event
5194 */
5195
5196 static PyObject *__pyx_pw_7pymusic_14EventInputPort_3null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5197 static PyObject *__pyx_f_7pymusic_14EventInputPort_null(struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self, int __pyx_skip_dispatch) {
5198 PyObject *__pyx_r = NULL;
5199 __Pyx_RefNannyDeclarations
5200 PyObject *__pyx_t_1 = NULL;
5201 PyObject *__pyx_t_2 = NULL;
5202 PyObject *__pyx_t_3 = NULL;
5203 PyObject *__pyx_t_4 = NULL;
5204 int __pyx_lineno = 0;
5205 const char *__pyx_filename = NULL;
5206 int __pyx_clineno = 0;
5207 __Pyx_RefNannySetupContext("null", 0);
5208 /* Check if called by wrapper */
5209 if (unlikely(__pyx_skip_dispatch)) ;
5210 /* Check if overridden in Python */
5211 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5212 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5213 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5214 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5215 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5216 #endif
5217 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
5218 __Pyx_GOTREF(__pyx_t_1);
5219 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pymusic_14EventInputPort_3null)) {
5220 __Pyx_XDECREF(__pyx_r);
5221 __Pyx_INCREF(__pyx_t_1);
5222 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
5223 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5224 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
5225 if (likely(__pyx_t_4)) {
5226 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5227 __Pyx_INCREF(__pyx_t_4);
5228 __Pyx_INCREF(function);
5229 __Pyx_DECREF_SET(__pyx_t_3, function);
5230 }
5231 }
5232 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
5233 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5234 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
5235 __Pyx_GOTREF(__pyx_t_2);
5236 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5237 __pyx_r = __pyx_t_2;
5238 __pyx_t_2 = 0;
5239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5240 goto __pyx_L0;
5241 }
5242 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5243 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5244 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5245 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
5246 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5247 }
5248 #endif
5249 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5250 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5251 }
5252 #endif
5253 }
5254
5255 /* "pymusic.pyx":228
5256 * handlers.
5257 * """
5258 * Port.null(self) # <<<<<<<<<<<<<<
5259 * self.events = None
5260 *
5261 */
5262 __pyx_t_1 = __pyx_f_7pymusic_4Port_null(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
5263 __Pyx_GOTREF(__pyx_t_1);
5264 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5265
5266 /* "pymusic.pyx":229
5267 * """
5268 * Port.null(self)
5269 * self.events = None # <<<<<<<<<<<<<<
5270 *
5271 * def map(self, func, IndexType t,
5272 */
5273 __Pyx_INCREF(Py_None);
5274 __Pyx_GIVEREF(Py_None);
5275 __Pyx_GOTREF(__pyx_v_self->events);
5276 __Pyx_DECREF(__pyx_v_self->events);
5277 __pyx_v_self->events = ((PyObject*)Py_None);
5278
5279 /* "pymusic.pyx":223
5280 * self.events = set()
5281 *
5282 * cpdef null(self): # <<<<<<<<<<<<<<
5283 * """
5284 * Not just null pointer, but give up the associated event
5285 */
5286
5287 /* function exit code */
5288 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5289 goto __pyx_L0;
5290 __pyx_L1_error:;
5291 __Pyx_XDECREF(__pyx_t_1);
5292 __Pyx_XDECREF(__pyx_t_2);
5293 __Pyx_XDECREF(__pyx_t_3);
5294 __Pyx_XDECREF(__pyx_t_4);
5295 __Pyx_AddTraceback("pymusic.EventInputPort.null", __pyx_clineno, __pyx_lineno, __pyx_filename);
5296 __pyx_r = 0;
5297 __pyx_L0:;
5298 __Pyx_XGIVEREF(__pyx_r);
5299 __Pyx_RefNannyFinishContext();
5300 return __pyx_r;
5301 }
5302
5303 /* Python wrapper */
5304 static PyObject *__pyx_pw_7pymusic_14EventInputPort_3null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5305 static char __pyx_doc_7pymusic_14EventInputPort_2null[] = "\n Not just null pointer, but give up the associated event\n handlers.\n ";
5306 static PyObject *__pyx_pw_7pymusic_14EventInputPort_3null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5307 PyObject *__pyx_r = 0;
5308 __Pyx_RefNannyDeclarations
5309 __Pyx_RefNannySetupContext("null (wrapper)", 0);
5310 __pyx_r = __pyx_pf_7pymusic_14EventInputPort_2null(((struct __pyx_obj_7pymusic_EventInputPort *)__pyx_v_self));
5311
5312 /* function exit code */
5313 __Pyx_RefNannyFinishContext();
5314 return __pyx_r;
5315 }
5316
5317 static PyObject *__pyx_pf_7pymusic_14EventInputPort_2null(struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self) {
5318 PyObject *__pyx_r = NULL;
5319 __Pyx_RefNannyDeclarations
5320 PyObject *__pyx_t_1 = NULL;
5321 int __pyx_lineno = 0;
5322 const char *__pyx_filename = NULL;
5323 int __pyx_clineno = 0;
5324 __Pyx_RefNannySetupContext("null", 0);
5325 __Pyx_XDECREF(__pyx_r);
5326 __pyx_t_1 = __pyx_f_7pymusic_14EventInputPort_null(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
5327 __Pyx_GOTREF(__pyx_t_1);
5328 __pyx_r = __pyx_t_1;
5329 __pyx_t_1 = 0;
5330 goto __pyx_L0;
5331
5332 /* function exit code */
5333 __pyx_L1_error:;
5334 __Pyx_XDECREF(__pyx_t_1);
5335 __Pyx_AddTraceback("pymusic.EventInputPort.null", __pyx_clineno, __pyx_lineno, __pyx_filename);
5336 __pyx_r = NULL;
5337 __pyx_L0:;
5338 __Pyx_XGIVEREF(__pyx_r);
5339 __Pyx_RefNannyFinishContext();
5340 return __pyx_r;
5341 }
5342
5343 /* "pymusic.pyx":231
5344 * self.events = None
5345 *
5346 * def map(self, func, IndexType t, # <<<<<<<<<<<<<<
5347 * double accLatency=0, int maxBuffered=-1,
5348 * object perm=None, int base=-1, int size=-1):
5349 */
5350
5351 /* Python wrapper */
5352 static PyObject *__pyx_pw_7pymusic_14EventInputPort_5map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5353 static char __pyx_doc_7pymusic_14EventInputPort_4map[] = "\n Map events to this sink.\n func is:\n void func(double value, IndexType GLOBAL|LOCAL, int index)\n IndexType is (?) the index type to map the incoming sources\n passed to the func (why, if we already know this?)\n accLatency is the delivery delay relative to calculation time\n (? is it ? What formula are we using here?)\n maxBuffered is ticks to buffer\n perm, base & size are passed to IndexMap\n ";
5354 static PyObject *__pyx_pw_7pymusic_14EventInputPort_5map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5355 PyObject *__pyx_v_func = 0;
5356 MUSIC::Index::Type __pyx_v_t;
5357 double __pyx_v_accLatency;
5358 int __pyx_v_maxBuffered;
5359 PyObject *__pyx_v_perm = 0;
5360 int __pyx_v_base;
5361 int __pyx_v_size;
5362 int __pyx_lineno = 0;
5363 const char *__pyx_filename = NULL;
5364 int __pyx_clineno = 0;
5365 PyObject *__pyx_r = 0;
5366 __Pyx_RefNannyDeclarations
5367 __Pyx_RefNannySetupContext("map (wrapper)", 0);
5368 {
5369 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_t,&__pyx_n_s_accLatency,&__pyx_n_s_maxBuffered,&__pyx_n_s_perm,&__pyx_n_s_base,&__pyx_n_s_size,0};
5370 PyObject* values[7] = {0,0,0,0,0,0,0};
5371
5372 /* "pymusic.pyx":233
5373 * def map(self, func, IndexType t,
5374 * double accLatency=0, int maxBuffered=-1,
5375 * object perm=None, int base=-1, int size=-1): # <<<<<<<<<<<<<<
5376 * """
5377 * Map events to this sink.
5378 */
5379 values[4] = ((PyObject *)Py_None);
5380 if (unlikely(__pyx_kwds)) {
5381 Py_ssize_t kw_args;
5382 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5383 switch (pos_args) {
5384 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5385 CYTHON_FALLTHROUGH;
5386 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5387 CYTHON_FALLTHROUGH;
5388 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5389 CYTHON_FALLTHROUGH;
5390 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5391 CYTHON_FALLTHROUGH;
5392 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5393 CYTHON_FALLTHROUGH;
5394 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5395 CYTHON_FALLTHROUGH;
5396 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5397 CYTHON_FALLTHROUGH;
5398 case 0: break;
5399 default: goto __pyx_L5_argtuple_error;
5400 }
5401 kw_args = PyDict_Size(__pyx_kwds);
5402 switch (pos_args) {
5403 case 0:
5404 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
5405 else goto __pyx_L5_argtuple_error;
5406 CYTHON_FALLTHROUGH;
5407 case 1:
5408 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5409 else {
5410 __Pyx_RaiseArgtupleInvalid("map", 0, 2, 7, 1); __PYX_ERR(0, 231, __pyx_L3_error)
5411 }
5412 CYTHON_FALLTHROUGH;
5413 case 2:
5414 if (kw_args > 0) {
5415 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_accLatency);
5416 if (value) { values[2] = value; kw_args--; }
5417 }
5418 CYTHON_FALLTHROUGH;
5419 case 3:
5420 if (kw_args > 0) {
5421 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxBuffered);
5422 if (value) { values[3] = value; kw_args--; }
5423 }
5424 CYTHON_FALLTHROUGH;
5425 case 4:
5426 if (kw_args > 0) {
5427 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_perm);
5428 if (value) { values[4] = value; kw_args--; }
5429 }
5430 CYTHON_FALLTHROUGH;
5431 case 5:
5432 if (kw_args > 0) {
5433 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
5434 if (value) { values[5] = value; kw_args--; }
5435 }
5436 CYTHON_FALLTHROUGH;
5437 case 6:
5438 if (kw_args > 0) {
5439 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
5440 if (value) { values[6] = value; kw_args--; }
5441 }
5442 }
5443 if (unlikely(kw_args > 0)) {
5444 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 231, __pyx_L3_error)
5445 }
5446 } else {
5447 switch (PyTuple_GET_SIZE(__pyx_args)) {
5448 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5449 CYTHON_FALLTHROUGH;
5450 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5451 CYTHON_FALLTHROUGH;
5452 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5453 CYTHON_FALLTHROUGH;
5454 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5455 CYTHON_FALLTHROUGH;
5456 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5457 CYTHON_FALLTHROUGH;
5458 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5459 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5460 break;
5461 default: goto __pyx_L5_argtuple_error;
5462 }
5463 }
5464 __pyx_v_func = values[0];
5465 __pyx_v_t = ((MUSIC::Index::Type)__Pyx_PyInt_As_MUSIC_3a__3a_Index_3a__3a_Type(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L3_error)
5466 if (values[2]) {
5467 __pyx_v_accLatency = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_accLatency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L3_error)
5468 } else {
5469 __pyx_v_accLatency = ((double)0.0);
5470 }
5471 if (values[3]) {
5472 __pyx_v_maxBuffered = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_maxBuffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L3_error)
5473 } else {
5474 __pyx_v_maxBuffered = ((int)-1);
5475 }
5476 __pyx_v_perm = values[4];
5477 if (values[5]) {
5478 __pyx_v_base = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L3_error)
5479 } else {
5480 __pyx_v_base = ((int)-1);
5481 }
5482 if (values[6]) {
5483 __pyx_v_size = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L3_error)
5484 } else {
5485 __pyx_v_size = ((int)-1);
5486 }
5487 }
5488 goto __pyx_L4_argument_unpacking_done;
5489 __pyx_L5_argtuple_error:;
5490 __Pyx_RaiseArgtupleInvalid("map", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 231, __pyx_L3_error)
5491 __pyx_L3_error:;
5492 __Pyx_AddTraceback("pymusic.EventInputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
5493 __Pyx_RefNannyFinishContext();
5494 return NULL;
5495 __pyx_L4_argument_unpacking_done:;
5496 __pyx_r = __pyx_pf_7pymusic_14EventInputPort_4map(((struct __pyx_obj_7pymusic_EventInputPort *)__pyx_v_self), __pyx_v_func, __pyx_v_t, __pyx_v_accLatency, __pyx_v_maxBuffered, __pyx_v_perm, __pyx_v_base, __pyx_v_size);
5497
5498 /* "pymusic.pyx":231
5499 * self.events = None
5500 *
5501 * def map(self, func, IndexType t, # <<<<<<<<<<<<<<
5502 * double accLatency=0, int maxBuffered=-1,
5503 * object perm=None, int base=-1, int size=-1):
5504 */
5505
5506 /* function exit code */
5507 __Pyx_RefNannyFinishContext();
5508 return __pyx_r;
5509 }
5510
5511 static PyObject *__pyx_pf_7pymusic_14EventInputPort_4map(struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self, PyObject *__pyx_v_func, MUSIC::Index::Type __pyx_v_t, double __pyx_v_accLatency, int __pyx_v_maxBuffered, PyObject *__pyx_v_perm, int __pyx_v_base, int __pyx_v_size) {
5512 struct __pyx_obj_7pymusic_IndexMap *__pyx_v_imap = 0;
5513 struct __pyx_obj_7pymusic_EventHandler *__pyx_v_eh = 0;
5514 MUSIC::EventInputPort *__pyx_v_ptr;
5515 MUSIC::EventHandlerPtr __pyx_v_hndl;
5516 PyObject *__pyx_r = NULL;
5517 __Pyx_RefNannyDeclarations
5518 PyObject *__pyx_t_1 = NULL;
5519 PyObject *__pyx_t_2 = NULL;
5520 PyObject *__pyx_t_3 = NULL;
5521 int __pyx_t_4;
5522 int __pyx_lineno = 0;
5523 const char *__pyx_filename = NULL;
5524 int __pyx_clineno = 0;
5525 __Pyx_RefNannySetupContext("map", 0);
5526
5527 /* "pymusic.pyx":245
5528 * perm, base & size are passed to IndexMap
5529 * """
5530 * cdef IndexMap imap = IndexMap(perm, base, size) # <<<<<<<<<<<<<<
5531 * cdef EventHandler eh = EventHandler(func, t)
5532 * cdef CEventInputPort* ptr = dc_CEventInputPort(self.ptr)
5533 */
5534 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
5535 __Pyx_GOTREF(__pyx_t_1);
5536 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
5537 __Pyx_GOTREF(__pyx_t_2);
5538 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
5539 __Pyx_GOTREF(__pyx_t_3);
5540 __Pyx_INCREF(__pyx_v_perm);
5541 __Pyx_GIVEREF(__pyx_v_perm);
5542 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_perm);
5543 __Pyx_GIVEREF(__pyx_t_1);
5544 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
5545 __Pyx_GIVEREF(__pyx_t_2);
5546 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
5547 __pyx_t_1 = 0;
5548 __pyx_t_2 = 0;
5549 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_IndexMap), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
5550 __Pyx_GOTREF(__pyx_t_2);
5551 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5552 __pyx_v_imap = ((struct __pyx_obj_7pymusic_IndexMap *)__pyx_t_2);
5553 __pyx_t_2 = 0;
5554
5555 /* "pymusic.pyx":246
5556 * """
5557 * cdef IndexMap imap = IndexMap(perm, base, size)
5558 * cdef EventHandler eh = EventHandler(func, t) # <<<<<<<<<<<<<<
5559 * cdef CEventInputPort* ptr = dc_CEventInputPort(self.ptr)
5560 * cdef CEventHandlerPtr hndl = getEventHandlerPtr(t, eh.ptr)
5561 */
5562 __pyx_t_2 = __Pyx_PyInt_From_MUSIC_3a__3a_Index_3a__3a_Type(__pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
5563 __Pyx_GOTREF(__pyx_t_2);
5564 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
5565 __Pyx_GOTREF(__pyx_t_3);
5566 __Pyx_INCREF(__pyx_v_func);
5567 __Pyx_GIVEREF(__pyx_v_func);
5568 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_func);
5569 __Pyx_GIVEREF(__pyx_t_2);
5570 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
5571 __pyx_t_2 = 0;
5572 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_EventHandler), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
5573 __Pyx_GOTREF(__pyx_t_2);
5574 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5575 __pyx_v_eh = ((struct __pyx_obj_7pymusic_EventHandler *)__pyx_t_2);
5576 __pyx_t_2 = 0;
5577
5578 /* "pymusic.pyx":247
5579 * cdef IndexMap imap = IndexMap(perm, base, size)
5580 * cdef EventHandler eh = EventHandler(func, t)
5581 * cdef CEventInputPort* ptr = dc_CEventInputPort(self.ptr) # <<<<<<<<<<<<<<
5582 * cdef CEventHandlerPtr hndl = getEventHandlerPtr(t, eh.ptr)
5583 * mapImpl(ptr, imap.ptr, t, hndl, accLatency, maxBuffered)
5584 */
5585 __pyx_v_ptr = dynamic_cast<MUSIC::EventInputPort*>(__pyx_v_self->__pyx_base.ptr);
5586
5587 /* "pymusic.pyx":248
5588 * cdef EventHandler eh = EventHandler(func, t)
5589 * cdef CEventInputPort* ptr = dc_CEventInputPort(self.ptr)
5590 * cdef CEventHandlerPtr hndl = getEventHandlerPtr(t, eh.ptr) # <<<<<<<<<<<<<<
5591 * mapImpl(ptr, imap.ptr, t, hndl, accLatency, maxBuffered)
5592 * self.events.add(eh)
5593 */
5594 __pyx_v_hndl = MUSIC::getEventHandlerPtr(__pyx_v_t, __pyx_v_eh->ptr);
5595
5596 /* "pymusic.pyx":249
5597 * cdef CEventInputPort* ptr = dc_CEventInputPort(self.ptr)
5598 * cdef CEventHandlerPtr hndl = getEventHandlerPtr(t, eh.ptr)
5599 * mapImpl(ptr, imap.ptr, t, hndl, accLatency, maxBuffered) # <<<<<<<<<<<<<<
5600 * self.events.add(eh)
5601 *
5602 */
5603 MUSIC::Implementer::mapImpl(__pyx_v_ptr, __pyx_v_imap->ptr, __pyx_v_t, __pyx_v_hndl, __pyx_v_accLatency, __pyx_v_maxBuffered);
5604
5605 /* "pymusic.pyx":250
5606 * cdef CEventHandlerPtr hndl = getEventHandlerPtr(t, eh.ptr)
5607 * mapImpl(ptr, imap.ptr, t, hndl, accLatency, maxBuffered)
5608 * self.events.add(eh) # <<<<<<<<<<<<<<
5609 *
5610 * cdef class EventOutputPort(Port):
5611 */
5612 if (unlikely(__pyx_v_self->events == Py_None)) {
5613 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
5614 __PYX_ERR(0, 250, __pyx_L1_error)
5615 }
5616 __pyx_t_4 = PySet_Add(__pyx_v_self->events, ((PyObject *)__pyx_v_eh)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 250, __pyx_L1_error)
5617
5618 /* "pymusic.pyx":231
5619 * self.events = None
5620 *
5621 * def map(self, func, IndexType t, # <<<<<<<<<<<<<<
5622 * double accLatency=0, int maxBuffered=-1,
5623 * object perm=None, int base=-1, int size=-1):
5624 */
5625
5626 /* function exit code */
5627 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5628 goto __pyx_L0;
5629 __pyx_L1_error:;
5630 __Pyx_XDECREF(__pyx_t_1);
5631 __Pyx_XDECREF(__pyx_t_2);
5632 __Pyx_XDECREF(__pyx_t_3);
5633 __Pyx_AddTraceback("pymusic.EventInputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
5634 __pyx_r = NULL;
5635 __pyx_L0:;
5636 __Pyx_XDECREF((PyObject *)__pyx_v_imap);
5637 __Pyx_XDECREF((PyObject *)__pyx_v_eh);
5638 __Pyx_XGIVEREF(__pyx_r);
5639 __Pyx_RefNannyFinishContext();
5640 return __pyx_r;
5641 }
5642
5643 /* "(tree fragment)":1
5644 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5645 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5646 * def __setstate_cython__(self, __pyx_state):
5647 */
5648
5649 /* Python wrapper */
5650 static PyObject *__pyx_pw_7pymusic_14EventInputPort_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5651 static PyObject *__pyx_pw_7pymusic_14EventInputPort_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5652 PyObject *__pyx_r = 0;
5653 __Pyx_RefNannyDeclarations
5654 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5655 __pyx_r = __pyx_pf_7pymusic_14EventInputPort_6__reduce_cython__(((struct __pyx_obj_7pymusic_EventInputPort *)__pyx_v_self));
5656
5657 /* function exit code */
5658 __Pyx_RefNannyFinishContext();
5659 return __pyx_r;
5660 }
5661
5662 static PyObject *__pyx_pf_7pymusic_14EventInputPort_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self) {
5663 PyObject *__pyx_r = NULL;
5664 __Pyx_RefNannyDeclarations
5665 PyObject *__pyx_t_1 = NULL;
5666 int __pyx_lineno = 0;
5667 const char *__pyx_filename = NULL;
5668 int __pyx_clineno = 0;
5669 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5670
5671 /* "(tree fragment)":2
5672 * def __reduce_cython__(self):
5673 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5674 * def __setstate_cython__(self, __pyx_state):
5675 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5676 */
5677 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5678 __Pyx_GOTREF(__pyx_t_1);
5679 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5680 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5681 __PYX_ERR(1, 2, __pyx_L1_error)
5682
5683 /* "(tree fragment)":1
5684 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5685 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5686 * def __setstate_cython__(self, __pyx_state):
5687 */
5688
5689 /* function exit code */
5690 __pyx_L1_error:;
5691 __Pyx_XDECREF(__pyx_t_1);
5692 __Pyx_AddTraceback("pymusic.EventInputPort.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5693 __pyx_r = NULL;
5694 __Pyx_XGIVEREF(__pyx_r);
5695 __Pyx_RefNannyFinishContext();
5696 return __pyx_r;
5697 }
5698
5699 /* "(tree fragment)":3
5700 * def __reduce_cython__(self):
5701 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5702 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5703 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5704 */
5705
5706 /* Python wrapper */
5707 static PyObject *__pyx_pw_7pymusic_14EventInputPort_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5708 static PyObject *__pyx_pw_7pymusic_14EventInputPort_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5709 PyObject *__pyx_r = 0;
5710 __Pyx_RefNannyDeclarations
5711 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5712 __pyx_r = __pyx_pf_7pymusic_14EventInputPort_8__setstate_cython__(((struct __pyx_obj_7pymusic_EventInputPort *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5713
5714 /* function exit code */
5715 __Pyx_RefNannyFinishContext();
5716 return __pyx_r;
5717 }
5718
5719 static PyObject *__pyx_pf_7pymusic_14EventInputPort_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5720 PyObject *__pyx_r = NULL;
5721 __Pyx_RefNannyDeclarations
5722 PyObject *__pyx_t_1 = NULL;
5723 int __pyx_lineno = 0;
5724 const char *__pyx_filename = NULL;
5725 int __pyx_clineno = 0;
5726 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5727
5728 /* "(tree fragment)":4
5729 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5730 * def __setstate_cython__(self, __pyx_state):
5731 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5732 */
5733 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5734 __Pyx_GOTREF(__pyx_t_1);
5735 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5737 __PYX_ERR(1, 4, __pyx_L1_error)
5738
5739 /* "(tree fragment)":3
5740 * def __reduce_cython__(self):
5741 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5742 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5743 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5744 */
5745
5746 /* function exit code */
5747 __pyx_L1_error:;
5748 __Pyx_XDECREF(__pyx_t_1);
5749 __Pyx_AddTraceback("pymusic.EventInputPort.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5750 __pyx_r = NULL;
5751 __Pyx_XGIVEREF(__pyx_r);
5752 __Pyx_RefNannyFinishContext();
5753 return __pyx_r;
5754 }
5755
5756 /* "pymusic.pyx":257
5757 * events.
5758 * """
5759 * def map(self, IndexType t, int maxBuffered=-1, # <<<<<<<<<<<<<<
5760 * object perm=None, int base=-1, int size=-1):
5761 * """
5762 */
5763
5764 /* Python wrapper */
5765 static PyObject *__pyx_pw_7pymusic_15EventOutputPort_1map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5766 static char __pyx_doc_7pymusic_15EventOutputPort_map[] = "\n IndexType: LOCAL/GLOBAL\n maxBuffered: tick to buffer (why on both sides?)\n perm, base, size: define IndexMap (see that class)\n ";
5767 static PyObject *__pyx_pw_7pymusic_15EventOutputPort_1map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5768 MUSIC::Index::Type __pyx_v_t;
5769 int __pyx_v_maxBuffered;
5770 PyObject *__pyx_v_perm = 0;
5771 int __pyx_v_base;
5772 int __pyx_v_size;
5773 int __pyx_lineno = 0;
5774 const char *__pyx_filename = NULL;
5775 int __pyx_clineno = 0;
5776 PyObject *__pyx_r = 0;
5777 __Pyx_RefNannyDeclarations
5778 __Pyx_RefNannySetupContext("map (wrapper)", 0);
5779 {
5780 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_maxBuffered,&__pyx_n_s_perm,&__pyx_n_s_base,&__pyx_n_s_size,0};
5781 PyObject* values[5] = {0,0,0,0,0};
5782
5783 /* "pymusic.pyx":258
5784 * """
5785 * def map(self, IndexType t, int maxBuffered=-1,
5786 * object perm=None, int base=-1, int size=-1): # <<<<<<<<<<<<<<
5787 * """
5788 * IndexType: LOCAL/GLOBAL
5789 */
5790 values[2] = ((PyObject *)Py_None);
5791 if (unlikely(__pyx_kwds)) {
5792 Py_ssize_t kw_args;
5793 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5794 switch (pos_args) {
5795 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5796 CYTHON_FALLTHROUGH;
5797 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5798 CYTHON_FALLTHROUGH;
5799 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5800 CYTHON_FALLTHROUGH;
5801 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5802 CYTHON_FALLTHROUGH;
5803 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5804 CYTHON_FALLTHROUGH;
5805 case 0: break;
5806 default: goto __pyx_L5_argtuple_error;
5807 }
5808 kw_args = PyDict_Size(__pyx_kwds);
5809 switch (pos_args) {
5810 case 0:
5811 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5812 else goto __pyx_L5_argtuple_error;
5813 CYTHON_FALLTHROUGH;
5814 case 1:
5815 if (kw_args > 0) {
5816 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxBuffered);
5817 if (value) { values[1] = value; kw_args--; }
5818 }
5819 CYTHON_FALLTHROUGH;
5820 case 2:
5821 if (kw_args > 0) {
5822 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_perm);
5823 if (value) { values[2] = value; kw_args--; }
5824 }
5825 CYTHON_FALLTHROUGH;
5826 case 3:
5827 if (kw_args > 0) {
5828 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
5829 if (value) { values[3] = value; kw_args--; }
5830 }
5831 CYTHON_FALLTHROUGH;
5832 case 4:
5833 if (kw_args > 0) {
5834 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
5835 if (value) { values[4] = value; kw_args--; }
5836 }
5837 }
5838 if (unlikely(kw_args > 0)) {
5839 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 257, __pyx_L3_error)
5840 }
5841 } else {
5842 switch (PyTuple_GET_SIZE(__pyx_args)) {
5843 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5844 CYTHON_FALLTHROUGH;
5845 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5846 CYTHON_FALLTHROUGH;
5847 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5848 CYTHON_FALLTHROUGH;
5849 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5850 CYTHON_FALLTHROUGH;
5851 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5852 break;
5853 default: goto __pyx_L5_argtuple_error;
5854 }
5855 }
5856 __pyx_v_t = ((MUSIC::Index::Type)__Pyx_PyInt_As_MUSIC_3a__3a_Index_3a__3a_Type(values[0])); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L3_error)
5857 if (values[1]) {
5858 __pyx_v_maxBuffered = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_maxBuffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L3_error)
5859 } else {
5860 __pyx_v_maxBuffered = ((int)-1);
5861 }
5862 __pyx_v_perm = values[2];
5863 if (values[3]) {
5864 __pyx_v_base = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L3_error)
5865 } else {
5866 __pyx_v_base = ((int)-1);
5867 }
5868 if (values[4]) {
5869 __pyx_v_size = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L3_error)
5870 } else {
5871 __pyx_v_size = ((int)-1);
5872 }
5873 }
5874 goto __pyx_L4_argument_unpacking_done;
5875 __pyx_L5_argtuple_error:;
5876 __Pyx_RaiseArgtupleInvalid("map", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 257, __pyx_L3_error)
5877 __pyx_L3_error:;
5878 __Pyx_AddTraceback("pymusic.EventOutputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
5879 __Pyx_RefNannyFinishContext();
5880 return NULL;
5881 __pyx_L4_argument_unpacking_done:;
5882 __pyx_r = __pyx_pf_7pymusic_15EventOutputPort_map(((struct __pyx_obj_7pymusic_EventOutputPort *)__pyx_v_self), __pyx_v_t, __pyx_v_maxBuffered, __pyx_v_perm, __pyx_v_base, __pyx_v_size);
5883
5884 /* "pymusic.pyx":257
5885 * events.
5886 * """
5887 * def map(self, IndexType t, int maxBuffered=-1, # <<<<<<<<<<<<<<
5888 * object perm=None, int base=-1, int size=-1):
5889 * """
5890 */
5891
5892 /* function exit code */
5893 __Pyx_RefNannyFinishContext();
5894 return __pyx_r;
5895 }
5896
5897 static PyObject *__pyx_pf_7pymusic_15EventOutputPort_map(struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_self, MUSIC::Index::Type __pyx_v_t, int __pyx_v_maxBuffered, PyObject *__pyx_v_perm, int __pyx_v_base, int __pyx_v_size) {
5898 struct __pyx_obj_7pymusic_IndexMap *__pyx_v_m = 0;
5899 MUSIC::EventOutputPort *__pyx_v_ptr;
5900 PyObject *__pyx_r = NULL;
5901 __Pyx_RefNannyDeclarations
5902 PyObject *__pyx_t_1 = NULL;
5903 PyObject *__pyx_t_2 = NULL;
5904 PyObject *__pyx_t_3 = NULL;
5905 int __pyx_lineno = 0;
5906 const char *__pyx_filename = NULL;
5907 int __pyx_clineno = 0;
5908 __Pyx_RefNannySetupContext("map", 0);
5909
5910 /* "pymusic.pyx":264
5911 * perm, base, size: define IndexMap (see that class)
5912 * """
5913 * cdef IndexMap m = IndexMap(perm, base, size) # <<<<<<<<<<<<<<
5914 * cdef CEventOutputPort* ptr = dc_CEventOutputPort(self.ptr)
5915 * mapImpl(ptr, m.ptr, t, maxBuffered)
5916 */
5917 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
5918 __Pyx_GOTREF(__pyx_t_1);
5919 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_2);
5921 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
5922 __Pyx_GOTREF(__pyx_t_3);
5923 __Pyx_INCREF(__pyx_v_perm);
5924 __Pyx_GIVEREF(__pyx_v_perm);
5925 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_perm);
5926 __Pyx_GIVEREF(__pyx_t_1);
5927 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
5928 __Pyx_GIVEREF(__pyx_t_2);
5929 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
5930 __pyx_t_1 = 0;
5931 __pyx_t_2 = 0;
5932 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_IndexMap), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
5933 __Pyx_GOTREF(__pyx_t_2);
5934 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5935 __pyx_v_m = ((struct __pyx_obj_7pymusic_IndexMap *)__pyx_t_2);
5936 __pyx_t_2 = 0;
5937
5938 /* "pymusic.pyx":265
5939 * """
5940 * cdef IndexMap m = IndexMap(perm, base, size)
5941 * cdef CEventOutputPort* ptr = dc_CEventOutputPort(self.ptr) # <<<<<<<<<<<<<<
5942 * mapImpl(ptr, m.ptr, t, maxBuffered)
5943 *
5944 */
5945 __pyx_v_ptr = dynamic_cast<MUSIC::EventOutputPort*>(__pyx_v_self->__pyx_base.ptr);
5946
5947 /* "pymusic.pyx":266
5948 * cdef IndexMap m = IndexMap(perm, base, size)
5949 * cdef CEventOutputPort* ptr = dc_CEventOutputPort(self.ptr)
5950 * mapImpl(ptr, m.ptr, t, maxBuffered) # <<<<<<<<<<<<<<
5951 *
5952 * def insertEvent(self, double time, int index, IndexType t):
5953 */
5954 MUSIC::Implementer::mapImpl(__pyx_v_ptr, __pyx_v_m->ptr, __pyx_v_t, __pyx_v_maxBuffered);
5955
5956 /* "pymusic.pyx":257
5957 * events.
5958 * """
5959 * def map(self, IndexType t, int maxBuffered=-1, # <<<<<<<<<<<<<<
5960 * object perm=None, int base=-1, int size=-1):
5961 * """
5962 */
5963
5964 /* function exit code */
5965 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5966 goto __pyx_L0;
5967 __pyx_L1_error:;
5968 __Pyx_XDECREF(__pyx_t_1);
5969 __Pyx_XDECREF(__pyx_t_2);
5970 __Pyx_XDECREF(__pyx_t_3);
5971 __Pyx_AddTraceback("pymusic.EventOutputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
5972 __pyx_r = NULL;
5973 __pyx_L0:;
5974 __Pyx_XDECREF((PyObject *)__pyx_v_m);
5975 __Pyx_XGIVEREF(__pyx_r);
5976 __Pyx_RefNannyFinishContext();
5977 return __pyx_r;
5978 }
5979
5980 /* "pymusic.pyx":268
5981 * mapImpl(ptr, m.ptr, t, maxBuffered)
5982 *
5983 * def insertEvent(self, double time, int index, IndexType t): # <<<<<<<<<<<<<<
5984 * """
5985 * double time: time of event (must be during current tick)
5986 */
5987
5988 /* Python wrapper */
5989 static PyObject *__pyx_pw_7pymusic_15EventOutputPort_3insertEvent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5990 static char __pyx_doc_7pymusic_15EventOutputPort_2insertEvent[] = "\n double time: time of event (must be during current tick)\n int index: local or global index of event\n IndexType t: LOCAL|GLOBAL\n ";
5991 static PyObject *__pyx_pw_7pymusic_15EventOutputPort_3insertEvent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5992 double __pyx_v_time;
5993 int __pyx_v_index;
5994 CYTHON_UNUSED MUSIC::Index::Type __pyx_v_t;
5995 int __pyx_lineno = 0;
5996 const char *__pyx_filename = NULL;
5997 int __pyx_clineno = 0;
5998 PyObject *__pyx_r = 0;
5999 __Pyx_RefNannyDeclarations
6000 __Pyx_RefNannySetupContext("insertEvent (wrapper)", 0);
6001 {
6002 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,&__pyx_n_s_index,&__pyx_n_s_t,0};
6003 PyObject* values[3] = {0,0,0};
6004 if (unlikely(__pyx_kwds)) {
6005 Py_ssize_t kw_args;
6006 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6007 switch (pos_args) {
6008 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6009 CYTHON_FALLTHROUGH;
6010 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6011 CYTHON_FALLTHROUGH;
6012 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6013 CYTHON_FALLTHROUGH;
6014 case 0: break;
6015 default: goto __pyx_L5_argtuple_error;
6016 }
6017 kw_args = PyDict_Size(__pyx_kwds);
6018 switch (pos_args) {
6019 case 0:
6020 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--;
6021 else goto __pyx_L5_argtuple_error;
6022 CYTHON_FALLTHROUGH;
6023 case 1:
6024 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
6025 else {
6026 __Pyx_RaiseArgtupleInvalid("insertEvent", 1, 3, 3, 1); __PYX_ERR(0, 268, __pyx_L3_error)
6027 }
6028 CYTHON_FALLTHROUGH;
6029 case 2:
6030 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6031 else {
6032 __Pyx_RaiseArgtupleInvalid("insertEvent", 1, 3, 3, 2); __PYX_ERR(0, 268, __pyx_L3_error)
6033 }
6034 }
6035 if (unlikely(kw_args > 0)) {
6036 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertEvent") < 0)) __PYX_ERR(0, 268, __pyx_L3_error)
6037 }
6038 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6039 goto __pyx_L5_argtuple_error;
6040 } else {
6041 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6042 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6043 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6044 }
6045 __pyx_v_time = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
6046 __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
6047 __pyx_v_t = ((MUSIC::Index::Type)__Pyx_PyInt_As_MUSIC_3a__3a_Index_3a__3a_Type(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
6048 }
6049 goto __pyx_L4_argument_unpacking_done;
6050 __pyx_L5_argtuple_error:;
6051 __Pyx_RaiseArgtupleInvalid("insertEvent", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error)
6052 __pyx_L3_error:;
6053 __Pyx_AddTraceback("pymusic.EventOutputPort.insertEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
6054 __Pyx_RefNannyFinishContext();
6055 return NULL;
6056 __pyx_L4_argument_unpacking_done:;
6057 __pyx_r = __pyx_pf_7pymusic_15EventOutputPort_2insertEvent(((struct __pyx_obj_7pymusic_EventOutputPort *)__pyx_v_self), __pyx_v_time, __pyx_v_index, __pyx_v_t);
6058
6059 /* function exit code */
6060 __Pyx_RefNannyFinishContext();
6061 return __pyx_r;
6062 }
6063
6064 static PyObject *__pyx_pf_7pymusic_15EventOutputPort_2insertEvent(struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_self, double __pyx_v_time, int __pyx_v_index, CYTHON_UNUSED MUSIC::Index::Type __pyx_v_t) {
6065 MUSIC::EventOutputPort *__pyx_v_ptr;
6066 PyObject *__pyx_r = NULL;
6067 __Pyx_RefNannyDeclarations
6068 __Pyx_RefNannySetupContext("insertEvent", 0);
6069
6070 /* "pymusic.pyx":274
6071 * IndexType t: LOCAL|GLOBAL
6072 * """
6073 * cdef CEventOutputPort* ptr = dc_CEventOutputPort(self.ptr) # <<<<<<<<<<<<<<
6074 * insertEventImpl(ptr, time, index)
6075 *
6076 */
6077 __pyx_v_ptr = dynamic_cast<MUSIC::EventOutputPort*>(__pyx_v_self->__pyx_base.ptr);
6078
6079 /* "pymusic.pyx":275
6080 * """
6081 * cdef CEventOutputPort* ptr = dc_CEventOutputPort(self.ptr)
6082 * insertEventImpl(ptr, time, index) # <<<<<<<<<<<<<<
6083 *
6084 * cdef class MessageInputPort(Port):
6085 */
6086 MUSIC::Implementer::insertEventImpl(__pyx_v_ptr, __pyx_v_time, __pyx_v_index);
6087
6088 /* "pymusic.pyx":268
6089 * mapImpl(ptr, m.ptr, t, maxBuffered)
6090 *
6091 * def insertEvent(self, double time, int index, IndexType t): # <<<<<<<<<<<<<<
6092 * """
6093 * double time: time of event (must be during current tick)
6094 */
6095
6096 /* function exit code */
6097 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6098 __Pyx_XGIVEREF(__pyx_r);
6099 __Pyx_RefNannyFinishContext();
6100 return __pyx_r;
6101 }
6102
6103 /* "(tree fragment)":1
6104 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6105 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6106 * def __setstate_cython__(self, __pyx_state):
6107 */
6108
6109 /* Python wrapper */
6110 static PyObject *__pyx_pw_7pymusic_15EventOutputPort_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6111 static PyObject *__pyx_pw_7pymusic_15EventOutputPort_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6112 PyObject *__pyx_r = 0;
6113 __Pyx_RefNannyDeclarations
6114 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6115 __pyx_r = __pyx_pf_7pymusic_15EventOutputPort_4__reduce_cython__(((struct __pyx_obj_7pymusic_EventOutputPort *)__pyx_v_self));
6116
6117 /* function exit code */
6118 __Pyx_RefNannyFinishContext();
6119 return __pyx_r;
6120 }
6121
6122 static PyObject *__pyx_pf_7pymusic_15EventOutputPort_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_self) {
6123 PyObject *__pyx_r = NULL;
6124 __Pyx_RefNannyDeclarations
6125 PyObject *__pyx_t_1 = NULL;
6126 int __pyx_lineno = 0;
6127 const char *__pyx_filename = NULL;
6128 int __pyx_clineno = 0;
6129 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6130
6131 /* "(tree fragment)":2
6132 * def __reduce_cython__(self):
6133 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6134 * def __setstate_cython__(self, __pyx_state):
6135 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6136 */
6137 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6138 __Pyx_GOTREF(__pyx_t_1);
6139 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6140 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6141 __PYX_ERR(1, 2, __pyx_L1_error)
6142
6143 /* "(tree fragment)":1
6144 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6145 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6146 * def __setstate_cython__(self, __pyx_state):
6147 */
6148
6149 /* function exit code */
6150 __pyx_L1_error:;
6151 __Pyx_XDECREF(__pyx_t_1);
6152 __Pyx_AddTraceback("pymusic.EventOutputPort.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6153 __pyx_r = NULL;
6154 __Pyx_XGIVEREF(__pyx_r);
6155 __Pyx_RefNannyFinishContext();
6156 return __pyx_r;
6157 }
6158
6159 /* "(tree fragment)":3
6160 * def __reduce_cython__(self):
6161 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6162 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6163 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6164 */
6165
6166 /* Python wrapper */
6167 static PyObject *__pyx_pw_7pymusic_15EventOutputPort_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6168 static PyObject *__pyx_pw_7pymusic_15EventOutputPort_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6169 PyObject *__pyx_r = 0;
6170 __Pyx_RefNannyDeclarations
6171 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6172 __pyx_r = __pyx_pf_7pymusic_15EventOutputPort_6__setstate_cython__(((struct __pyx_obj_7pymusic_EventOutputPort *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6173
6174 /* function exit code */
6175 __Pyx_RefNannyFinishContext();
6176 return __pyx_r;
6177 }
6178
6179 static PyObject *__pyx_pf_7pymusic_15EventOutputPort_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6180 PyObject *__pyx_r = NULL;
6181 __Pyx_RefNannyDeclarations
6182 PyObject *__pyx_t_1 = NULL;
6183 int __pyx_lineno = 0;
6184 const char *__pyx_filename = NULL;
6185 int __pyx_clineno = 0;
6186 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6187
6188 /* "(tree fragment)":4
6189 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6190 * def __setstate_cython__(self, __pyx_state):
6191 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6192 */
6193 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6194 __Pyx_GOTREF(__pyx_t_1);
6195 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6196 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6197 __PYX_ERR(1, 4, __pyx_L1_error)
6198
6199 /* "(tree fragment)":3
6200 * def __reduce_cython__(self):
6201 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6202 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6203 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6204 */
6205
6206 /* function exit code */
6207 __pyx_L1_error:;
6208 __Pyx_XDECREF(__pyx_t_1);
6209 __Pyx_AddTraceback("pymusic.EventOutputPort.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6210 __pyx_r = NULL;
6211 __Pyx_XGIVEREF(__pyx_r);
6212 __Pyx_RefNannyFinishContext();
6213 return __pyx_r;
6214 }
6215
6216 /* "pymusic.pyx":285
6217 * here and drop the reference when this object is null'd.
6218 * """
6219 * def __cinit__(self): # <<<<<<<<<<<<<<
6220 * self.events = set()
6221 *
6222 */
6223
6224 /* Python wrapper */
6225 static int __pyx_pw_7pymusic_16MessageInputPort_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6226 static int __pyx_pw_7pymusic_16MessageInputPort_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6227 int __pyx_r;
6228 __Pyx_RefNannyDeclarations
6229 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
6230 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
6231 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
6232 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
6233 __pyx_r = __pyx_pf_7pymusic_16MessageInputPort___cinit__(((struct __pyx_obj_7pymusic_MessageInputPort *)__pyx_v_self));
6234
6235 /* function exit code */
6236 __Pyx_RefNannyFinishContext();
6237 return __pyx_r;
6238 }
6239
6240 static int __pyx_pf_7pymusic_16MessageInputPort___cinit__(struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self) {
6241 int __pyx_r;
6242 __Pyx_RefNannyDeclarations
6243 PyObject *__pyx_t_1 = NULL;
6244 int __pyx_lineno = 0;
6245 const char *__pyx_filename = NULL;
6246 int __pyx_clineno = 0;
6247 __Pyx_RefNannySetupContext("__cinit__", 0);
6248
6249 /* "pymusic.pyx":286
6250 * """
6251 * def __cinit__(self):
6252 * self.events = set() # <<<<<<<<<<<<<<
6253 *
6254 * cpdef null(self):
6255 */
6256 __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
6257 __Pyx_GOTREF(__pyx_t_1);
6258 __Pyx_GIVEREF(__pyx_t_1);
6259 __Pyx_GOTREF(__pyx_v_self->events);
6260 __Pyx_DECREF(__pyx_v_self->events);
6261 __pyx_v_self->events = ((PyObject*)__pyx_t_1);
6262 __pyx_t_1 = 0;
6263
6264 /* "pymusic.pyx":285
6265 * here and drop the reference when this object is null'd.
6266 * """
6267 * def __cinit__(self): # <<<<<<<<<<<<<<
6268 * self.events = set()
6269 *
6270 */
6271
6272 /* function exit code */
6273 __pyx_r = 0;
6274 goto __pyx_L0;
6275 __pyx_L1_error:;
6276 __Pyx_XDECREF(__pyx_t_1);
6277 __Pyx_AddTraceback("pymusic.MessageInputPort.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6278 __pyx_r = -1;
6279 __pyx_L0:;
6280 __Pyx_RefNannyFinishContext();
6281 return __pyx_r;
6282 }
6283
6284 /* "pymusic.pyx":288
6285 * self.events = set()
6286 *
6287 * cpdef null(self): # <<<<<<<<<<<<<<
6288 * """
6289 * Remember to remove the references to events...
6290 */
6291
6292 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_3null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6293 static PyObject *__pyx_f_7pymusic_16MessageInputPort_null(struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self, int __pyx_skip_dispatch) {
6294 PyObject *__pyx_r = NULL;
6295 __Pyx_RefNannyDeclarations
6296 PyObject *__pyx_t_1 = NULL;
6297 PyObject *__pyx_t_2 = NULL;
6298 PyObject *__pyx_t_3 = NULL;
6299 PyObject *__pyx_t_4 = NULL;
6300 int __pyx_lineno = 0;
6301 const char *__pyx_filename = NULL;
6302 int __pyx_clineno = 0;
6303 __Pyx_RefNannySetupContext("null", 0);
6304 /* Check if called by wrapper */
6305 if (unlikely(__pyx_skip_dispatch)) ;
6306 /* Check if overridden in Python */
6307 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
6308 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6309 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6310 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6311 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6312 #endif
6313 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
6314 __Pyx_GOTREF(__pyx_t_1);
6315 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pymusic_16MessageInputPort_3null)) {
6316 __Pyx_XDECREF(__pyx_r);
6317 __Pyx_INCREF(__pyx_t_1);
6318 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
6319 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6320 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6321 if (likely(__pyx_t_4)) {
6322 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6323 __Pyx_INCREF(__pyx_t_4);
6324 __Pyx_INCREF(function);
6325 __Pyx_DECREF_SET(__pyx_t_3, function);
6326 }
6327 }
6328 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6329 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6330 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
6331 __Pyx_GOTREF(__pyx_t_2);
6332 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6333 __pyx_r = __pyx_t_2;
6334 __pyx_t_2 = 0;
6335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6336 goto __pyx_L0;
6337 }
6338 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6339 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6340 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6341 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6342 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6343 }
6344 #endif
6345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6346 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6347 }
6348 #endif
6349 }
6350
6351 /* "pymusic.pyx":292
6352 * Remember to remove the references to events...
6353 * """
6354 * Port.null(self) # <<<<<<<<<<<<<<
6355 * self.events = None
6356 *
6357 */
6358 __pyx_t_1 = __pyx_f_7pymusic_4Port_null(((struct __pyx_obj_7pymusic_Port *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
6359 __Pyx_GOTREF(__pyx_t_1);
6360 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6361
6362 /* "pymusic.pyx":293
6363 * """
6364 * Port.null(self)
6365 * self.events = None # <<<<<<<<<<<<<<
6366 *
6367 * def map(self, func, double accLatency=0, int maxBuffered=-1, bint pickled=True):
6368 */
6369 __Pyx_INCREF(Py_None);
6370 __Pyx_GIVEREF(Py_None);
6371 __Pyx_GOTREF(__pyx_v_self->events);
6372 __Pyx_DECREF(__pyx_v_self->events);
6373 __pyx_v_self->events = ((PyObject*)Py_None);
6374
6375 /* "pymusic.pyx":288
6376 * self.events = set()
6377 *
6378 * cpdef null(self): # <<<<<<<<<<<<<<
6379 * """
6380 * Remember to remove the references to events...
6381 */
6382
6383 /* function exit code */
6384 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6385 goto __pyx_L0;
6386 __pyx_L1_error:;
6387 __Pyx_XDECREF(__pyx_t_1);
6388 __Pyx_XDECREF(__pyx_t_2);
6389 __Pyx_XDECREF(__pyx_t_3);
6390 __Pyx_XDECREF(__pyx_t_4);
6391 __Pyx_AddTraceback("pymusic.MessageInputPort.null", __pyx_clineno, __pyx_lineno, __pyx_filename);
6392 __pyx_r = 0;
6393 __pyx_L0:;
6394 __Pyx_XGIVEREF(__pyx_r);
6395 __Pyx_RefNannyFinishContext();
6396 return __pyx_r;
6397 }
6398
6399 /* Python wrapper */
6400 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_3null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6401 static char __pyx_doc_7pymusic_16MessageInputPort_2null[] = "\n Remember to remove the references to events...\n ";
6402 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_3null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6403 PyObject *__pyx_r = 0;
6404 __Pyx_RefNannyDeclarations
6405 __Pyx_RefNannySetupContext("null (wrapper)", 0);
6406 __pyx_r = __pyx_pf_7pymusic_16MessageInputPort_2null(((struct __pyx_obj_7pymusic_MessageInputPort *)__pyx_v_self));
6407
6408 /* function exit code */
6409 __Pyx_RefNannyFinishContext();
6410 return __pyx_r;
6411 }
6412
6413 static PyObject *__pyx_pf_7pymusic_16MessageInputPort_2null(struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self) {
6414 PyObject *__pyx_r = NULL;
6415 __Pyx_RefNannyDeclarations
6416 PyObject *__pyx_t_1 = NULL;
6417 int __pyx_lineno = 0;
6418 const char *__pyx_filename = NULL;
6419 int __pyx_clineno = 0;
6420 __Pyx_RefNannySetupContext("null", 0);
6421 __Pyx_XDECREF(__pyx_r);
6422 __pyx_t_1 = __pyx_f_7pymusic_16MessageInputPort_null(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
6423 __Pyx_GOTREF(__pyx_t_1);
6424 __pyx_r = __pyx_t_1;
6425 __pyx_t_1 = 0;
6426 goto __pyx_L0;
6427
6428 /* function exit code */
6429 __pyx_L1_error:;
6430 __Pyx_XDECREF(__pyx_t_1);
6431 __Pyx_AddTraceback("pymusic.MessageInputPort.null", __pyx_clineno, __pyx_lineno, __pyx_filename);
6432 __pyx_r = NULL;
6433 __pyx_L0:;
6434 __Pyx_XGIVEREF(__pyx_r);
6435 __Pyx_RefNannyFinishContext();
6436 return __pyx_r;
6437 }
6438
6439 /* "pymusic.pyx":295
6440 * self.events = None
6441 *
6442 * def map(self, func, double accLatency=0, int maxBuffered=-1, bint pickled=True): # <<<<<<<<<<<<<<
6443 * """
6444 * The message handling function.
6445 */
6446
6447 /* Python wrapper */
6448 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_5map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6449 static char __pyx_doc_7pymusic_16MessageInputPort_4map[] = "\n The message handling function.\n func: callable object as follows\n void func(double time, object msg):\n time: the set insertion time of the message\n msg: an object which may have been pickled and fed through music\n accLatency(0): \"acceptable latency\" (\077\077?)\n maxBuffered(-1): ticks that can be buffered (-1 means unknown\n amount (\077\077?))\n pickled(True): pickle objects on both ends; else, the object should be\n a buffer object and we'll receive a bytearray\n ";
6450 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_5map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6451 PyObject *__pyx_v_func = 0;
6452 double __pyx_v_accLatency;
6453 int __pyx_v_maxBuffered;
6454 int __pyx_v_pickled;
6455 int __pyx_lineno = 0;
6456 const char *__pyx_filename = NULL;
6457 int __pyx_clineno = 0;
6458 PyObject *__pyx_r = 0;
6459 __Pyx_RefNannyDeclarations
6460 __Pyx_RefNannySetupContext("map (wrapper)", 0);
6461 {
6462 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_accLatency,&__pyx_n_s_maxBuffered,&__pyx_n_s_pickled,0};
6463 PyObject* values[4] = {0,0,0,0};
6464 if (unlikely(__pyx_kwds)) {
6465 Py_ssize_t kw_args;
6466 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6467 switch (pos_args) {
6468 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6469 CYTHON_FALLTHROUGH;
6470 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6471 CYTHON_FALLTHROUGH;
6472 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6473 CYTHON_FALLTHROUGH;
6474 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6475 CYTHON_FALLTHROUGH;
6476 case 0: break;
6477 default: goto __pyx_L5_argtuple_error;
6478 }
6479 kw_args = PyDict_Size(__pyx_kwds);
6480 switch (pos_args) {
6481 case 0:
6482 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
6483 else goto __pyx_L5_argtuple_error;
6484 CYTHON_FALLTHROUGH;
6485 case 1:
6486 if (kw_args > 0) {
6487 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_accLatency);
6488 if (value) { values[1] = value; kw_args--; }
6489 }
6490 CYTHON_FALLTHROUGH;
6491 case 2:
6492 if (kw_args > 0) {
6493 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxBuffered);
6494 if (value) { values[2] = value; kw_args--; }
6495 }
6496 CYTHON_FALLTHROUGH;
6497 case 3:
6498 if (kw_args > 0) {
6499 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pickled);
6500 if (value) { values[3] = value; kw_args--; }
6501 }
6502 }
6503 if (unlikely(kw_args > 0)) {
6504 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 295, __pyx_L3_error)
6505 }
6506 } else {
6507 switch (PyTuple_GET_SIZE(__pyx_args)) {
6508 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6509 CYTHON_FALLTHROUGH;
6510 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6511 CYTHON_FALLTHROUGH;
6512 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6513 CYTHON_FALLTHROUGH;
6514 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6515 break;
6516 default: goto __pyx_L5_argtuple_error;
6517 }
6518 }
6519 __pyx_v_func = values[0];
6520 if (values[1]) {
6521 __pyx_v_accLatency = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_accLatency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L3_error)
6522 } else {
6523 __pyx_v_accLatency = ((double)0.0);
6524 }
6525 if (values[2]) {
6526 __pyx_v_maxBuffered = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_maxBuffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L3_error)
6527 } else {
6528 __pyx_v_maxBuffered = ((int)-1);
6529 }
6530 if (values[3]) {
6531 __pyx_v_pickled = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_pickled == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L3_error)
6532 } else {
6533 __pyx_v_pickled = ((int)1);
6534 }
6535 }
6536 goto __pyx_L4_argument_unpacking_done;
6537 __pyx_L5_argtuple_error:;
6538 __Pyx_RaiseArgtupleInvalid("map", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 295, __pyx_L3_error)
6539 __pyx_L3_error:;
6540 __Pyx_AddTraceback("pymusic.MessageInputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
6541 __Pyx_RefNannyFinishContext();
6542 return NULL;
6543 __pyx_L4_argument_unpacking_done:;
6544 __pyx_r = __pyx_pf_7pymusic_16MessageInputPort_4map(((struct __pyx_obj_7pymusic_MessageInputPort *)__pyx_v_self), __pyx_v_func, __pyx_v_accLatency, __pyx_v_maxBuffered, __pyx_v_pickled);
6545
6546 /* function exit code */
6547 __Pyx_RefNannyFinishContext();
6548 return __pyx_r;
6549 }
6550
6551 static PyObject *__pyx_pf_7pymusic_16MessageInputPort_4map(struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self, PyObject *__pyx_v_func, double __pyx_v_accLatency, int __pyx_v_maxBuffered, int __pyx_v_pickled) {
6552 struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_eh = 0;
6553 MUSIC::MessageInputPort *__pyx_v_ptr;
6554 PyObject *__pyx_r = NULL;
6555 __Pyx_RefNannyDeclarations
6556 PyObject *__pyx_t_1 = NULL;
6557 PyObject *__pyx_t_2 = NULL;
6558 int __pyx_t_3;
6559 int __pyx_lineno = 0;
6560 const char *__pyx_filename = NULL;
6561 int __pyx_clineno = 0;
6562 __Pyx_RefNannySetupContext("map", 0);
6563
6564 /* "pymusic.pyx":308
6565 * a buffer object and we'll receive a bytearray
6566 * """
6567 * cdef MessageHandler eh = MessageHandler(func, pickled) # <<<<<<<<<<<<<<
6568 * cdef CMessageInputPort* ptr = dc_CMessageInputPort(self.ptr)
6569 * mapImpl(ptr, eh.ptr, accLatency, maxBuffered)
6570 */
6571 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_pickled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
6572 __Pyx_GOTREF(__pyx_t_1);
6573 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
6574 __Pyx_GOTREF(__pyx_t_2);
6575 __Pyx_INCREF(__pyx_v_func);
6576 __Pyx_GIVEREF(__pyx_v_func);
6577 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func);
6578 __Pyx_GIVEREF(__pyx_t_1);
6579 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
6580 __pyx_t_1 = 0;
6581 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_MessageHandler), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
6582 __Pyx_GOTREF(__pyx_t_1);
6583 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6584 __pyx_v_eh = ((struct __pyx_obj_7pymusic_MessageHandler *)__pyx_t_1);
6585 __pyx_t_1 = 0;
6586
6587 /* "pymusic.pyx":309
6588 * """
6589 * cdef MessageHandler eh = MessageHandler(func, pickled)
6590 * cdef CMessageInputPort* ptr = dc_CMessageInputPort(self.ptr) # <<<<<<<<<<<<<<
6591 * mapImpl(ptr, eh.ptr, accLatency, maxBuffered)
6592 * self.events.add(eh)
6593 */
6594 __pyx_v_ptr = dynamic_cast<MUSIC::MessageInputPort*>(__pyx_v_self->__pyx_base.ptr);
6595
6596 /* "pymusic.pyx":310
6597 * cdef MessageHandler eh = MessageHandler(func, pickled)
6598 * cdef CMessageInputPort* ptr = dc_CMessageInputPort(self.ptr)
6599 * mapImpl(ptr, eh.ptr, accLatency, maxBuffered) # <<<<<<<<<<<<<<
6600 * self.events.add(eh)
6601 *
6602 */
6603 MUSIC::Implementer::mapImpl(__pyx_v_ptr, __pyx_v_eh->ptr, __pyx_v_accLatency, __pyx_v_maxBuffered);
6604
6605 /* "pymusic.pyx":311
6606 * cdef CMessageInputPort* ptr = dc_CMessageInputPort(self.ptr)
6607 * mapImpl(ptr, eh.ptr, accLatency, maxBuffered)
6608 * self.events.add(eh) # <<<<<<<<<<<<<<
6609 *
6610 * cdef class MessageOutputPort(Port):
6611 */
6612 if (unlikely(__pyx_v_self->events == Py_None)) {
6613 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
6614 __PYX_ERR(0, 311, __pyx_L1_error)
6615 }
6616 __pyx_t_3 = PySet_Add(__pyx_v_self->events, ((PyObject *)__pyx_v_eh)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 311, __pyx_L1_error)
6617
6618 /* "pymusic.pyx":295
6619 * self.events = None
6620 *
6621 * def map(self, func, double accLatency=0, int maxBuffered=-1, bint pickled=True): # <<<<<<<<<<<<<<
6622 * """
6623 * The message handling function.
6624 */
6625
6626 /* function exit code */
6627 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6628 goto __pyx_L0;
6629 __pyx_L1_error:;
6630 __Pyx_XDECREF(__pyx_t_1);
6631 __Pyx_XDECREF(__pyx_t_2);
6632 __Pyx_AddTraceback("pymusic.MessageInputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
6633 __pyx_r = NULL;
6634 __pyx_L0:;
6635 __Pyx_XDECREF((PyObject *)__pyx_v_eh);
6636 __Pyx_XGIVEREF(__pyx_r);
6637 __Pyx_RefNannyFinishContext();
6638 return __pyx_r;
6639 }
6640
6641 /* "(tree fragment)":1
6642 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6643 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6644 * def __setstate_cython__(self, __pyx_state):
6645 */
6646
6647 /* Python wrapper */
6648 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6649 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6650 PyObject *__pyx_r = 0;
6651 __Pyx_RefNannyDeclarations
6652 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6653 __pyx_r = __pyx_pf_7pymusic_16MessageInputPort_6__reduce_cython__(((struct __pyx_obj_7pymusic_MessageInputPort *)__pyx_v_self));
6654
6655 /* function exit code */
6656 __Pyx_RefNannyFinishContext();
6657 return __pyx_r;
6658 }
6659
6660 static PyObject *__pyx_pf_7pymusic_16MessageInputPort_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self) {
6661 PyObject *__pyx_r = NULL;
6662 __Pyx_RefNannyDeclarations
6663 PyObject *__pyx_t_1 = NULL;
6664 int __pyx_lineno = 0;
6665 const char *__pyx_filename = NULL;
6666 int __pyx_clineno = 0;
6667 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6668
6669 /* "(tree fragment)":2
6670 * def __reduce_cython__(self):
6671 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6672 * def __setstate_cython__(self, __pyx_state):
6673 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6674 */
6675 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6676 __Pyx_GOTREF(__pyx_t_1);
6677 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6678 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6679 __PYX_ERR(1, 2, __pyx_L1_error)
6680
6681 /* "(tree fragment)":1
6682 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6683 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6684 * def __setstate_cython__(self, __pyx_state):
6685 */
6686
6687 /* function exit code */
6688 __pyx_L1_error:;
6689 __Pyx_XDECREF(__pyx_t_1);
6690 __Pyx_AddTraceback("pymusic.MessageInputPort.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6691 __pyx_r = NULL;
6692 __Pyx_XGIVEREF(__pyx_r);
6693 __Pyx_RefNannyFinishContext();
6694 return __pyx_r;
6695 }
6696
6697 /* "(tree fragment)":3
6698 * def __reduce_cython__(self):
6699 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6700 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6701 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6702 */
6703
6704 /* Python wrapper */
6705 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6706 static PyObject *__pyx_pw_7pymusic_16MessageInputPort_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6707 PyObject *__pyx_r = 0;
6708 __Pyx_RefNannyDeclarations
6709 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6710 __pyx_r = __pyx_pf_7pymusic_16MessageInputPort_8__setstate_cython__(((struct __pyx_obj_7pymusic_MessageInputPort *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6711
6712 /* function exit code */
6713 __Pyx_RefNannyFinishContext();
6714 return __pyx_r;
6715 }
6716
6717 static PyObject *__pyx_pf_7pymusic_16MessageInputPort_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6718 PyObject *__pyx_r = NULL;
6719 __Pyx_RefNannyDeclarations
6720 PyObject *__pyx_t_1 = NULL;
6721 int __pyx_lineno = 0;
6722 const char *__pyx_filename = NULL;
6723 int __pyx_clineno = 0;
6724 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6725
6726 /* "(tree fragment)":4
6727 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6728 * def __setstate_cython__(self, __pyx_state):
6729 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6730 */
6731 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6732 __Pyx_GOTREF(__pyx_t_1);
6733 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6735 __PYX_ERR(1, 4, __pyx_L1_error)
6736
6737 /* "(tree fragment)":3
6738 * def __reduce_cython__(self):
6739 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6740 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6741 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6742 */
6743
6744 /* function exit code */
6745 __pyx_L1_error:;
6746 __Pyx_XDECREF(__pyx_t_1);
6747 __Pyx_AddTraceback("pymusic.MessageInputPort.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6748 __pyx_r = NULL;
6749 __Pyx_XGIVEREF(__pyx_r);
6750 __Pyx_RefNannyFinishContext();
6751 return __pyx_r;
6752 }
6753
6754 /* "pymusic.pyx":318
6755 * pickled and fed to the other end, associated with a time.
6756 * """
6757 * def map(self, int maxBuffered=-1, bint pickled=True): # <<<<<<<<<<<<<<
6758 * """
6759 * map only sets the buffering ticks.
6760 */
6761
6762 /* Python wrapper */
6763 static PyObject *__pyx_pw_7pymusic_17MessageOutputPort_1map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6764 static char __pyx_doc_7pymusic_17MessageOutputPort_map[] = "\n map only sets the buffering ticks.\n maxBuffered (-1): ticks to buffer (-1 means \"reasonable\" \077\077?)\n pickled (True): whether messages objects inserted her are automatically\n pickled, else the object should be a buffer-type and\n the other end will get a bytearray.\n ";
6765 static PyObject *__pyx_pw_7pymusic_17MessageOutputPort_1map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6766 int __pyx_v_maxBuffered;
6767 int __pyx_v_pickled;
6768 int __pyx_lineno = 0;
6769 const char *__pyx_filename = NULL;
6770 int __pyx_clineno = 0;
6771 PyObject *__pyx_r = 0;
6772 __Pyx_RefNannyDeclarations
6773 __Pyx_RefNannySetupContext("map (wrapper)", 0);
6774 {
6775 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxBuffered,&__pyx_n_s_pickled,0};
6776 PyObject* values[2] = {0,0};
6777 if (unlikely(__pyx_kwds)) {
6778 Py_ssize_t kw_args;
6779 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6780 switch (pos_args) {
6781 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6782 CYTHON_FALLTHROUGH;
6783 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6784 CYTHON_FALLTHROUGH;
6785 case 0: break;
6786 default: goto __pyx_L5_argtuple_error;
6787 }
6788 kw_args = PyDict_Size(__pyx_kwds);
6789 switch (pos_args) {
6790 case 0:
6791 if (kw_args > 0) {
6792 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxBuffered);
6793 if (value) { values[0] = value; kw_args--; }
6794 }
6795 CYTHON_FALLTHROUGH;
6796 case 1:
6797 if (kw_args > 0) {
6798 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pickled);
6799 if (value) { values[1] = value; kw_args--; }
6800 }
6801 }
6802 if (unlikely(kw_args > 0)) {
6803 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 318, __pyx_L3_error)
6804 }
6805 } else {
6806 switch (PyTuple_GET_SIZE(__pyx_args)) {
6807 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6808 CYTHON_FALLTHROUGH;
6809 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6810 CYTHON_FALLTHROUGH;
6811 case 0: break;
6812 default: goto __pyx_L5_argtuple_error;
6813 }
6814 }
6815 if (values[0]) {
6816 __pyx_v_maxBuffered = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_maxBuffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error)
6817 } else {
6818 __pyx_v_maxBuffered = ((int)-1);
6819 }
6820 if (values[1]) {
6821 __pyx_v_pickled = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pickled == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error)
6822 } else {
6823 __pyx_v_pickled = ((int)1);
6824 }
6825 }
6826 goto __pyx_L4_argument_unpacking_done;
6827 __pyx_L5_argtuple_error:;
6828 __Pyx_RaiseArgtupleInvalid("map", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 318, __pyx_L3_error)
6829 __pyx_L3_error:;
6830 __Pyx_AddTraceback("pymusic.MessageOutputPort.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
6831 __Pyx_RefNannyFinishContext();
6832 return NULL;
6833 __pyx_L4_argument_unpacking_done:;
6834 __pyx_r = __pyx_pf_7pymusic_17MessageOutputPort_map(((struct __pyx_obj_7pymusic_MessageOutputPort *)__pyx_v_self), __pyx_v_maxBuffered, __pyx_v_pickled);
6835
6836 /* function exit code */
6837 __Pyx_RefNannyFinishContext();
6838 return __pyx_r;
6839 }
6840
6841 static PyObject *__pyx_pf_7pymusic_17MessageOutputPort_map(struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_self, int __pyx_v_maxBuffered, int __pyx_v_pickled) {
6842 MUSIC::MessageOutputPort *__pyx_v_ptr;
6843 PyObject *__pyx_r = NULL;
6844 __Pyx_RefNannyDeclarations
6845 __Pyx_RefNannySetupContext("map", 0);
6846
6847 /* "pymusic.pyx":326
6848 * the other end will get a bytearray.
6849 * """
6850 * self.pickled = pickled # <<<<<<<<<<<<<<
6851 * cdef CMessageOutputPort* ptr = dc_CMessageOutputPort(self.ptr)
6852 * mapImpl(ptr, maxBuffered)
6853 */
6854 __pyx_v_self->pickled = __pyx_v_pickled;
6855
6856 /* "pymusic.pyx":327
6857 * """
6858 * self.pickled = pickled
6859 * cdef CMessageOutputPort* ptr = dc_CMessageOutputPort(self.ptr) # <<<<<<<<<<<<<<
6860 * mapImpl(ptr, maxBuffered)
6861 *
6862 */
6863 __pyx_v_ptr = dynamic_cast<MUSIC::MessageOutputPort*>(__pyx_v_self->__pyx_base.ptr);
6864
6865 /* "pymusic.pyx":328
6866 * self.pickled = pickled
6867 * cdef CMessageOutputPort* ptr = dc_CMessageOutputPort(self.ptr)
6868 * mapImpl(ptr, maxBuffered) # <<<<<<<<<<<<<<
6869 *
6870 * def insertMessage(self, double time, object msg):
6871 */
6872 MUSIC::Implementer::mapImpl(__pyx_v_ptr, __pyx_v_maxBuffered);
6873
6874 /* "pymusic.pyx":318
6875 * pickled and fed to the other end, associated with a time.
6876 * """
6877 * def map(self, int maxBuffered=-1, bint pickled=True): # <<<<<<<<<<<<<<
6878 * """
6879 * map only sets the buffering ticks.
6880 */
6881
6882 /* function exit code */
6883 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6884 __Pyx_XGIVEREF(__pyx_r);
6885 __Pyx_RefNannyFinishContext();
6886 return __pyx_r;
6887 }
6888
6889 /* "pymusic.pyx":330
6890 * mapImpl(ptr, maxBuffered)
6891 *
6892 * def insertMessage(self, double time, object msg): # <<<<<<<<<<<<<<
6893 * """
6894 * insert a python object as a message at a time during the
6895 */
6896
6897 /* Python wrapper */
6898 static PyObject *__pyx_pw_7pymusic_17MessageOutputPort_3insertMessage(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6899 static char __pyx_doc_7pymusic_17MessageOutputPort_2insertMessage[] = "\n insert a python object as a message at a time during the\n current tick.\n time: ms times (\077\077)\n msg: a python object that can be cPickled if self.pickled == True\n else something that has a buffer interface.\n ";
6900 static PyObject *__pyx_pw_7pymusic_17MessageOutputPort_3insertMessage(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6901 double __pyx_v_time;
6902 PyObject *__pyx_v_msg = 0;
6903 int __pyx_lineno = 0;
6904 const char *__pyx_filename = NULL;
6905 int __pyx_clineno = 0;
6906 PyObject *__pyx_r = 0;
6907 __Pyx_RefNannyDeclarations
6908 __Pyx_RefNannySetupContext("insertMessage (wrapper)", 0);
6909 {
6910 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,&__pyx_n_s_msg,0};
6911 PyObject* values[2] = {0,0};
6912 if (unlikely(__pyx_kwds)) {
6913 Py_ssize_t kw_args;
6914 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6915 switch (pos_args) {
6916 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6917 CYTHON_FALLTHROUGH;
6918 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6919 CYTHON_FALLTHROUGH;
6920 case 0: break;
6921 default: goto __pyx_L5_argtuple_error;
6922 }
6923 kw_args = PyDict_Size(__pyx_kwds);
6924 switch (pos_args) {
6925 case 0:
6926 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--;
6927 else goto __pyx_L5_argtuple_error;
6928 CYTHON_FALLTHROUGH;
6929 case 1:
6930 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--;
6931 else {
6932 __Pyx_RaiseArgtupleInvalid("insertMessage", 1, 2, 2, 1); __PYX_ERR(0, 330, __pyx_L3_error)
6933 }
6934 }
6935 if (unlikely(kw_args > 0)) {
6936 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertMessage") < 0)) __PYX_ERR(0, 330, __pyx_L3_error)
6937 }
6938 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6939 goto __pyx_L5_argtuple_error;
6940 } else {
6941 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6942 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6943 }
6944 __pyx_v_time = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error)
6945 __pyx_v_msg = values[1];
6946 }
6947 goto __pyx_L4_argument_unpacking_done;
6948 __pyx_L5_argtuple_error:;
6949 __Pyx_RaiseArgtupleInvalid("insertMessage", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 330, __pyx_L3_error)
6950 __pyx_L3_error:;
6951 __Pyx_AddTraceback("pymusic.MessageOutputPort.insertMessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6952 __Pyx_RefNannyFinishContext();
6953 return NULL;
6954 __pyx_L4_argument_unpacking_done:;
6955 __pyx_r = __pyx_pf_7pymusic_17MessageOutputPort_2insertMessage(((struct __pyx_obj_7pymusic_MessageOutputPort *)__pyx_v_self), __pyx_v_time, __pyx_v_msg);
6956
6957 /* function exit code */
6958 __Pyx_RefNannyFinishContext();
6959 return __pyx_r;
6960 }
6961
6962 static PyObject *__pyx_pf_7pymusic_17MessageOutputPort_2insertMessage(struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_self, double __pyx_v_time, PyObject *__pyx_v_msg) {
6963 MUSIC::MessageOutputPort *__pyx_v_ptr;
6964 PyObject *__pyx_v_pmsg = 0;
6965 PyObject *__pyx_r = NULL;
6966 __Pyx_RefNannyDeclarations
6967 PyObject *__pyx_t_1 = NULL;
6968 PyObject *__pyx_t_2 = NULL;
6969 PyObject *__pyx_t_3 = NULL;
6970 PyObject *__pyx_t_4 = NULL;
6971 PyObject *__pyx_t_5 = NULL;
6972 int __pyx_t_6;
6973 PyObject *__pyx_t_7 = NULL;
6974 char *__pyx_t_8;
6975 Py_ssize_t __pyx_t_9;
6976 int __pyx_lineno = 0;
6977 const char *__pyx_filename = NULL;
6978 int __pyx_clineno = 0;
6979 __Pyx_RefNannySetupContext("insertMessage", 0);
6980
6981 /* "pymusic.pyx":338
6982 * else something that has a buffer interface.
6983 * """
6984 * cdef CMessageOutputPort* ptr = dc_CMessageOutputPort(self.ptr) # <<<<<<<<<<<<<<
6985 * cdef bytearray pmsg = \
6986 * <bytearray> pickle.dumps(msg, pickle.HIGHEST_PROTOCOL) \
6987 */
6988 __pyx_v_ptr = dynamic_cast<MUSIC::MessageOutputPort*>(__pyx_v_self->__pyx_base.ptr);
6989
6990 /* "pymusic.pyx":341
6991 * cdef bytearray pmsg = \
6992 * <bytearray> pickle.dumps(msg, pickle.HIGHEST_PROTOCOL) \
6993 * if self.pickled \ # <<<<<<<<<<<<<<
6994 * else <bytearray> msg
6995 * ptr.insertMessage(time, <char*> pmsg, len(pmsg))
6996 */
6997 if ((__pyx_v_self->pickled != 0)) {
6998
6999 /* "pymusic.pyx":340
7000 * cdef CMessageOutputPort* ptr = dc_CMessageOutputPort(self.ptr)
7001 * cdef bytearray pmsg = \
7002 * <bytearray> pickle.dumps(msg, pickle.HIGHEST_PROTOCOL) \ # <<<<<<<<<<<<<<
7003 * if self.pickled \
7004 * else <bytearray> msg
7005 */
7006 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
7007 __Pyx_GOTREF(__pyx_t_3);
7008 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dumps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
7009 __Pyx_GOTREF(__pyx_t_4);
7010 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7011 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
7012 __Pyx_GOTREF(__pyx_t_3);
7013 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_HIGHEST_PROTOCOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
7014 __Pyx_GOTREF(__pyx_t_5);
7015 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7016 __pyx_t_3 = NULL;
7017 __pyx_t_6 = 0;
7018 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7019 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
7020 if (likely(__pyx_t_3)) {
7021 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7022 __Pyx_INCREF(__pyx_t_3);
7023 __Pyx_INCREF(function);
7024 __Pyx_DECREF_SET(__pyx_t_4, function);
7025 __pyx_t_6 = 1;
7026 }
7027 }
7028 #if CYTHON_FAST_PYCALL
7029 if (PyFunction_Check(__pyx_t_4)) {
7030 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_msg, __pyx_t_5};
7031 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
7032 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7033 __Pyx_GOTREF(__pyx_t_2);
7034 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7035 } else
7036 #endif
7037 #if CYTHON_FAST_PYCCALL
7038 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7039 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_msg, __pyx_t_5};
7040 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
7041 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7042 __Pyx_GOTREF(__pyx_t_2);
7043 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7044 } else
7045 #endif
7046 {
7047 __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error)
7048 __Pyx_GOTREF(__pyx_t_7);
7049 if (__pyx_t_3) {
7050 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
7051 }
7052 __Pyx_INCREF(__pyx_v_msg);
7053 __Pyx_GIVEREF(__pyx_v_msg);
7054 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_msg);
7055 __Pyx_GIVEREF(__pyx_t_5);
7056 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
7057 __pyx_t_5 = 0;
7058 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
7059 __Pyx_GOTREF(__pyx_t_2);
7060 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7061 }
7062 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7063 __Pyx_INCREF(((PyObject*)__pyx_t_2));
7064 __pyx_t_1 = __pyx_t_2;
7065 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7066 } else {
7067
7068 /* "pymusic.pyx":342
7069 * <bytearray> pickle.dumps(msg, pickle.HIGHEST_PROTOCOL) \
7070 * if self.pickled \
7071 * else <bytearray> msg # <<<<<<<<<<<<<<
7072 * ptr.insertMessage(time, <char*> pmsg, len(pmsg))
7073 *
7074 */
7075 __Pyx_INCREF(((PyObject*)__pyx_v_msg));
7076 __pyx_t_1 = __pyx_v_msg;
7077 }
7078 __pyx_v_pmsg = ((PyObject*)__pyx_t_1);
7079 __pyx_t_1 = 0;
7080
7081 /* "pymusic.pyx":343
7082 * if self.pickled \
7083 * else <bytearray> msg
7084 * ptr.insertMessage(time, <char*> pmsg, len(pmsg)) # <<<<<<<<<<<<<<
7085 *
7086 * ###########################################################
7087 */
7088 __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_pmsg); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L1_error)
7089 if (unlikely(__pyx_v_pmsg == Py_None)) {
7090 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7091 __PYX_ERR(0, 343, __pyx_L1_error)
7092 }
7093 __pyx_t_9 = PyByteArray_GET_SIZE(__pyx_v_pmsg); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 343, __pyx_L1_error)
7094 __pyx_v_ptr->insertMessage(__pyx_v_time, ((char *)__pyx_t_8), __pyx_t_9);
7095
7096 /* "pymusic.pyx":330
7097 * mapImpl(ptr, maxBuffered)
7098 *
7099 * def insertMessage(self, double time, object msg): # <<<<<<<<<<<<<<
7100 * """
7101 * insert a python object as a message at a time during the
7102 */
7103
7104 /* function exit code */
7105 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7106 goto __pyx_L0;
7107 __pyx_L1_error:;
7108 __Pyx_XDECREF(__pyx_t_1);
7109 __Pyx_XDECREF(__pyx_t_2);
7110 __Pyx_XDECREF(__pyx_t_3);
7111 __Pyx_XDECREF(__pyx_t_4);
7112 __Pyx_XDECREF(__pyx_t_5);
7113 __Pyx_XDECREF(__pyx_t_7);
7114 __Pyx_AddTraceback("pymusic.MessageOutputPort.insertMessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7115 __pyx_r = NULL;
7116 __pyx_L0:;
7117 __Pyx_XDECREF(__pyx_v_pmsg);
7118 __Pyx_XGIVEREF(__pyx_r);
7119 __Pyx_RefNannyFinishContext();
7120 return __pyx_r;
7121 }
7122
7123 /* "(tree fragment)":1
7124 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7125 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7126 * def __setstate_cython__(self, __pyx_state):
7127 */
7128
7129 /* Python wrapper */
7130 static PyObject *__pyx_pw_7pymusic_17MessageOutputPort_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7131 static PyObject *__pyx_pw_7pymusic_17MessageOutputPort_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7132 PyObject *__pyx_r = 0;
7133 __Pyx_RefNannyDeclarations
7134 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7135 __pyx_r = __pyx_pf_7pymusic_17MessageOutputPort_4__reduce_cython__(((struct __pyx_obj_7pymusic_MessageOutputPort *)__pyx_v_self));
7136
7137 /* function exit code */
7138 __Pyx_RefNannyFinishContext();
7139 return __pyx_r;
7140 }
7141
7142 static PyObject *__pyx_pf_7pymusic_17MessageOutputPort_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_self) {
7143 PyObject *__pyx_r = NULL;
7144 __Pyx_RefNannyDeclarations
7145 PyObject *__pyx_t_1 = NULL;
7146 int __pyx_lineno = 0;
7147 const char *__pyx_filename = NULL;
7148 int __pyx_clineno = 0;
7149 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7150
7151 /* "(tree fragment)":2
7152 * def __reduce_cython__(self):
7153 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7154 * def __setstate_cython__(self, __pyx_state):
7155 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7156 */
7157 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
7158 __Pyx_GOTREF(__pyx_t_1);
7159 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7160 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7161 __PYX_ERR(1, 2, __pyx_L1_error)
7162
7163 /* "(tree fragment)":1
7164 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7165 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7166 * def __setstate_cython__(self, __pyx_state):
7167 */
7168
7169 /* function exit code */
7170 __pyx_L1_error:;
7171 __Pyx_XDECREF(__pyx_t_1);
7172 __Pyx_AddTraceback("pymusic.MessageOutputPort.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7173 __pyx_r = NULL;
7174 __Pyx_XGIVEREF(__pyx_r);
7175 __Pyx_RefNannyFinishContext();
7176 return __pyx_r;
7177 }
7178
7179 /* "(tree fragment)":3
7180 * def __reduce_cython__(self):
7181 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7182 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7183 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7184 */
7185
7186 /* Python wrapper */
7187 static PyObject *__pyx_pw_7pymusic_17MessageOutputPort_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7188 static PyObject *__pyx_pw_7pymusic_17MessageOutputPort_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7189 PyObject *__pyx_r = 0;
7190 __Pyx_RefNannyDeclarations
7191 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7192 __pyx_r = __pyx_pf_7pymusic_17MessageOutputPort_6__setstate_cython__(((struct __pyx_obj_7pymusic_MessageOutputPort *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7193
7194 /* function exit code */
7195 __Pyx_RefNannyFinishContext();
7196 return __pyx_r;
7197 }
7198
7199 static PyObject *__pyx_pf_7pymusic_17MessageOutputPort_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7200 PyObject *__pyx_r = NULL;
7201 __Pyx_RefNannyDeclarations
7202 PyObject *__pyx_t_1 = NULL;
7203 int __pyx_lineno = 0;
7204 const char *__pyx_filename = NULL;
7205 int __pyx_clineno = 0;
7206 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7207
7208 /* "(tree fragment)":4
7209 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7210 * def __setstate_cython__(self, __pyx_state):
7211 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7212 */
7213 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
7214 __Pyx_GOTREF(__pyx_t_1);
7215 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7216 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7217 __PYX_ERR(1, 4, __pyx_L1_error)
7218
7219 /* "(tree fragment)":3
7220 * def __reduce_cython__(self):
7221 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7222 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7223 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7224 */
7225
7226 /* function exit code */
7227 __pyx_L1_error:;
7228 __Pyx_XDECREF(__pyx_t_1);
7229 __Pyx_AddTraceback("pymusic.MessageOutputPort.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7230 __pyx_r = NULL;
7231 __Pyx_XGIVEREF(__pyx_r);
7232 __Pyx_RefNannyFinishContext();
7233 return __pyx_r;
7234 }
7235
7236 /* "pymusic.pyx":357
7237 * """
7238 *
7239 * def __cinit__(self, list argv=None, required=None): # <<<<<<<<<<<<<<
7240 * """
7241 * Takes the command line arguments and the required threading
7242 */
7243
7244 /* Python wrapper */
7245 static int __pyx_pw_7pymusic_5Setup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7246 static int __pyx_pw_7pymusic_5Setup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7247 PyObject *__pyx_v_argv = 0;
7248 PyObject *__pyx_v_required = 0;
7249 int __pyx_lineno = 0;
7250 const char *__pyx_filename = NULL;
7251 int __pyx_clineno = 0;
7252 int __pyx_r;
7253 __Pyx_RefNannyDeclarations
7254 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7255 {
7256 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_argv,&__pyx_n_s_required,0};
7257 PyObject* values[2] = {0,0};
7258 values[0] = ((PyObject*)Py_None);
7259 values[1] = ((PyObject *)Py_None);
7260 if (unlikely(__pyx_kwds)) {
7261 Py_ssize_t kw_args;
7262 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7263 switch (pos_args) {
7264 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7265 CYTHON_FALLTHROUGH;
7266 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7267 CYTHON_FALLTHROUGH;
7268 case 0: break;
7269 default: goto __pyx_L5_argtuple_error;
7270 }
7271 kw_args = PyDict_Size(__pyx_kwds);
7272 switch (pos_args) {
7273 case 0:
7274 if (kw_args > 0) {
7275 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_argv);
7276 if (value) { values[0] = value; kw_args--; }
7277 }
7278 CYTHON_FALLTHROUGH;
7279 case 1:
7280 if (kw_args > 0) {
7281 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_required);
7282 if (value) { values[1] = value; kw_args--; }
7283 }
7284 }
7285 if (unlikely(kw_args > 0)) {
7286 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 357, __pyx_L3_error)
7287 }
7288 } else {
7289 switch (PyTuple_GET_SIZE(__pyx_args)) {
7290 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7291 CYTHON_FALLTHROUGH;
7292 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7293 CYTHON_FALLTHROUGH;
7294 case 0: break;
7295 default: goto __pyx_L5_argtuple_error;
7296 }
7297 }
7298 __pyx_v_argv = ((PyObject*)values[0]);
7299 __pyx_v_required = values[1];
7300 }
7301 goto __pyx_L4_argument_unpacking_done;
7302 __pyx_L5_argtuple_error:;
7303 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 357, __pyx_L3_error)
7304 __pyx_L3_error:;
7305 __Pyx_AddTraceback("pymusic.Setup.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7306 __Pyx_RefNannyFinishContext();
7307 return -1;
7308 __pyx_L4_argument_unpacking_done:;
7309 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_argv), (&PyList_Type), 1, "argv", 1))) __PYX_ERR(0, 357, __pyx_L1_error)
7310 __pyx_r = __pyx_pf_7pymusic_5Setup___cinit__(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), __pyx_v_argv, __pyx_v_required);
7311
7312 /* function exit code */
7313 goto __pyx_L0;
7314 __pyx_L1_error:;
7315 __pyx_r = -1;
7316 __pyx_L0:;
7317 __Pyx_RefNannyFinishContext();
7318 return __pyx_r;
7319 }
7320
7321 static int __pyx_pf_7pymusic_5Setup___cinit__(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, PyObject *__pyx_v_argv, PyObject *__pyx_v_required) {
7322 int __pyx_v_provided;
7323 __pyx_t_7pymusic_Args __pyx_v_r;
7324 struct PyMPIIntracommObject *__pyx_v_comm = 0;
7325 int __pyx_v_i;
7326 int __pyx_r;
7327 __Pyx_RefNannyDeclarations
7328 PyObject *__pyx_t_1 = NULL;
7329 int __pyx_t_2;
7330 PyObject *__pyx_t_3 = NULL;
7331 PyObject *__pyx_t_4 = NULL;
7332 int __pyx_t_5;
7333 MUSIC::Setup *__pyx_t_6;
7334 int __pyx_t_7;
7335 int __pyx_t_8;
7336 int __pyx_t_9;
7337 char const *__pyx_t_10;
7338 PyObject *__pyx_t_11 = NULL;
7339 PyObject *__pyx_t_12 = NULL;
7340 PyObject *__pyx_t_13 = NULL;
7341 PyObject *__pyx_t_14 = NULL;
7342 PyObject *__pyx_t_15 = NULL;
7343 PyObject *__pyx_t_16 = NULL;
7344 int __pyx_lineno = 0;
7345 const char *__pyx_filename = NULL;
7346 int __pyx_clineno = 0;
7347 __Pyx_RefNannySetupContext("__cinit__", 0);
7348
7349 /* "pymusic.pyx":372
7350 * cdef int provided
7351 *
7352 * cdef Args r = argv_toc(argv if argv is not None # <<<<<<<<<<<<<<
7353 * else sys.argv)
7354 * try:
7355 */
7356 __pyx_t_2 = (__pyx_v_argv != ((PyObject*)Py_None));
7357 if ((__pyx_t_2 != 0)) {
7358 __Pyx_INCREF(__pyx_v_argv);
7359 __pyx_t_1 = __pyx_v_argv;
7360 } else {
7361
7362 /* "pymusic.pyx":373
7363 *
7364 * cdef Args r = argv_toc(argv if argv is not None
7365 * else sys.argv) # <<<<<<<<<<<<<<
7366 * try:
7367 * if required is None:
7368 */
7369 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error)
7370 __Pyx_GOTREF(__pyx_t_3);
7371 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error)
7372 __Pyx_GOTREF(__pyx_t_4);
7373 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7374 if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 373, __pyx_L1_error)
7375 __pyx_t_1 = __pyx_t_4;
7376 __pyx_t_4 = 0;
7377 }
7378
7379 /* "pymusic.pyx":372
7380 * cdef int provided
7381 *
7382 * cdef Args r = argv_toc(argv if argv is not None # <<<<<<<<<<<<<<
7383 * else sys.argv)
7384 * try:
7385 */
7386 __pyx_v_r = __pyx_f_7pymusic_argv_toc(((PyObject*)__pyx_t_1));
7387 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7388
7389 /* "pymusic.pyx":374
7390 * cdef Args r = argv_toc(argv if argv is not None
7391 * else sys.argv)
7392 * try: # <<<<<<<<<<<<<<
7393 * if required is None:
7394 * self.ptr = new CSetup(r.argc, r.argv)
7395 */
7396 /*try:*/ {
7397
7398 /* "pymusic.pyx":375
7399 * else sys.argv)
7400 * try:
7401 * if required is None: # <<<<<<<<<<<<<<
7402 * self.ptr = new CSetup(r.argc, r.argv)
7403 * self.provided = MPI_THREAD_SINGLE
7404 */
7405 __pyx_t_2 = (__pyx_v_required == Py_None);
7406 __pyx_t_5 = (__pyx_t_2 != 0);
7407 if (__pyx_t_5) {
7408
7409 /* "pymusic.pyx":376
7410 * try:
7411 * if required is None:
7412 * self.ptr = new CSetup(r.argc, r.argv) # <<<<<<<<<<<<<<
7413 * self.provided = MPI_THREAD_SINGLE
7414 * else:
7415 */
7416 try {
7417 __pyx_t_6 = new MUSIC::Setup(__pyx_v_r.argc, __pyx_v_r.argv);
7418 } catch(...) {
7419 __Pyx_CppExn2PyErr();
7420 __PYX_ERR(0, 376, __pyx_L4_error)
7421 }
7422 __pyx_v_self->ptr = __pyx_t_6;
7423
7424 /* "pymusic.pyx":377
7425 * if required is None:
7426 * self.ptr = new CSetup(r.argc, r.argv)
7427 * self.provided = MPI_THREAD_SINGLE # <<<<<<<<<<<<<<
7428 * else:
7429 * self.ptr = new CSetup(r.argc, r.argv, required, &provided)
7430 */
7431 __pyx_v_self->provided = MPI_THREAD_SINGLE;
7432
7433 /* "pymusic.pyx":375
7434 * else sys.argv)
7435 * try:
7436 * if required is None: # <<<<<<<<<<<<<<
7437 * self.ptr = new CSetup(r.argc, r.argv)
7438 * self.provided = MPI_THREAD_SINGLE
7439 */
7440 goto __pyx_L6;
7441 }
7442
7443 /* "pymusic.pyx":379
7444 * self.provided = MPI_THREAD_SINGLE
7445 * else:
7446 * self.ptr = new CSetup(r.argc, r.argv, required, &provided) # <<<<<<<<<<<<<<
7447 * self.provided = provided
7448 * self.argv = [r.argv[i] for i in xrange(r.argc)]
7449 */
7450 /*else*/ {
7451 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_required); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L4_error)
7452 try {
7453 __pyx_t_6 = new MUSIC::Setup(__pyx_v_r.argc, __pyx_v_r.argv, __pyx_t_7, (&__pyx_v_provided));
7454 } catch(...) {
7455 __Pyx_CppExn2PyErr();
7456 __PYX_ERR(0, 379, __pyx_L4_error)
7457 }
7458 __pyx_v_self->ptr = __pyx_t_6;
7459
7460 /* "pymusic.pyx":380
7461 * else:
7462 * self.ptr = new CSetup(r.argc, r.argv, required, &provided)
7463 * self.provided = provided # <<<<<<<<<<<<<<
7464 * self.argv = [r.argv[i] for i in xrange(r.argc)]
7465 * finally:
7466 */
7467 __pyx_v_self->provided = __pyx_v_provided;
7468 }
7469 __pyx_L6:;
7470
7471 /* "pymusic.pyx":381
7472 * self.ptr = new CSetup(r.argc, r.argv, required, &provided)
7473 * self.provided = provided
7474 * self.argv = [r.argv[i] for i in xrange(r.argc)] # <<<<<<<<<<<<<<
7475 * finally:
7476 * free(r.argv)
7477 */
7478 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L4_error)
7479 __Pyx_GOTREF(__pyx_t_1);
7480 __pyx_t_7 = __pyx_v_r.argc;
7481 __pyx_t_8 = __pyx_t_7;
7482 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
7483 __pyx_v_i = __pyx_t_9;
7484 __pyx_t_4 = __Pyx_PyBytes_FromString((__pyx_v_r.argv[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L4_error)
7485 __Pyx_GOTREF(__pyx_t_4);
7486 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 381, __pyx_L4_error)
7487 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7488 }
7489 __Pyx_GIVEREF(__pyx_t_1);
7490 __Pyx_GOTREF(__pyx_v_self->argv);
7491 __Pyx_DECREF(__pyx_v_self->argv);
7492 __pyx_v_self->argv = ((PyObject*)__pyx_t_1);
7493 __pyx_t_1 = 0;
7494 }
7495
7496 /* "pymusic.pyx":383
7497 * self.argv = [r.argv[i] for i in xrange(r.argc)]
7498 * finally:
7499 * free(r.argv) # <<<<<<<<<<<<<<
7500 *
7501 * cdef MPI.Intracomm comm = MPI.Intracomm()
7502 */
7503 /*finally:*/ {
7504 /*normal exit:*/{
7505 free(__pyx_v_r.argv);
7506 goto __pyx_L5;
7507 }
7508 __pyx_L4_error:;
7509 /*exception exit:*/{
7510 __Pyx_PyThreadState_declare
7511 __Pyx_PyThreadState_assign
7512 __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
7513 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7514 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7515 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7516 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
7517 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
7518 __Pyx_XGOTREF(__pyx_t_11);
7519 __Pyx_XGOTREF(__pyx_t_12);
7520 __Pyx_XGOTREF(__pyx_t_13);
7521 __Pyx_XGOTREF(__pyx_t_14);
7522 __Pyx_XGOTREF(__pyx_t_15);
7523 __Pyx_XGOTREF(__pyx_t_16);
7524 __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
7525 {
7526 free(__pyx_v_r.argv);
7527 }
7528 if (PY_MAJOR_VERSION >= 3) {
7529 __Pyx_XGIVEREF(__pyx_t_14);
7530 __Pyx_XGIVEREF(__pyx_t_15);
7531 __Pyx_XGIVEREF(__pyx_t_16);
7532 __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
7533 }
7534 __Pyx_XGIVEREF(__pyx_t_11);
7535 __Pyx_XGIVEREF(__pyx_t_12);
7536 __Pyx_XGIVEREF(__pyx_t_13);
7537 __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
7538 __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
7539 __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_10;
7540 goto __pyx_L1_error;
7541 }
7542 __pyx_L5:;
7543 }
7544
7545 /* "pymusic.pyx":385
7546 * free(r.argv)
7547 *
7548 * cdef MPI.Intracomm comm = MPI.Intracomm() # <<<<<<<<<<<<<<
7549 * comm.ob_mpi = communicator(self.ptr)
7550 * self.comm = comm
7551 */
7552 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6mpi4py_3MPI_Intracomm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
7553 __Pyx_GOTREF(__pyx_t_1);
7554 __pyx_v_comm = ((struct PyMPIIntracommObject *)__pyx_t_1);
7555 __pyx_t_1 = 0;
7556
7557 /* "pymusic.pyx":386
7558 *
7559 * cdef MPI.Intracomm comm = MPI.Intracomm()
7560 * comm.ob_mpi = communicator(self.ptr) # <<<<<<<<<<<<<<
7561 * self.comm = comm
7562 *
7563 */
7564 __pyx_v_comm->__pyx_base.ob_mpi = MUSIC::communicator(__pyx_v_self->ptr);
7565
7566 /* "pymusic.pyx":387
7567 * cdef MPI.Intracomm comm = MPI.Intracomm()
7568 * comm.ob_mpi = communicator(self.ptr)
7569 * self.comm = comm # <<<<<<<<<<<<<<
7570 *
7571 * self.ports = set()
7572 */
7573 __Pyx_INCREF(((PyObject *)__pyx_v_comm));
7574 __Pyx_GIVEREF(((PyObject *)__pyx_v_comm));
7575 __Pyx_GOTREF(__pyx_v_self->comm);
7576 __Pyx_DECREF(((PyObject *)__pyx_v_self->comm));
7577 __pyx_v_self->comm = __pyx_v_comm;
7578
7579 /* "pymusic.pyx":389
7580 * self.comm = comm
7581 *
7582 * self.ports = set() # <<<<<<<<<<<<<<
7583 *
7584 * def __dealloc__(self):
7585 */
7586 __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
7587 __Pyx_GOTREF(__pyx_t_1);
7588 __Pyx_GIVEREF(__pyx_t_1);
7589 __Pyx_GOTREF(__pyx_v_self->ports);
7590 __Pyx_DECREF(__pyx_v_self->ports);
7591 __pyx_v_self->ports = ((PyObject*)__pyx_t_1);
7592 __pyx_t_1 = 0;
7593
7594 /* "pymusic.pyx":357
7595 * """
7596 *
7597 * def __cinit__(self, list argv=None, required=None): # <<<<<<<<<<<<<<
7598 * """
7599 * Takes the command line arguments and the required threading
7600 */
7601
7602 /* function exit code */
7603 __pyx_r = 0;
7604 goto __pyx_L0;
7605 __pyx_L1_error:;
7606 __Pyx_XDECREF(__pyx_t_1);
7607 __Pyx_XDECREF(__pyx_t_3);
7608 __Pyx_XDECREF(__pyx_t_4);
7609 __Pyx_AddTraceback("pymusic.Setup.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7610 __pyx_r = -1;
7611 __pyx_L0:;
7612 __Pyx_XDECREF((PyObject *)__pyx_v_comm);
7613 __Pyx_RefNannyFinishContext();
7614 return __pyx_r;
7615 }
7616
7617 /* "pymusic.pyx":391
7618 * self.ports = set()
7619 *
7620 * def __dealloc__(self): # <<<<<<<<<<<<<<
7621 * """
7622 * If runtime has been made and setup is invalid, do nothing.
7623 */
7624
7625 /* Python wrapper */
7626 static void __pyx_pw_7pymusic_5Setup_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
7627 static void __pyx_pw_7pymusic_5Setup_3__dealloc__(PyObject *__pyx_v_self) {
7628 __Pyx_RefNannyDeclarations
7629 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7630 __pyx_pf_7pymusic_5Setup_2__dealloc__(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self));
7631
7632 /* function exit code */
7633 __Pyx_RefNannyFinishContext();
7634 }
7635
7636 static void __pyx_pf_7pymusic_5Setup_2__dealloc__(struct __pyx_obj_7pymusic_Setup *__pyx_v_self) {
7637 PyObject *__pyx_v_p = NULL;
7638 __Pyx_RefNannyDeclarations
7639 int __pyx_t_1;
7640 PyObject *__pyx_t_2 = NULL;
7641 Py_ssize_t __pyx_t_3;
7642 Py_ssize_t __pyx_t_4;
7643 int __pyx_t_5;
7644 PyObject *__pyx_t_6 = NULL;
7645 int __pyx_t_7;
7646 PyObject *__pyx_t_8 = NULL;
7647 PyObject *__pyx_t_9 = NULL;
7648 int __pyx_lineno = 0;
7649 const char *__pyx_filename = NULL;
7650 int __pyx_clineno = 0;
7651 __Pyx_RefNannySetupContext("__dealloc__", 0);
7652
7653 /* "pymusic.pyx":397
7654 * """
7655 *
7656 * if self.ptr is NULL: # <<<<<<<<<<<<<<
7657 * return
7658 *
7659 */
7660 __pyx_t_1 = ((__pyx_v_self->ptr == NULL) != 0);
7661 if (__pyx_t_1) {
7662
7663 /* "pymusic.pyx":398
7664 *
7665 * if self.ptr is NULL:
7666 * return # <<<<<<<<<<<<<<
7667 *
7668 * del self.ptr
7669 */
7670 goto __pyx_L0;
7671
7672 /* "pymusic.pyx":397
7673 * """
7674 *
7675 * if self.ptr is NULL: # <<<<<<<<<<<<<<
7676 * return
7677 *
7678 */
7679 }
7680
7681 /* "pymusic.pyx":400
7682 * return
7683 *
7684 * del self.ptr # <<<<<<<<<<<<<<
7685 * for p in self.ports:
7686 * del p.ptr
7687 */
7688 delete __pyx_v_self->ptr;
7689
7690 /* "pymusic.pyx":401
7691 *
7692 * del self.ptr
7693 * for p in self.ports: # <<<<<<<<<<<<<<
7694 * del p.ptr
7695 * p.null()
7696 */
7697 __pyx_t_3 = 0;
7698 __pyx_t_6 = __Pyx_set_iterator(__pyx_v_self->ports, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
7699 __Pyx_GOTREF(__pyx_t_6);
7700 __Pyx_XDECREF(__pyx_t_2);
7701 __pyx_t_2 = __pyx_t_6;
7702 __pyx_t_6 = 0;
7703 while (1) {
7704 __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, __pyx_t_5);
7705 if (unlikely(__pyx_t_7 == 0)) break;
7706 if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 401, __pyx_L1_error)
7707 __Pyx_GOTREF(__pyx_t_6);
7708 __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_6);
7709 __pyx_t_6 = 0;
7710
7711 /* "pymusic.pyx":402
7712 * del self.ptr
7713 * for p in self.ports:
7714 * del p.ptr # <<<<<<<<<<<<<<
7715 * p.null()
7716 * self.null()
7717 */
7718 if (__Pyx_PyObject_DelAttrStr(__pyx_v_p, __pyx_n_s_ptr) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
7719
7720 /* "pymusic.pyx":403
7721 * for p in self.ports:
7722 * del p.ptr
7723 * p.null() # <<<<<<<<<<<<<<
7724 * self.null()
7725 *
7726 */
7727 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_null); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 403, __pyx_L1_error)
7728 __Pyx_GOTREF(__pyx_t_8);
7729 __pyx_t_9 = NULL;
7730 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
7731 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
7732 if (likely(__pyx_t_9)) {
7733 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
7734 __Pyx_INCREF(__pyx_t_9);
7735 __Pyx_INCREF(function);
7736 __Pyx_DECREF_SET(__pyx_t_8, function);
7737 }
7738 }
7739 __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
7740 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7741 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
7742 __Pyx_GOTREF(__pyx_t_6);
7743 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7744 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7745 }
7746 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7747
7748 /* "pymusic.pyx":404
7749 * del p.ptr
7750 * p.null()
7751 * self.null() # <<<<<<<<<<<<<<
7752 *
7753 * cpdef MPI.Intracomm getcomm(self):
7754 */
7755 __pyx_t_2 = ((struct __pyx_vtabstruct_7pymusic_Setup *)__pyx_v_self->__pyx_vtab)->null(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
7756 __Pyx_GOTREF(__pyx_t_2);
7757 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7758
7759 /* "pymusic.pyx":391
7760 * self.ports = set()
7761 *
7762 * def __dealloc__(self): # <<<<<<<<<<<<<<
7763 * """
7764 * If runtime has been made and setup is invalid, do nothing.
7765 */
7766
7767 /* function exit code */
7768 goto __pyx_L0;
7769 __pyx_L1_error:;
7770 __Pyx_XDECREF(__pyx_t_2);
7771 __Pyx_XDECREF(__pyx_t_6);
7772 __Pyx_XDECREF(__pyx_t_8);
7773 __Pyx_XDECREF(__pyx_t_9);
7774 __Pyx_WriteUnraisable("pymusic.Setup.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7775 __pyx_L0:;
7776 __Pyx_XDECREF(__pyx_v_p);
7777 __Pyx_RefNannyFinishContext();
7778 }
7779
7780 /* "pymusic.pyx":406
7781 * self.null()
7782 *
7783 * cpdef MPI.Intracomm getcomm(self): # <<<<<<<<<<<<<<
7784 * """
7785 * Get an MPI communicator between the processes on this current
7786 */
7787
7788 static PyObject *__pyx_pw_7pymusic_5Setup_5getcomm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7789 static struct PyMPIIntracommObject *__pyx_f_7pymusic_5Setup_getcomm(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, int __pyx_skip_dispatch) {
7790 struct PyMPIIntracommObject *__pyx_r = NULL;
7791 __Pyx_RefNannyDeclarations
7792 PyObject *__pyx_t_1 = NULL;
7793 PyObject *__pyx_t_2 = NULL;
7794 PyObject *__pyx_t_3 = NULL;
7795 PyObject *__pyx_t_4 = NULL;
7796 int __pyx_lineno = 0;
7797 const char *__pyx_filename = NULL;
7798 int __pyx_clineno = 0;
7799 __Pyx_RefNannySetupContext("getcomm", 0);
7800 /* Check if called by wrapper */
7801 if (unlikely(__pyx_skip_dispatch)) ;
7802 /* Check if overridden in Python */
7803 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
7804 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7805 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7806 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
7807 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7808 #endif
7809 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getcomm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
7810 __Pyx_GOTREF(__pyx_t_1);
7811 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pymusic_5Setup_5getcomm)) {
7812 __Pyx_XDECREF(((PyObject *)__pyx_r));
7813 __Pyx_INCREF(__pyx_t_1);
7814 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
7815 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7816 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
7817 if (likely(__pyx_t_4)) {
7818 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7819 __Pyx_INCREF(__pyx_t_4);
7820 __Pyx_INCREF(function);
7821 __Pyx_DECREF_SET(__pyx_t_3, function);
7822 }
7823 }
7824 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
7825 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7826 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
7827 __Pyx_GOTREF(__pyx_t_2);
7828 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7829 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mpi4py_3MPI_Intracomm))))) __PYX_ERR(0, 406, __pyx_L1_error)
7830 __pyx_r = ((struct PyMPIIntracommObject *)__pyx_t_2);
7831 __pyx_t_2 = 0;
7832 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7833 goto __pyx_L0;
7834 }
7835 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7836 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7837 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
7838 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
7839 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7840 }
7841 #endif
7842 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7843 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7844 }
7845 #endif
7846 }
7847
7848 /* "pymusic.pyx":411
7849 * side of music
7850 * """
7851 * return self.comm # <<<<<<<<<<<<<<
7852 *
7853 * cdef null(self):
7854 */
7855 __Pyx_XDECREF(((PyObject *)__pyx_r));
7856 __Pyx_INCREF(((PyObject *)__pyx_v_self->comm));
7857 __pyx_r = __pyx_v_self->comm;
7858 goto __pyx_L0;
7859
7860 /* "pymusic.pyx":406
7861 * self.null()
7862 *
7863 * cpdef MPI.Intracomm getcomm(self): # <<<<<<<<<<<<<<
7864 * """
7865 * Get an MPI communicator between the processes on this current
7866 */
7867
7868 /* function exit code */
7869 __pyx_L1_error:;
7870 __Pyx_XDECREF(__pyx_t_1);
7871 __Pyx_XDECREF(__pyx_t_2);
7872 __Pyx_XDECREF(__pyx_t_3);
7873 __Pyx_XDECREF(__pyx_t_4);
7874 __Pyx_AddTraceback("pymusic.Setup.getcomm", __pyx_clineno, __pyx_lineno, __pyx_filename);
7875 __pyx_r = 0;
7876 __pyx_L0:;
7877 __Pyx_XGIVEREF((PyObject *)__pyx_r);
7878 __Pyx_RefNannyFinishContext();
7879 return __pyx_r;
7880 }
7881
7882 /* Python wrapper */
7883 static PyObject *__pyx_pw_7pymusic_5Setup_5getcomm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7884 static char __pyx_doc_7pymusic_5Setup_4getcomm[] = "\n Get an MPI communicator between the processes on this current\n side of music\n ";
7885 static PyObject *__pyx_pw_7pymusic_5Setup_5getcomm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7886 PyObject *__pyx_r = 0;
7887 __Pyx_RefNannyDeclarations
7888 __Pyx_RefNannySetupContext("getcomm (wrapper)", 0);
7889 __pyx_r = __pyx_pf_7pymusic_5Setup_4getcomm(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self));
7890
7891 /* function exit code */
7892 __Pyx_RefNannyFinishContext();
7893 return __pyx_r;
7894 }
7895
7896 static PyObject *__pyx_pf_7pymusic_5Setup_4getcomm(struct __pyx_obj_7pymusic_Setup *__pyx_v_self) {
7897 PyObject *__pyx_r = NULL;
7898 __Pyx_RefNannyDeclarations
7899 PyObject *__pyx_t_1 = NULL;
7900 int __pyx_lineno = 0;
7901 const char *__pyx_filename = NULL;
7902 int __pyx_clineno = 0;
7903 __Pyx_RefNannySetupContext("getcomm", 0);
7904 __Pyx_XDECREF(__pyx_r);
7905 __pyx_t_1 = ((PyObject *)__pyx_f_7pymusic_5Setup_getcomm(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
7906 __Pyx_GOTREF(__pyx_t_1);
7907 __pyx_r = __pyx_t_1;
7908 __pyx_t_1 = 0;
7909 goto __pyx_L0;
7910
7911 /* function exit code */
7912 __pyx_L1_error:;
7913 __Pyx_XDECREF(__pyx_t_1);
7914 __Pyx_AddTraceback("pymusic.Setup.getcomm", __pyx_clineno, __pyx_lineno, __pyx_filename);
7915 __pyx_r = NULL;
7916 __pyx_L0:;
7917 __Pyx_XGIVEREF(__pyx_r);
7918 __Pyx_RefNannyFinishContext();
7919 return __pyx_r;
7920 }
7921
7922 /* "pymusic.pyx":413
7923 * return self.comm
7924 *
7925 * cdef null(self): # <<<<<<<<<<<<<<
7926 * """
7927 * Invalidate this object --- called when runtime is
7928 */
7929
7930 static PyObject *__pyx_f_7pymusic_5Setup_null(struct __pyx_obj_7pymusic_Setup *__pyx_v_self) {
7931 PyObject *__pyx_r = NULL;
7932 __Pyx_RefNannyDeclarations
7933 PyObject *__pyx_t_1 = NULL;
7934 PyObject *__pyx_t_2 = NULL;
7935 int __pyx_lineno = 0;
7936 const char *__pyx_filename = NULL;
7937 int __pyx_clineno = 0;
7938 __Pyx_RefNannySetupContext("null", 0);
7939
7940 /* "pymusic.pyx":419
7941 * objects and clearing references to them.
7942 * """
7943 * self.ptr = NULL # <<<<<<<<<<<<<<
7944 * self.comm = <MPI.Intracomm> MPI.COMM_NULL
7945 * self.ports = None
7946 */
7947 __pyx_v_self->ptr = NULL;
7948
7949 /* "pymusic.pyx":420
7950 * """
7951 * self.ptr = NULL
7952 * self.comm = <MPI.Intracomm> MPI.COMM_NULL # <<<<<<<<<<<<<<
7953 * self.ports = None
7954 *
7955 */
7956 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
7957 __Pyx_GOTREF(__pyx_t_1);
7958 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_COMM_NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
7959 __Pyx_GOTREF(__pyx_t_2);
7960 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7961 __pyx_t_1 = __pyx_t_2;
7962 __Pyx_INCREF(__pyx_t_1);
7963 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7964 __Pyx_GIVEREF(__pyx_t_1);
7965 __Pyx_GOTREF(__pyx_v_self->comm);
7966 __Pyx_DECREF(((PyObject *)__pyx_v_self->comm));
7967 __pyx_v_self->comm = ((struct PyMPIIntracommObject *)__pyx_t_1);
7968 __pyx_t_1 = 0;
7969
7970 /* "pymusic.pyx":421
7971 * self.ptr = NULL
7972 * self.comm = <MPI.Intracomm> MPI.COMM_NULL
7973 * self.ports = None # <<<<<<<<<<<<<<
7974 *
7975 * ####
7976 */
7977 __Pyx_INCREF(Py_None);
7978 __Pyx_GIVEREF(Py_None);
7979 __Pyx_GOTREF(__pyx_v_self->ports);
7980 __Pyx_DECREF(__pyx_v_self->ports);
7981 __pyx_v_self->ports = ((PyObject*)Py_None);
7982
7983 /* "pymusic.pyx":413
7984 * return self.comm
7985 *
7986 * cdef null(self): # <<<<<<<<<<<<<<
7987 * """
7988 * Invalidate this object --- called when runtime is
7989 */
7990
7991 /* function exit code */
7992 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7993 goto __pyx_L0;
7994 __pyx_L1_error:;
7995 __Pyx_XDECREF(__pyx_t_1);
7996 __Pyx_XDECREF(__pyx_t_2);
7997 __Pyx_AddTraceback("pymusic.Setup.null", __pyx_clineno, __pyx_lineno, __pyx_filename);
7998 __pyx_r = 0;
7999 __pyx_L0:;
8000 __Pyx_XGIVEREF(__pyx_r);
8001 __Pyx_RefNannyFinishContext();
8002 return __pyx_r;
8003 }
8004
8005 /* "pymusic.pyx":424
8006 *
8007 * ####
8008 * def config(self, string var): # <<<<<<<<<<<<<<
8009 * """
8010 * Get the value for var in config file.
8011 */
8012
8013 /* Python wrapper */
8014 static PyObject *__pyx_pw_7pymusic_5Setup_7config(PyObject *__pyx_v_self, PyObject *__pyx_arg_var); /*proto*/
8015 static char __pyx_doc_7pymusic_5Setup_6config[] = "\n Get the value for var in config file.\n string var: configuration variable for current group of\n processes, including default and inherited settings.\n The value is returned as an int if it matches the patter,\n otherwise a float, otherwise a string.\n Throws UndefinedConfig error if no such variable is defined.\n ";
8016 static PyObject *__pyx_pw_7pymusic_5Setup_7config(PyObject *__pyx_v_self, PyObject *__pyx_arg_var) {
8017 std::string __pyx_v_var;
8018 int __pyx_lineno = 0;
8019 const char *__pyx_filename = NULL;
8020 int __pyx_clineno = 0;
8021 PyObject *__pyx_r = 0;
8022 __Pyx_RefNannyDeclarations
8023 __Pyx_RefNannySetupContext("config (wrapper)", 0);
8024 assert(__pyx_arg_var); {
8025 __pyx_v_var = __pyx_convert_string_from_py_std__in_string(__pyx_arg_var); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error)
8026 }
8027 goto __pyx_L4_argument_unpacking_done;
8028 __pyx_L3_error:;
8029 __Pyx_AddTraceback("pymusic.Setup.config", __pyx_clineno, __pyx_lineno, __pyx_filename);
8030 __Pyx_RefNannyFinishContext();
8031 return NULL;
8032 __pyx_L4_argument_unpacking_done:;
8033 __pyx_r = __pyx_pf_7pymusic_5Setup_6config(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((std::string)__pyx_v_var));
8034
8035 /* function exit code */
8036 __Pyx_RefNannyFinishContext();
8037 return __pyx_r;
8038 }
8039
8040 static PyObject *__pyx_pf_7pymusic_5Setup_6config(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_var) {
8041 std::string __pyx_v_vs;
8042 PyObject *__pyx_r = NULL;
8043 __Pyx_RefNannyDeclarations
8044 int __pyx_t_1;
8045 PyObject *__pyx_t_2 = NULL;
8046 PyObject *__pyx_t_3 = NULL;
8047 PyObject *__pyx_t_4 = NULL;
8048 PyObject *__pyx_t_5 = NULL;
8049 PyObject *__pyx_t_6 = NULL;
8050 PyObject *__pyx_t_7 = NULL;
8051 PyObject *__pyx_t_8 = NULL;
8052 int __pyx_t_9;
8053 int __pyx_lineno = 0;
8054 const char *__pyx_filename = NULL;
8055 int __pyx_clineno = 0;
8056 __Pyx_RefNannySetupContext("config", 0);
8057
8058 /* "pymusic.pyx":435
8059 * cdef string vs
8060 *
8061 * if not self.ptr.config(var, &vs): # <<<<<<<<<<<<<<
8062 * raise UndefinedConfig(var)
8063 *
8064 */
8065 __pyx_t_1 = ((!(__pyx_v_self->ptr->config(__pyx_v_var, (&__pyx_v_vs)) != 0)) != 0);
8066 if (unlikely(__pyx_t_1)) {
8067
8068 /* "pymusic.pyx":436
8069 *
8070 * if not self.ptr.config(var, &vs):
8071 * raise UndefinedConfig(var) # <<<<<<<<<<<<<<
8072 *
8073 * try: return int(vs)
8074 */
8075 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UndefinedConfig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error)
8076 __Pyx_GOTREF(__pyx_t_3);
8077 __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
8078 __Pyx_GOTREF(__pyx_t_4);
8079 __pyx_t_5 = NULL;
8080 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8081 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
8082 if (likely(__pyx_t_5)) {
8083 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8084 __Pyx_INCREF(__pyx_t_5);
8085 __Pyx_INCREF(function);
8086 __Pyx_DECREF_SET(__pyx_t_3, function);
8087 }
8088 }
8089 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
8090 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8091 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8092 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
8093 __Pyx_GOTREF(__pyx_t_2);
8094 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8095 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
8096 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8097 __PYX_ERR(0, 436, __pyx_L1_error)
8098
8099 /* "pymusic.pyx":435
8100 * cdef string vs
8101 *
8102 * if not self.ptr.config(var, &vs): # <<<<<<<<<<<<<<
8103 * raise UndefinedConfig(var)
8104 *
8105 */
8106 }
8107
8108 /* "pymusic.pyx":438
8109 * raise UndefinedConfig(var)
8110 *
8111 * try: return int(vs) # <<<<<<<<<<<<<<
8112 * except ValueError: pass
8113 *
8114 */
8115 {
8116 __Pyx_PyThreadState_declare
8117 __Pyx_PyThreadState_assign
8118 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
8119 __Pyx_XGOTREF(__pyx_t_6);
8120 __Pyx_XGOTREF(__pyx_t_7);
8121 __Pyx_XGOTREF(__pyx_t_8);
8122 /*try:*/ {
8123 __Pyx_XDECREF(__pyx_r);
8124 __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_vs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L4_error)
8125 __Pyx_GOTREF(__pyx_t_2);
8126 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L4_error)
8127 __Pyx_GOTREF(__pyx_t_3);
8128 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8129 __pyx_r = __pyx_t_3;
8130 __pyx_t_3 = 0;
8131 goto __pyx_L8_try_return;
8132 }
8133 __pyx_L4_error:;
8134 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8135 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8136 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8137 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8138
8139 /* "pymusic.pyx":439
8140 *
8141 * try: return int(vs)
8142 * except ValueError: pass # <<<<<<<<<<<<<<
8143 *
8144 * try: return float(vs)
8145 */
8146 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
8147 if (__pyx_t_9) {
8148 __Pyx_ErrRestore(0,0,0);
8149 goto __pyx_L5_exception_handled;
8150 }
8151 goto __pyx_L6_except_error;
8152 __pyx_L6_except_error:;
8153
8154 /* "pymusic.pyx":438
8155 * raise UndefinedConfig(var)
8156 *
8157 * try: return int(vs) # <<<<<<<<<<<<<<
8158 * except ValueError: pass
8159 *
8160 */
8161 __Pyx_XGIVEREF(__pyx_t_6);
8162 __Pyx_XGIVEREF(__pyx_t_7);
8163 __Pyx_XGIVEREF(__pyx_t_8);
8164 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
8165 goto __pyx_L1_error;
8166 __pyx_L8_try_return:;
8167 __Pyx_XGIVEREF(__pyx_t_6);
8168 __Pyx_XGIVEREF(__pyx_t_7);
8169 __Pyx_XGIVEREF(__pyx_t_8);
8170 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
8171 goto __pyx_L0;
8172 __pyx_L5_exception_handled:;
8173 __Pyx_XGIVEREF(__pyx_t_6);
8174 __Pyx_XGIVEREF(__pyx_t_7);
8175 __Pyx_XGIVEREF(__pyx_t_8);
8176 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
8177 }
8178
8179 /* "pymusic.pyx":441
8180 * except ValueError: pass
8181 *
8182 * try: return float(vs) # <<<<<<<<<<<<<<
8183 * except ValueError: pass
8184 *
8185 */
8186 {
8187 __Pyx_PyThreadState_declare
8188 __Pyx_PyThreadState_assign
8189 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
8190 __Pyx_XGOTREF(__pyx_t_8);
8191 __Pyx_XGOTREF(__pyx_t_7);
8192 __Pyx_XGOTREF(__pyx_t_6);
8193 /*try:*/ {
8194 __Pyx_XDECREF(__pyx_r);
8195 __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_vs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L10_error)
8196 __Pyx_GOTREF(__pyx_t_3);
8197 __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L10_error)
8198 __Pyx_GOTREF(__pyx_t_2);
8199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8200 __pyx_r = __pyx_t_2;
8201 __pyx_t_2 = 0;
8202 goto __pyx_L14_try_return;
8203 }
8204 __pyx_L10_error:;
8205 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8206 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8207 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8208 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8209
8210 /* "pymusic.pyx":442
8211 *
8212 * try: return float(vs)
8213 * except ValueError: pass # <<<<<<<<<<<<<<
8214 *
8215 * return vs
8216 */
8217 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
8218 if (__pyx_t_9) {
8219 __Pyx_ErrRestore(0,0,0);
8220 goto __pyx_L11_exception_handled;
8221 }
8222 goto __pyx_L12_except_error;
8223 __pyx_L12_except_error:;
8224
8225 /* "pymusic.pyx":441
8226 * except ValueError: pass
8227 *
8228 * try: return float(vs) # <<<<<<<<<<<<<<
8229 * except ValueError: pass
8230 *
8231 */
8232 __Pyx_XGIVEREF(__pyx_t_8);
8233 __Pyx_XGIVEREF(__pyx_t_7);
8234 __Pyx_XGIVEREF(__pyx_t_6);
8235 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
8236 goto __pyx_L1_error;
8237 __pyx_L14_try_return:;
8238 __Pyx_XGIVEREF(__pyx_t_8);
8239 __Pyx_XGIVEREF(__pyx_t_7);
8240 __Pyx_XGIVEREF(__pyx_t_6);
8241 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
8242 goto __pyx_L0;
8243 __pyx_L11_exception_handled:;
8244 __Pyx_XGIVEREF(__pyx_t_8);
8245 __Pyx_XGIVEREF(__pyx_t_7);
8246 __Pyx_XGIVEREF(__pyx_t_6);
8247 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
8248 }
8249
8250 /* "pymusic.pyx":444
8251 * except ValueError: pass
8252 *
8253 * return vs # <<<<<<<<<<<<<<
8254 * ####
8255 *
8256 */
8257 __Pyx_XDECREF(__pyx_r);
8258 __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_vs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
8259 __Pyx_GOTREF(__pyx_t_2);
8260 __pyx_r = __pyx_t_2;
8261 __pyx_t_2 = 0;
8262 goto __pyx_L0;
8263
8264 /* "pymusic.pyx":424
8265 *
8266 * ####
8267 * def config(self, string var): # <<<<<<<<<<<<<<
8268 * """
8269 * Get the value for var in config file.
8270 */
8271
8272 /* function exit code */
8273 __pyx_L1_error:;
8274 __Pyx_XDECREF(__pyx_t_2);
8275 __Pyx_XDECREF(__pyx_t_3);
8276 __Pyx_XDECREF(__pyx_t_4);
8277 __Pyx_XDECREF(__pyx_t_5);
8278 __Pyx_AddTraceback("pymusic.Setup.config", __pyx_clineno, __pyx_lineno, __pyx_filename);
8279 __pyx_r = NULL;
8280 __pyx_L0:;
8281 __Pyx_XGIVEREF(__pyx_r);
8282 __Pyx_RefNannyFinishContext();
8283 return __pyx_r;
8284 }
8285
8286 /* "pymusic.pyx":447
8287 * ####
8288 *
8289 * def publishContInput(self, string s): # <<<<<<<<<<<<<<
8290 * """
8291 * Continuous Floating point value sink
8292 */
8293
8294 /* Python wrapper */
8295 static PyObject *__pyx_pw_7pymusic_5Setup_9publishContInput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s); /*proto*/
8296 static char __pyx_doc_7pymusic_5Setup_8publishContInput[] = "\n Continuous Floating point value sink\n string s: port name for music config\n ";
8297 static PyObject *__pyx_pw_7pymusic_5Setup_9publishContInput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s) {
8298 std::string __pyx_v_s;
8299 int __pyx_lineno = 0;
8300 const char *__pyx_filename = NULL;
8301 int __pyx_clineno = 0;
8302 PyObject *__pyx_r = 0;
8303 __Pyx_RefNannyDeclarations
8304 __Pyx_RefNannySetupContext("publishContInput (wrapper)", 0);
8305 assert(__pyx_arg_s); {
8306 __pyx_v_s = __pyx_convert_string_from_py_std__in_string(__pyx_arg_s); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error)
8307 }
8308 goto __pyx_L4_argument_unpacking_done;
8309 __pyx_L3_error:;
8310 __Pyx_AddTraceback("pymusic.Setup.publishContInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8311 __Pyx_RefNannyFinishContext();
8312 return NULL;
8313 __pyx_L4_argument_unpacking_done:;
8314 __pyx_r = __pyx_pf_7pymusic_5Setup_8publishContInput(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((std::string)__pyx_v_s));
8315
8316 /* function exit code */
8317 __Pyx_RefNannyFinishContext();
8318 return __pyx_r;
8319 }
8320
8321 static PyObject *__pyx_pf_7pymusic_5Setup_8publishContInput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s) {
8322 struct __pyx_obj_7pymusic_ContInputPort *__pyx_v_p = 0;
8323 PyObject *__pyx_r = NULL;
8324 __Pyx_RefNannyDeclarations
8325 PyObject *__pyx_t_1 = NULL;
8326 int __pyx_t_2;
8327 int __pyx_lineno = 0;
8328 const char *__pyx_filename = NULL;
8329 int __pyx_clineno = 0;
8330 __Pyx_RefNannySetupContext("publishContInput", 0);
8331
8332 /* "pymusic.pyx":452
8333 * string s: port name for music config
8334 * """
8335 * cdef ContInputPort p = ContInputPort() # <<<<<<<<<<<<<<
8336 * p.ptr = self.ptr.publishContInput(s) # can't pass pointers directly to init
8337 * self.ports.add(p)
8338 */
8339 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pymusic_ContInputPort)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
8340 __Pyx_GOTREF(__pyx_t_1);
8341 __pyx_v_p = ((struct __pyx_obj_7pymusic_ContInputPort *)__pyx_t_1);
8342 __pyx_t_1 = 0;
8343
8344 /* "pymusic.pyx":453
8345 * """
8346 * cdef ContInputPort p = ContInputPort()
8347 * p.ptr = self.ptr.publishContInput(s) # can't pass pointers directly to init # <<<<<<<<<<<<<<
8348 * self.ports.add(p)
8349 * return p
8350 */
8351 __pyx_v_p->__pyx_base.ptr = __pyx_v_self->ptr->publishContInput(__pyx_v_s);
8352
8353 /* "pymusic.pyx":454
8354 * cdef ContInputPort p = ContInputPort()
8355 * p.ptr = self.ptr.publishContInput(s) # can't pass pointers directly to init
8356 * self.ports.add(p) # <<<<<<<<<<<<<<
8357 * return p
8358 *
8359 */
8360 if (unlikely(__pyx_v_self->ports == Py_None)) {
8361 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
8362 __PYX_ERR(0, 454, __pyx_L1_error)
8363 }
8364 __pyx_t_2 = PySet_Add(__pyx_v_self->ports, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 454, __pyx_L1_error)
8365
8366 /* "pymusic.pyx":455
8367 * p.ptr = self.ptr.publishContInput(s) # can't pass pointers directly to init
8368 * self.ports.add(p)
8369 * return p # <<<<<<<<<<<<<<
8370 *
8371 * def publishContOutput(self, string s):
8372 */
8373 __Pyx_XDECREF(__pyx_r);
8374 __Pyx_INCREF(((PyObject *)__pyx_v_p));
8375 __pyx_r = ((PyObject *)__pyx_v_p);
8376 goto __pyx_L0;
8377
8378 /* "pymusic.pyx":447
8379 * ####
8380 *
8381 * def publishContInput(self, string s): # <<<<<<<<<<<<<<
8382 * """
8383 * Continuous Floating point value sink
8384 */
8385
8386 /* function exit code */
8387 __pyx_L1_error:;
8388 __Pyx_XDECREF(__pyx_t_1);
8389 __Pyx_AddTraceback("pymusic.Setup.publishContInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8390 __pyx_r = NULL;
8391 __pyx_L0:;
8392 __Pyx_XDECREF((PyObject *)__pyx_v_p);
8393 __Pyx_XGIVEREF(__pyx_r);
8394 __Pyx_RefNannyFinishContext();
8395 return __pyx_r;
8396 }
8397
8398 /* "pymusic.pyx":457
8399 * return p
8400 *
8401 * def publishContOutput(self, string s): # <<<<<<<<<<<<<<
8402 * """
8403 * Continuous Floating point value source
8404 */
8405
8406 /* Python wrapper */
8407 static PyObject *__pyx_pw_7pymusic_5Setup_11publishContOutput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s); /*proto*/
8408 static char __pyx_doc_7pymusic_5Setup_10publishContOutput[] = "\n Continuous Floating point value source\n string s: port name for music config\n ";
8409 static PyObject *__pyx_pw_7pymusic_5Setup_11publishContOutput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s) {
8410 std::string __pyx_v_s;
8411 int __pyx_lineno = 0;
8412 const char *__pyx_filename = NULL;
8413 int __pyx_clineno = 0;
8414 PyObject *__pyx_r = 0;
8415 __Pyx_RefNannyDeclarations
8416 __Pyx_RefNannySetupContext("publishContOutput (wrapper)", 0);
8417 assert(__pyx_arg_s); {
8418 __pyx_v_s = __pyx_convert_string_from_py_std__in_string(__pyx_arg_s); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L3_error)
8419 }
8420 goto __pyx_L4_argument_unpacking_done;
8421 __pyx_L3_error:;
8422 __Pyx_AddTraceback("pymusic.Setup.publishContOutput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8423 __Pyx_RefNannyFinishContext();
8424 return NULL;
8425 __pyx_L4_argument_unpacking_done:;
8426 __pyx_r = __pyx_pf_7pymusic_5Setup_10publishContOutput(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((std::string)__pyx_v_s));
8427
8428 /* function exit code */
8429 __Pyx_RefNannyFinishContext();
8430 return __pyx_r;
8431 }
8432
8433 static PyObject *__pyx_pf_7pymusic_5Setup_10publishContOutput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s) {
8434 struct __pyx_obj_7pymusic_ContOutputPort *__pyx_v_p = 0;
8435 PyObject *__pyx_r = NULL;
8436 __Pyx_RefNannyDeclarations
8437 PyObject *__pyx_t_1 = NULL;
8438 int __pyx_t_2;
8439 int __pyx_lineno = 0;
8440 const char *__pyx_filename = NULL;
8441 int __pyx_clineno = 0;
8442 __Pyx_RefNannySetupContext("publishContOutput", 0);
8443
8444 /* "pymusic.pyx":462
8445 * string s: port name for music config
8446 * """
8447 * cdef ContOutputPort p = ContOutputPort() # <<<<<<<<<<<<<<
8448 * p.ptr = self.ptr.publishContOutput(s)
8449 * self.ports.add(p)
8450 */
8451 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pymusic_ContOutputPort)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
8452 __Pyx_GOTREF(__pyx_t_1);
8453 __pyx_v_p = ((struct __pyx_obj_7pymusic_ContOutputPort *)__pyx_t_1);
8454 __pyx_t_1 = 0;
8455
8456 /* "pymusic.pyx":463
8457 * """
8458 * cdef ContOutputPort p = ContOutputPort()
8459 * p.ptr = self.ptr.publishContOutput(s) # <<<<<<<<<<<<<<
8460 * self.ports.add(p)
8461 * return p
8462 */
8463 __pyx_v_p->__pyx_base.ptr = __pyx_v_self->ptr->publishContOutput(__pyx_v_s);
8464
8465 /* "pymusic.pyx":464
8466 * cdef ContOutputPort p = ContOutputPort()
8467 * p.ptr = self.ptr.publishContOutput(s)
8468 * self.ports.add(p) # <<<<<<<<<<<<<<
8469 * return p
8470 *
8471 */
8472 if (unlikely(__pyx_v_self->ports == Py_None)) {
8473 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
8474 __PYX_ERR(0, 464, __pyx_L1_error)
8475 }
8476 __pyx_t_2 = PySet_Add(__pyx_v_self->ports, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 464, __pyx_L1_error)
8477
8478 /* "pymusic.pyx":465
8479 * p.ptr = self.ptr.publishContOutput(s)
8480 * self.ports.add(p)
8481 * return p # <<<<<<<<<<<<<<
8482 *
8483 * def publishEventOutput(self, string s):
8484 */
8485 __Pyx_XDECREF(__pyx_r);
8486 __Pyx_INCREF(((PyObject *)__pyx_v_p));
8487 __pyx_r = ((PyObject *)__pyx_v_p);
8488 goto __pyx_L0;
8489
8490 /* "pymusic.pyx":457
8491 * return p
8492 *
8493 * def publishContOutput(self, string s): # <<<<<<<<<<<<<<
8494 * """
8495 * Continuous Floating point value source
8496 */
8497
8498 /* function exit code */
8499 __pyx_L1_error:;
8500 __Pyx_XDECREF(__pyx_t_1);
8501 __Pyx_AddTraceback("pymusic.Setup.publishContOutput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8502 __pyx_r = NULL;
8503 __pyx_L0:;
8504 __Pyx_XDECREF((PyObject *)__pyx_v_p);
8505 __Pyx_XGIVEREF(__pyx_r);
8506 __Pyx_RefNannyFinishContext();
8507 return __pyx_r;
8508 }
8509
8510 /* "pymusic.pyx":467
8511 * return p
8512 *
8513 * def publishEventOutput(self, string s): # <<<<<<<<<<<<<<
8514 * """
8515 * Discrete boolean source
8516 */
8517
8518 /* Python wrapper */
8519 static PyObject *__pyx_pw_7pymusic_5Setup_13publishEventOutput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s); /*proto*/
8520 static char __pyx_doc_7pymusic_5Setup_12publishEventOutput[] = "\n Discrete boolean source\n string s: port name for music config\n ";
8521 static PyObject *__pyx_pw_7pymusic_5Setup_13publishEventOutput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s) {
8522 std::string __pyx_v_s;
8523 int __pyx_lineno = 0;
8524 const char *__pyx_filename = NULL;
8525 int __pyx_clineno = 0;
8526 PyObject *__pyx_r = 0;
8527 __Pyx_RefNannyDeclarations
8528 __Pyx_RefNannySetupContext("publishEventOutput (wrapper)", 0);
8529 assert(__pyx_arg_s); {
8530 __pyx_v_s = __pyx_convert_string_from_py_std__in_string(__pyx_arg_s); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error)
8531 }
8532 goto __pyx_L4_argument_unpacking_done;
8533 __pyx_L3_error:;
8534 __Pyx_AddTraceback("pymusic.Setup.publishEventOutput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8535 __Pyx_RefNannyFinishContext();
8536 return NULL;
8537 __pyx_L4_argument_unpacking_done:;
8538 __pyx_r = __pyx_pf_7pymusic_5Setup_12publishEventOutput(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((std::string)__pyx_v_s));
8539
8540 /* function exit code */
8541 __Pyx_RefNannyFinishContext();
8542 return __pyx_r;
8543 }
8544
8545 static PyObject *__pyx_pf_7pymusic_5Setup_12publishEventOutput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s) {
8546 struct __pyx_obj_7pymusic_EventOutputPort *__pyx_v_p = 0;
8547 PyObject *__pyx_r = NULL;
8548 __Pyx_RefNannyDeclarations
8549 PyObject *__pyx_t_1 = NULL;
8550 int __pyx_t_2;
8551 int __pyx_lineno = 0;
8552 const char *__pyx_filename = NULL;
8553 int __pyx_clineno = 0;
8554 __Pyx_RefNannySetupContext("publishEventOutput", 0);
8555
8556 /* "pymusic.pyx":472
8557 * string s: port name for music config
8558 * """
8559 * cdef EventOutputPort p = EventOutputPort() # <<<<<<<<<<<<<<
8560 * p.ptr = self.ptr.publishEventOutput(s)
8561 * self.ports.add(p)
8562 */
8563 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pymusic_EventOutputPort)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
8564 __Pyx_GOTREF(__pyx_t_1);
8565 __pyx_v_p = ((struct __pyx_obj_7pymusic_EventOutputPort *)__pyx_t_1);
8566 __pyx_t_1 = 0;
8567
8568 /* "pymusic.pyx":473
8569 * """
8570 * cdef EventOutputPort p = EventOutputPort()
8571 * p.ptr = self.ptr.publishEventOutput(s) # <<<<<<<<<<<<<<
8572 * self.ports.add(p)
8573 * return p
8574 */
8575 __pyx_v_p->__pyx_base.ptr = __pyx_v_self->ptr->publishEventOutput(__pyx_v_s);
8576
8577 /* "pymusic.pyx":474
8578 * cdef EventOutputPort p = EventOutputPort()
8579 * p.ptr = self.ptr.publishEventOutput(s)
8580 * self.ports.add(p) # <<<<<<<<<<<<<<
8581 * return p
8582 *
8583 */
8584 if (unlikely(__pyx_v_self->ports == Py_None)) {
8585 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
8586 __PYX_ERR(0, 474, __pyx_L1_error)
8587 }
8588 __pyx_t_2 = PySet_Add(__pyx_v_self->ports, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 474, __pyx_L1_error)
8589
8590 /* "pymusic.pyx":475
8591 * p.ptr = self.ptr.publishEventOutput(s)
8592 * self.ports.add(p)
8593 * return p # <<<<<<<<<<<<<<
8594 *
8595 * def publishEventInput(self, string s):
8596 */
8597 __Pyx_XDECREF(__pyx_r);
8598 __Pyx_INCREF(((PyObject *)__pyx_v_p));
8599 __pyx_r = ((PyObject *)__pyx_v_p);
8600 goto __pyx_L0;
8601
8602 /* "pymusic.pyx":467
8603 * return p
8604 *
8605 * def publishEventOutput(self, string s): # <<<<<<<<<<<<<<
8606 * """
8607 * Discrete boolean source
8608 */
8609
8610 /* function exit code */
8611 __pyx_L1_error:;
8612 __Pyx_XDECREF(__pyx_t_1);
8613 __Pyx_AddTraceback("pymusic.Setup.publishEventOutput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8614 __pyx_r = NULL;
8615 __pyx_L0:;
8616 __Pyx_XDECREF((PyObject *)__pyx_v_p);
8617 __Pyx_XGIVEREF(__pyx_r);
8618 __Pyx_RefNannyFinishContext();
8619 return __pyx_r;
8620 }
8621
8622 /* "pymusic.pyx":477
8623 * return p
8624 *
8625 * def publishEventInput(self, string s): # <<<<<<<<<<<<<<
8626 * """
8627 * Discrete boolean sink
8628 */
8629
8630 /* Python wrapper */
8631 static PyObject *__pyx_pw_7pymusic_5Setup_15publishEventInput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s); /*proto*/
8632 static char __pyx_doc_7pymusic_5Setup_14publishEventInput[] = "\n Discrete boolean sink\n string s: port name for music config\n ";
8633 static PyObject *__pyx_pw_7pymusic_5Setup_15publishEventInput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s) {
8634 std::string __pyx_v_s;
8635 int __pyx_lineno = 0;
8636 const char *__pyx_filename = NULL;
8637 int __pyx_clineno = 0;
8638 PyObject *__pyx_r = 0;
8639 __Pyx_RefNannyDeclarations
8640 __Pyx_RefNannySetupContext("publishEventInput (wrapper)", 0);
8641 assert(__pyx_arg_s); {
8642 __pyx_v_s = __pyx_convert_string_from_py_std__in_string(__pyx_arg_s); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L3_error)
8643 }
8644 goto __pyx_L4_argument_unpacking_done;
8645 __pyx_L3_error:;
8646 __Pyx_AddTraceback("pymusic.Setup.publishEventInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8647 __Pyx_RefNannyFinishContext();
8648 return NULL;
8649 __pyx_L4_argument_unpacking_done:;
8650 __pyx_r = __pyx_pf_7pymusic_5Setup_14publishEventInput(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((std::string)__pyx_v_s));
8651
8652 /* function exit code */
8653 __Pyx_RefNannyFinishContext();
8654 return __pyx_r;
8655 }
8656
8657 static PyObject *__pyx_pf_7pymusic_5Setup_14publishEventInput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s) {
8658 struct __pyx_obj_7pymusic_EventInputPort *__pyx_v_p = 0;
8659 PyObject *__pyx_r = NULL;
8660 __Pyx_RefNannyDeclarations
8661 PyObject *__pyx_t_1 = NULL;
8662 int __pyx_t_2;
8663 int __pyx_lineno = 0;
8664 const char *__pyx_filename = NULL;
8665 int __pyx_clineno = 0;
8666 __Pyx_RefNannySetupContext("publishEventInput", 0);
8667
8668 /* "pymusic.pyx":482
8669 * string s: port name for music config
8670 * """
8671 * cdef EventInputPort p = EventInputPort() # <<<<<<<<<<<<<<
8672 * p.ptr = self.ptr.publishEventInput(s)
8673 * self.ports.add(p)
8674 */
8675 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pymusic_EventInputPort)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
8676 __Pyx_GOTREF(__pyx_t_1);
8677 __pyx_v_p = ((struct __pyx_obj_7pymusic_EventInputPort *)__pyx_t_1);
8678 __pyx_t_1 = 0;
8679
8680 /* "pymusic.pyx":483
8681 * """
8682 * cdef EventInputPort p = EventInputPort()
8683 * p.ptr = self.ptr.publishEventInput(s) # <<<<<<<<<<<<<<
8684 * self.ports.add(p)
8685 * return p
8686 */
8687 __pyx_v_p->__pyx_base.ptr = __pyx_v_self->ptr->publishEventInput(__pyx_v_s);
8688
8689 /* "pymusic.pyx":484
8690 * cdef EventInputPort p = EventInputPort()
8691 * p.ptr = self.ptr.publishEventInput(s)
8692 * self.ports.add(p) # <<<<<<<<<<<<<<
8693 * return p
8694 *
8695 */
8696 if (unlikely(__pyx_v_self->ports == Py_None)) {
8697 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
8698 __PYX_ERR(0, 484, __pyx_L1_error)
8699 }
8700 __pyx_t_2 = PySet_Add(__pyx_v_self->ports, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 484, __pyx_L1_error)
8701
8702 /* "pymusic.pyx":485
8703 * p.ptr = self.ptr.publishEventInput(s)
8704 * self.ports.add(p)
8705 * return p # <<<<<<<<<<<<<<
8706 *
8707 * def publishMessageOutput(self, string s):
8708 */
8709 __Pyx_XDECREF(__pyx_r);
8710 __Pyx_INCREF(((PyObject *)__pyx_v_p));
8711 __pyx_r = ((PyObject *)__pyx_v_p);
8712 goto __pyx_L0;
8713
8714 /* "pymusic.pyx":477
8715 * return p
8716 *
8717 * def publishEventInput(self, string s): # <<<<<<<<<<<<<<
8718 * """
8719 * Discrete boolean sink
8720 */
8721
8722 /* function exit code */
8723 __pyx_L1_error:;
8724 __Pyx_XDECREF(__pyx_t_1);
8725 __Pyx_AddTraceback("pymusic.Setup.publishEventInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8726 __pyx_r = NULL;
8727 __pyx_L0:;
8728 __Pyx_XDECREF((PyObject *)__pyx_v_p);
8729 __Pyx_XGIVEREF(__pyx_r);
8730 __Pyx_RefNannyFinishContext();
8731 return __pyx_r;
8732 }
8733
8734 /* "pymusic.pyx":487
8735 * return p
8736 *
8737 * def publishMessageOutput(self, string s): # <<<<<<<<<<<<<<
8738 * """
8739 * Discrete python object source
8740 */
8741
8742 /* Python wrapper */
8743 static PyObject *__pyx_pw_7pymusic_5Setup_17publishMessageOutput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s); /*proto*/
8744 static char __pyx_doc_7pymusic_5Setup_16publishMessageOutput[] = "\n Discrete python object source\n string s: port name for music config\n ";
8745 static PyObject *__pyx_pw_7pymusic_5Setup_17publishMessageOutput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s) {
8746 std::string __pyx_v_s;
8747 int __pyx_lineno = 0;
8748 const char *__pyx_filename = NULL;
8749 int __pyx_clineno = 0;
8750 PyObject *__pyx_r = 0;
8751 __Pyx_RefNannyDeclarations
8752 __Pyx_RefNannySetupContext("publishMessageOutput (wrapper)", 0);
8753 assert(__pyx_arg_s); {
8754 __pyx_v_s = __pyx_convert_string_from_py_std__in_string(__pyx_arg_s); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L3_error)
8755 }
8756 goto __pyx_L4_argument_unpacking_done;
8757 __pyx_L3_error:;
8758 __Pyx_AddTraceback("pymusic.Setup.publishMessageOutput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8759 __Pyx_RefNannyFinishContext();
8760 return NULL;
8761 __pyx_L4_argument_unpacking_done:;
8762 __pyx_r = __pyx_pf_7pymusic_5Setup_16publishMessageOutput(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((std::string)__pyx_v_s));
8763
8764 /* function exit code */
8765 __Pyx_RefNannyFinishContext();
8766 return __pyx_r;
8767 }
8768
8769 static PyObject *__pyx_pf_7pymusic_5Setup_16publishMessageOutput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s) {
8770 struct __pyx_obj_7pymusic_MessageOutputPort *__pyx_v_p = 0;
8771 PyObject *__pyx_r = NULL;
8772 __Pyx_RefNannyDeclarations
8773 PyObject *__pyx_t_1 = NULL;
8774 int __pyx_t_2;
8775 int __pyx_lineno = 0;
8776 const char *__pyx_filename = NULL;
8777 int __pyx_clineno = 0;
8778 __Pyx_RefNannySetupContext("publishMessageOutput", 0);
8779
8780 /* "pymusic.pyx":492
8781 * string s: port name for music config
8782 * """
8783 * cdef MessageOutputPort p = MessageOutputPort() # <<<<<<<<<<<<<<
8784 * p.ptr = self.ptr.publishMessageOutput(s)
8785 * self.ports.add(p)
8786 */
8787 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pymusic_MessageOutputPort)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
8788 __Pyx_GOTREF(__pyx_t_1);
8789 __pyx_v_p = ((struct __pyx_obj_7pymusic_MessageOutputPort *)__pyx_t_1);
8790 __pyx_t_1 = 0;
8791
8792 /* "pymusic.pyx":493
8793 * """
8794 * cdef MessageOutputPort p = MessageOutputPort()
8795 * p.ptr = self.ptr.publishMessageOutput(s) # <<<<<<<<<<<<<<
8796 * self.ports.add(p)
8797 * return p
8798 */
8799 __pyx_v_p->__pyx_base.ptr = __pyx_v_self->ptr->publishMessageOutput(__pyx_v_s);
8800
8801 /* "pymusic.pyx":494
8802 * cdef MessageOutputPort p = MessageOutputPort()
8803 * p.ptr = self.ptr.publishMessageOutput(s)
8804 * self.ports.add(p) # <<<<<<<<<<<<<<
8805 * return p
8806 *
8807 */
8808 if (unlikely(__pyx_v_self->ports == Py_None)) {
8809 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
8810 __PYX_ERR(0, 494, __pyx_L1_error)
8811 }
8812 __pyx_t_2 = PySet_Add(__pyx_v_self->ports, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 494, __pyx_L1_error)
8813
8814 /* "pymusic.pyx":495
8815 * p.ptr = self.ptr.publishMessageOutput(s)
8816 * self.ports.add(p)
8817 * return p # <<<<<<<<<<<<<<
8818 *
8819 * def publishMessageInput(self, string s):
8820 */
8821 __Pyx_XDECREF(__pyx_r);
8822 __Pyx_INCREF(((PyObject *)__pyx_v_p));
8823 __pyx_r = ((PyObject *)__pyx_v_p);
8824 goto __pyx_L0;
8825
8826 /* "pymusic.pyx":487
8827 * return p
8828 *
8829 * def publishMessageOutput(self, string s): # <<<<<<<<<<<<<<
8830 * """
8831 * Discrete python object source
8832 */
8833
8834 /* function exit code */
8835 __pyx_L1_error:;
8836 __Pyx_XDECREF(__pyx_t_1);
8837 __Pyx_AddTraceback("pymusic.Setup.publishMessageOutput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8838 __pyx_r = NULL;
8839 __pyx_L0:;
8840 __Pyx_XDECREF((PyObject *)__pyx_v_p);
8841 __Pyx_XGIVEREF(__pyx_r);
8842 __Pyx_RefNannyFinishContext();
8843 return __pyx_r;
8844 }
8845
8846 /* "pymusic.pyx":497
8847 * return p
8848 *
8849 * def publishMessageInput(self, string s): # <<<<<<<<<<<<<<
8850 * """
8851 * Discrete python object sink
8852 */
8853
8854 /* Python wrapper */
8855 static PyObject *__pyx_pw_7pymusic_5Setup_19publishMessageInput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s); /*proto*/
8856 static char __pyx_doc_7pymusic_5Setup_18publishMessageInput[] = "\n Discrete python object sink\n string s: port name for music config\n ";
8857 static PyObject *__pyx_pw_7pymusic_5Setup_19publishMessageInput(PyObject *__pyx_v_self, PyObject *__pyx_arg_s) {
8858 std::string __pyx_v_s;
8859 int __pyx_lineno = 0;
8860 const char *__pyx_filename = NULL;
8861 int __pyx_clineno = 0;
8862 PyObject *__pyx_r = 0;
8863 __Pyx_RefNannyDeclarations
8864 __Pyx_RefNannySetupContext("publishMessageInput (wrapper)", 0);
8865 assert(__pyx_arg_s); {
8866 __pyx_v_s = __pyx_convert_string_from_py_std__in_string(__pyx_arg_s); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L3_error)
8867 }
8868 goto __pyx_L4_argument_unpacking_done;
8869 __pyx_L3_error:;
8870 __Pyx_AddTraceback("pymusic.Setup.publishMessageInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8871 __Pyx_RefNannyFinishContext();
8872 return NULL;
8873 __pyx_L4_argument_unpacking_done:;
8874 __pyx_r = __pyx_pf_7pymusic_5Setup_18publishMessageInput(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((std::string)__pyx_v_s));
8875
8876 /* function exit code */
8877 __Pyx_RefNannyFinishContext();
8878 return __pyx_r;
8879 }
8880
8881 static PyObject *__pyx_pf_7pymusic_5Setup_18publishMessageInput(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, std::string __pyx_v_s) {
8882 struct __pyx_obj_7pymusic_MessageInputPort *__pyx_v_p = 0;
8883 PyObject *__pyx_r = NULL;
8884 __Pyx_RefNannyDeclarations
8885 PyObject *__pyx_t_1 = NULL;
8886 int __pyx_t_2;
8887 int __pyx_lineno = 0;
8888 const char *__pyx_filename = NULL;
8889 int __pyx_clineno = 0;
8890 __Pyx_RefNannySetupContext("publishMessageInput", 0);
8891
8892 /* "pymusic.pyx":502
8893 * string s: port name for music config
8894 * """
8895 * cdef MessageInputPort p = MessageInputPort() # <<<<<<<<<<<<<<
8896 * p.ptr = self.ptr.publishMessageInput(s)
8897 * self.ports.add(p)
8898 */
8899 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pymusic_MessageInputPort)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
8900 __Pyx_GOTREF(__pyx_t_1);
8901 __pyx_v_p = ((struct __pyx_obj_7pymusic_MessageInputPort *)__pyx_t_1);
8902 __pyx_t_1 = 0;
8903
8904 /* "pymusic.pyx":503
8905 * """
8906 * cdef MessageInputPort p = MessageInputPort()
8907 * p.ptr = self.ptr.publishMessageInput(s) # <<<<<<<<<<<<<<
8908 * self.ports.add(p)
8909 * return p
8910 */
8911 __pyx_v_p->__pyx_base.ptr = __pyx_v_self->ptr->publishMessageInput(__pyx_v_s);
8912
8913 /* "pymusic.pyx":504
8914 * cdef MessageInputPort p = MessageInputPort()
8915 * p.ptr = self.ptr.publishMessageInput(s)
8916 * self.ports.add(p) # <<<<<<<<<<<<<<
8917 * return p
8918 *
8919 */
8920 if (unlikely(__pyx_v_self->ports == Py_None)) {
8921 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
8922 __PYX_ERR(0, 504, __pyx_L1_error)
8923 }
8924 __pyx_t_2 = PySet_Add(__pyx_v_self->ports, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 504, __pyx_L1_error)
8925
8926 /* "pymusic.pyx":505
8927 * p.ptr = self.ptr.publishMessageInput(s)
8928 * self.ports.add(p)
8929 * return p # <<<<<<<<<<<<<<
8930 *
8931 * def runtime(self, double timestep):
8932 */
8933 __Pyx_XDECREF(__pyx_r);
8934 __Pyx_INCREF(((PyObject *)__pyx_v_p));
8935 __pyx_r = ((PyObject *)__pyx_v_p);
8936 goto __pyx_L0;
8937
8938 /* "pymusic.pyx":497
8939 * return p
8940 *
8941 * def publishMessageInput(self, string s): # <<<<<<<<<<<<<<
8942 * """
8943 * Discrete python object sink
8944 */
8945
8946 /* function exit code */
8947 __pyx_L1_error:;
8948 __Pyx_XDECREF(__pyx_t_1);
8949 __Pyx_AddTraceback("pymusic.Setup.publishMessageInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
8950 __pyx_r = NULL;
8951 __pyx_L0:;
8952 __Pyx_XDECREF((PyObject *)__pyx_v_p);
8953 __Pyx_XGIVEREF(__pyx_r);
8954 __Pyx_RefNannyFinishContext();
8955 return __pyx_r;
8956 }
8957
8958 /* "pymusic.pyx":507
8959 * return p
8960 *
8961 * def runtime(self, double timestep): # <<<<<<<<<<<<<<
8962 * """
8963 * Create a runtime.
8964 */
8965
8966 /* Python wrapper */
8967 static PyObject *__pyx_pw_7pymusic_5Setup_21runtime(PyObject *__pyx_v_self, PyObject *__pyx_arg_timestep); /*proto*/
8968 static char __pyx_doc_7pymusic_5Setup_20runtime[] = "\n Create a runtime.\n After return, this Setup object is invalid\n double timestep: size of timestep (\077\077 units)\n ";
8969 static PyObject *__pyx_pw_7pymusic_5Setup_21runtime(PyObject *__pyx_v_self, PyObject *__pyx_arg_timestep) {
8970 double __pyx_v_timestep;
8971 int __pyx_lineno = 0;
8972 const char *__pyx_filename = NULL;
8973 int __pyx_clineno = 0;
8974 PyObject *__pyx_r = 0;
8975 __Pyx_RefNannyDeclarations
8976 __Pyx_RefNannySetupContext("runtime (wrapper)", 0);
8977 assert(__pyx_arg_timestep); {
8978 __pyx_v_timestep = __pyx_PyFloat_AsDouble(__pyx_arg_timestep); if (unlikely((__pyx_v_timestep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L3_error)
8979 }
8980 goto __pyx_L4_argument_unpacking_done;
8981 __pyx_L3_error:;
8982 __Pyx_AddTraceback("pymusic.Setup.runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
8983 __Pyx_RefNannyFinishContext();
8984 return NULL;
8985 __pyx_L4_argument_unpacking_done:;
8986 __pyx_r = __pyx_pf_7pymusic_5Setup_20runtime(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((double)__pyx_v_timestep));
8987
8988 /* function exit code */
8989 __Pyx_RefNannyFinishContext();
8990 return __pyx_r;
8991 }
8992
8993 static PyObject *__pyx_pf_7pymusic_5Setup_20runtime(struct __pyx_obj_7pymusic_Setup *__pyx_v_self, double __pyx_v_timestep) {
8994 PyObject *__pyx_r = NULL;
8995 __Pyx_RefNannyDeclarations
8996 PyObject *__pyx_t_1 = NULL;
8997 PyObject *__pyx_t_2 = NULL;
8998 int __pyx_lineno = 0;
8999 const char *__pyx_filename = NULL;
9000 int __pyx_clineno = 0;
9001 __Pyx_RefNannySetupContext("runtime", 0);
9002
9003 /* "pymusic.pyx":513
9004 * double timestep: size of timestep (?? units)
9005 * """
9006 * return Runtime(self, timestep) # <<<<<<<<<<<<<<
9007 *
9008 * ###########################################################
9009 */
9010 __Pyx_XDECREF(__pyx_r);
9011 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_timestep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
9012 __Pyx_GOTREF(__pyx_t_1);
9013 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
9014 __Pyx_GOTREF(__pyx_t_2);
9015 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9016 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9017 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
9018 __Pyx_GIVEREF(__pyx_t_1);
9019 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
9020 __pyx_t_1 = 0;
9021 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pymusic_Runtime), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
9022 __Pyx_GOTREF(__pyx_t_1);
9023 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9024 __pyx_r = __pyx_t_1;
9025 __pyx_t_1 = 0;
9026 goto __pyx_L0;
9027
9028 /* "pymusic.pyx":507
9029 * return p
9030 *
9031 * def runtime(self, double timestep): # <<<<<<<<<<<<<<
9032 * """
9033 * Create a runtime.
9034 */
9035
9036 /* function exit code */
9037 __pyx_L1_error:;
9038 __Pyx_XDECREF(__pyx_t_1);
9039 __Pyx_XDECREF(__pyx_t_2);
9040 __Pyx_AddTraceback("pymusic.Setup.runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
9041 __pyx_r = NULL;
9042 __pyx_L0:;
9043 __Pyx_XGIVEREF(__pyx_r);
9044 __Pyx_RefNannyFinishContext();
9045 return __pyx_r;
9046 }
9047
9048 /* "pymusic.pxd":177
9049 * cdef list argv
9050 * cdef int provided
9051 * cdef readonly MPI.Intracomm comm # <<<<<<<<<<<<<<
9052 * cdef set ports
9053 *
9054 */
9055
9056 /* Python wrapper */
9057 static PyObject *__pyx_pw_7pymusic_5Setup_4comm_1__get__(PyObject *__pyx_v_self); /*proto*/
9058 static PyObject *__pyx_pw_7pymusic_5Setup_4comm_1__get__(PyObject *__pyx_v_self) {
9059 PyObject *__pyx_r = 0;
9060 __Pyx_RefNannyDeclarations
9061 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9062 __pyx_r = __pyx_pf_7pymusic_5Setup_4comm___get__(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self));
9063
9064 /* function exit code */
9065 __Pyx_RefNannyFinishContext();
9066 return __pyx_r;
9067 }
9068
9069 static PyObject *__pyx_pf_7pymusic_5Setup_4comm___get__(struct __pyx_obj_7pymusic_Setup *__pyx_v_self) {
9070 PyObject *__pyx_r = NULL;
9071 __Pyx_RefNannyDeclarations
9072 __Pyx_RefNannySetupContext("__get__", 0);
9073 __Pyx_XDECREF(__pyx_r);
9074 __Pyx_INCREF(((PyObject *)__pyx_v_self->comm));
9075 __pyx_r = ((PyObject *)__pyx_v_self->comm);
9076 goto __pyx_L0;
9077
9078 /* function exit code */
9079 __pyx_L0:;
9080 __Pyx_XGIVEREF(__pyx_r);
9081 __Pyx_RefNannyFinishContext();
9082 return __pyx_r;
9083 }
9084
9085 /* "(tree fragment)":1
9086 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9087 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9088 * def __setstate_cython__(self, __pyx_state):
9089 */
9090
9091 /* Python wrapper */
9092 static PyObject *__pyx_pw_7pymusic_5Setup_23__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9093 static PyObject *__pyx_pw_7pymusic_5Setup_23__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9094 PyObject *__pyx_r = 0;
9095 __Pyx_RefNannyDeclarations
9096 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9097 __pyx_r = __pyx_pf_7pymusic_5Setup_22__reduce_cython__(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self));
9098
9099 /* function exit code */
9100 __Pyx_RefNannyFinishContext();
9101 return __pyx_r;
9102 }
9103
9104 static PyObject *__pyx_pf_7pymusic_5Setup_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Setup *__pyx_v_self) {
9105 PyObject *__pyx_r = NULL;
9106 __Pyx_RefNannyDeclarations
9107 PyObject *__pyx_t_1 = NULL;
9108 int __pyx_lineno = 0;
9109 const char *__pyx_filename = NULL;
9110 int __pyx_clineno = 0;
9111 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9112
9113 /* "(tree fragment)":2
9114 * def __reduce_cython__(self):
9115 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9116 * def __setstate_cython__(self, __pyx_state):
9117 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9118 */
9119 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9120 __Pyx_GOTREF(__pyx_t_1);
9121 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9122 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9123 __PYX_ERR(1, 2, __pyx_L1_error)
9124
9125 /* "(tree fragment)":1
9126 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9127 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9128 * def __setstate_cython__(self, __pyx_state):
9129 */
9130
9131 /* function exit code */
9132 __pyx_L1_error:;
9133 __Pyx_XDECREF(__pyx_t_1);
9134 __Pyx_AddTraceback("pymusic.Setup.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9135 __pyx_r = NULL;
9136 __Pyx_XGIVEREF(__pyx_r);
9137 __Pyx_RefNannyFinishContext();
9138 return __pyx_r;
9139 }
9140
9141 /* "(tree fragment)":3
9142 * def __reduce_cython__(self):
9143 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9144 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9145 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9146 */
9147
9148 /* Python wrapper */
9149 static PyObject *__pyx_pw_7pymusic_5Setup_25__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9150 static PyObject *__pyx_pw_7pymusic_5Setup_25__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9151 PyObject *__pyx_r = 0;
9152 __Pyx_RefNannyDeclarations
9153 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9154 __pyx_r = __pyx_pf_7pymusic_5Setup_24__setstate_cython__(((struct __pyx_obj_7pymusic_Setup *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9155
9156 /* function exit code */
9157 __Pyx_RefNannyFinishContext();
9158 return __pyx_r;
9159 }
9160
9161 static PyObject *__pyx_pf_7pymusic_5Setup_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Setup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9162 PyObject *__pyx_r = NULL;
9163 __Pyx_RefNannyDeclarations
9164 PyObject *__pyx_t_1 = NULL;
9165 int __pyx_lineno = 0;
9166 const char *__pyx_filename = NULL;
9167 int __pyx_clineno = 0;
9168 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9169
9170 /* "(tree fragment)":4
9171 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9172 * def __setstate_cython__(self, __pyx_state):
9173 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9174 */
9175 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9176 __Pyx_GOTREF(__pyx_t_1);
9177 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9178 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9179 __PYX_ERR(1, 4, __pyx_L1_error)
9180
9181 /* "(tree fragment)":3
9182 * def __reduce_cython__(self):
9183 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9184 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9185 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9186 */
9187
9188 /* function exit code */
9189 __pyx_L1_error:;
9190 __Pyx_XDECREF(__pyx_t_1);
9191 __Pyx_AddTraceback("pymusic.Setup.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9192 __pyx_r = NULL;
9193 __Pyx_XGIVEREF(__pyx_r);
9194 __Pyx_RefNannyFinishContext();
9195 return __pyx_r;
9196 }
9197
9198 /* "pymusic.pyx":518
9199 *
9200 * cdef class Runtime(object):
9201 * def __cinit__(self, Setup setup, double h): # <<<<<<<<<<<<<<
9202 * self.ptr = new CRuntime(setup.ptr, h)
9203 * self.ports = setup.ports
9204 */
9205
9206 /* Python wrapper */
9207 static int __pyx_pw_7pymusic_7Runtime_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9208 static int __pyx_pw_7pymusic_7Runtime_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9209 struct __pyx_obj_7pymusic_Setup *__pyx_v_setup = 0;
9210 double __pyx_v_h;
9211 int __pyx_lineno = 0;
9212 const char *__pyx_filename = NULL;
9213 int __pyx_clineno = 0;
9214 int __pyx_r;
9215 __Pyx_RefNannyDeclarations
9216 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9217 {
9218 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_setup,&__pyx_n_s_h,0};
9219 PyObject* values[2] = {0,0};
9220 if (unlikely(__pyx_kwds)) {
9221 Py_ssize_t kw_args;
9222 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9223 switch (pos_args) {
9224 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9225 CYTHON_FALLTHROUGH;
9226 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9227 CYTHON_FALLTHROUGH;
9228 case 0: break;
9229 default: goto __pyx_L5_argtuple_error;
9230 }
9231 kw_args = PyDict_Size(__pyx_kwds);
9232 switch (pos_args) {
9233 case 0:
9234 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_setup)) != 0)) kw_args--;
9235 else goto __pyx_L5_argtuple_error;
9236 CYTHON_FALLTHROUGH;
9237 case 1:
9238 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
9239 else {
9240 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 518, __pyx_L3_error)
9241 }
9242 }
9243 if (unlikely(kw_args > 0)) {
9244 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 518, __pyx_L3_error)
9245 }
9246 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
9247 goto __pyx_L5_argtuple_error;
9248 } else {
9249 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9250 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9251 }
9252 __pyx_v_setup = ((struct __pyx_obj_7pymusic_Setup *)values[0]);
9253 __pyx_v_h = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_h == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L3_error)
9254 }
9255 goto __pyx_L4_argument_unpacking_done;
9256 __pyx_L5_argtuple_error:;
9257 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 518, __pyx_L3_error)
9258 __pyx_L3_error:;
9259 __Pyx_AddTraceback("pymusic.Runtime.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9260 __Pyx_RefNannyFinishContext();
9261 return -1;
9262 __pyx_L4_argument_unpacking_done:;
9263 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_setup), __pyx_ptype_7pymusic_Setup, 1, "setup", 0))) __PYX_ERR(0, 518, __pyx_L1_error)
9264 __pyx_r = __pyx_pf_7pymusic_7Runtime___cinit__(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self), __pyx_v_setup, __pyx_v_h);
9265
9266 /* function exit code */
9267 goto __pyx_L0;
9268 __pyx_L1_error:;
9269 __pyx_r = -1;
9270 __pyx_L0:;
9271 __Pyx_RefNannyFinishContext();
9272 return __pyx_r;
9273 }
9274
9275 static int __pyx_pf_7pymusic_7Runtime___cinit__(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self, struct __pyx_obj_7pymusic_Setup *__pyx_v_setup, double __pyx_v_h) {
9276 struct PyMPIIntracommObject *__pyx_v_comm = 0;
9277 int __pyx_r;
9278 __Pyx_RefNannyDeclarations
9279 MUSIC::Runtime *__pyx_t_1;
9280 PyObject *__pyx_t_2 = NULL;
9281 int __pyx_lineno = 0;
9282 const char *__pyx_filename = NULL;
9283 int __pyx_clineno = 0;
9284 __Pyx_RefNannySetupContext("__cinit__", 0);
9285
9286 /* "pymusic.pyx":519
9287 * cdef class Runtime(object):
9288 * def __cinit__(self, Setup setup, double h):
9289 * self.ptr = new CRuntime(setup.ptr, h) # <<<<<<<<<<<<<<
9290 * self.ports = setup.ports
9291 * self.isFinalized = 0
9292 */
9293 try {
9294 __pyx_t_1 = new MUSIC::Runtime(__pyx_v_setup->ptr, __pyx_v_h);
9295 } catch(...) {
9296 __Pyx_CppExn2PyErr();
9297 __PYX_ERR(0, 519, __pyx_L1_error)
9298 }
9299 __pyx_v_self->ptr = __pyx_t_1;
9300
9301 /* "pymusic.pyx":520
9302 * def __cinit__(self, Setup setup, double h):
9303 * self.ptr = new CRuntime(setup.ptr, h)
9304 * self.ports = setup.ports # <<<<<<<<<<<<<<
9305 * self.isFinalized = 0
9306 * setup.null()
9307 */
9308 __pyx_t_2 = __pyx_v_setup->ports;
9309 __Pyx_INCREF(__pyx_t_2);
9310 __Pyx_GIVEREF(__pyx_t_2);
9311 __Pyx_GOTREF(__pyx_v_self->ports);
9312 __Pyx_DECREF(__pyx_v_self->ports);
9313 __pyx_v_self->ports = ((PyObject*)__pyx_t_2);
9314 __pyx_t_2 = 0;
9315
9316 /* "pymusic.pyx":521
9317 * self.ptr = new CRuntime(setup.ptr, h)
9318 * self.ports = setup.ports
9319 * self.isFinalized = 0 # <<<<<<<<<<<<<<
9320 * setup.null()
9321 *
9322 */
9323 __pyx_v_self->isFinalized = 0;
9324
9325 /* "pymusic.pyx":522
9326 * self.ports = setup.ports
9327 * self.isFinalized = 0
9328 * setup.null() # <<<<<<<<<<<<<<
9329 *
9330 * cdef MPI.Intracomm comm = MPI.Intracomm()
9331 */
9332 __pyx_t_2 = ((struct __pyx_vtabstruct_7pymusic_Setup *)__pyx_v_setup->__pyx_vtab)->null(__pyx_v_setup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
9333 __Pyx_GOTREF(__pyx_t_2);
9334 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9335
9336 /* "pymusic.pyx":524
9337 * setup.null()
9338 *
9339 * cdef MPI.Intracomm comm = MPI.Intracomm() # <<<<<<<<<<<<<<
9340 * comm.ob_mpi = communicator(self.ptr)
9341 * self.comm = comm
9342 */
9343 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6mpi4py_3MPI_Intracomm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
9344 __Pyx_GOTREF(__pyx_t_2);
9345 __pyx_v_comm = ((struct PyMPIIntracommObject *)__pyx_t_2);
9346 __pyx_t_2 = 0;
9347
9348 /* "pymusic.pyx":525
9349 *
9350 * cdef MPI.Intracomm comm = MPI.Intracomm()
9351 * comm.ob_mpi = communicator(self.ptr) # <<<<<<<<<<<<<<
9352 * self.comm = comm
9353 *
9354 */
9355 __pyx_v_comm->__pyx_base.ob_mpi = MUSIC::communicator(__pyx_v_self->ptr);
9356
9357 /* "pymusic.pyx":526
9358 * cdef MPI.Intracomm comm = MPI.Intracomm()
9359 * comm.ob_mpi = communicator(self.ptr)
9360 * self.comm = comm # <<<<<<<<<<<<<<
9361 *
9362 * def __dealloc__(self):
9363 */
9364 __Pyx_INCREF(((PyObject *)__pyx_v_comm));
9365 __Pyx_GIVEREF(((PyObject *)__pyx_v_comm));
9366 __Pyx_GOTREF(__pyx_v_self->comm);
9367 __Pyx_DECREF(((PyObject *)__pyx_v_self->comm));
9368 __pyx_v_self->comm = __pyx_v_comm;
9369
9370 /* "pymusic.pyx":518
9371 *
9372 * cdef class Runtime(object):
9373 * def __cinit__(self, Setup setup, double h): # <<<<<<<<<<<<<<
9374 * self.ptr = new CRuntime(setup.ptr, h)
9375 * self.ports = setup.ports
9376 */
9377
9378 /* function exit code */
9379 __pyx_r = 0;
9380 goto __pyx_L0;
9381 __pyx_L1_error:;
9382 __Pyx_XDECREF(__pyx_t_2);
9383 __Pyx_AddTraceback("pymusic.Runtime.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9384 __pyx_r = -1;
9385 __pyx_L0:;
9386 __Pyx_XDECREF((PyObject *)__pyx_v_comm);
9387 __Pyx_RefNannyFinishContext();
9388 return __pyx_r;
9389 }
9390
9391 /* "pymusic.pyx":528
9392 * self.comm = comm
9393 *
9394 * def __dealloc__(self): # <<<<<<<<<<<<<<
9395 * if not self.isFinalized:
9396 * self.ptr.finalize()
9397 */
9398
9399 /* Python wrapper */
9400 static void __pyx_pw_7pymusic_7Runtime_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
9401 static void __pyx_pw_7pymusic_7Runtime_3__dealloc__(PyObject *__pyx_v_self) {
9402 __Pyx_RefNannyDeclarations
9403 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9404 __pyx_pf_7pymusic_7Runtime_2__dealloc__(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self));
9405
9406 /* function exit code */
9407 __Pyx_RefNannyFinishContext();
9408 }
9409
9410 static void __pyx_pf_7pymusic_7Runtime_2__dealloc__(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self) {
9411 PyObject *__pyx_v_p = NULL;
9412 __Pyx_RefNannyDeclarations
9413 int __pyx_t_1;
9414 PyObject *__pyx_t_2 = NULL;
9415 Py_ssize_t __pyx_t_3;
9416 Py_ssize_t __pyx_t_4;
9417 int __pyx_t_5;
9418 PyObject *__pyx_t_6 = NULL;
9419 int __pyx_t_7;
9420 PyObject *__pyx_t_8 = NULL;
9421 PyObject *__pyx_t_9 = NULL;
9422 int __pyx_lineno = 0;
9423 const char *__pyx_filename = NULL;
9424 int __pyx_clineno = 0;
9425 __Pyx_RefNannySetupContext("__dealloc__", 0);
9426
9427 /* "pymusic.pyx":529
9428 *
9429 * def __dealloc__(self):
9430 * if not self.isFinalized: # <<<<<<<<<<<<<<
9431 * self.ptr.finalize()
9432 *
9433 */
9434 __pyx_t_1 = ((!(__pyx_v_self->isFinalized != 0)) != 0);
9435 if (__pyx_t_1) {
9436
9437 /* "pymusic.pyx":530
9438 * def __dealloc__(self):
9439 * if not self.isFinalized:
9440 * self.ptr.finalize() # <<<<<<<<<<<<<<
9441 *
9442 * for p in self.ports:
9443 */
9444 __pyx_v_self->ptr->finalize();
9445
9446 /* "pymusic.pyx":529
9447 *
9448 * def __dealloc__(self):
9449 * if not self.isFinalized: # <<<<<<<<<<<<<<
9450 * self.ptr.finalize()
9451 *
9452 */
9453 }
9454
9455 /* "pymusic.pyx":532
9456 * self.ptr.finalize()
9457 *
9458 * for p in self.ports: # <<<<<<<<<<<<<<
9459 * p.null()
9460 *
9461 */
9462 __pyx_t_3 = 0;
9463 __pyx_t_6 = __Pyx_set_iterator(__pyx_v_self->ports, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
9464 __Pyx_GOTREF(__pyx_t_6);
9465 __Pyx_XDECREF(__pyx_t_2);
9466 __pyx_t_2 = __pyx_t_6;
9467 __pyx_t_6 = 0;
9468 while (1) {
9469 __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, __pyx_t_5);
9470 if (unlikely(__pyx_t_7 == 0)) break;
9471 if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 532, __pyx_L1_error)
9472 __Pyx_GOTREF(__pyx_t_6);
9473 __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_6);
9474 __pyx_t_6 = 0;
9475
9476 /* "pymusic.pyx":533
9477 *
9478 * for p in self.ports:
9479 * p.null() # <<<<<<<<<<<<<<
9480 *
9481 * del self.ptr
9482 */
9483 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_null); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error)
9484 __Pyx_GOTREF(__pyx_t_8);
9485 __pyx_t_9 = NULL;
9486 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
9487 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
9488 if (likely(__pyx_t_9)) {
9489 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
9490 __Pyx_INCREF(__pyx_t_9);
9491 __Pyx_INCREF(function);
9492 __Pyx_DECREF_SET(__pyx_t_8, function);
9493 }
9494 }
9495 __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
9496 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9497 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 533, __pyx_L1_error)
9498 __Pyx_GOTREF(__pyx_t_6);
9499 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9500 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9501 }
9502 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9503
9504 /* "pymusic.pyx":535
9505 * p.null()
9506 *
9507 * del self.ptr # <<<<<<<<<<<<<<
9508 *
9509 * def time(self): return self.ptr.time()
9510 */
9511 delete __pyx_v_self->ptr;
9512
9513 /* "pymusic.pyx":528
9514 * self.comm = comm
9515 *
9516 * def __dealloc__(self): # <<<<<<<<<<<<<<
9517 * if not self.isFinalized:
9518 * self.ptr.finalize()
9519 */
9520
9521 /* function exit code */
9522 goto __pyx_L0;
9523 __pyx_L1_error:;
9524 __Pyx_XDECREF(__pyx_t_2);
9525 __Pyx_XDECREF(__pyx_t_6);
9526 __Pyx_XDECREF(__pyx_t_8);
9527 __Pyx_XDECREF(__pyx_t_9);
9528 __Pyx_WriteUnraisable("pymusic.Runtime.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9529 __pyx_L0:;
9530 __Pyx_XDECREF(__pyx_v_p);
9531 __Pyx_RefNannyFinishContext();
9532 }
9533
9534 /* "pymusic.pyx":537
9535 * del self.ptr
9536 *
9537 * def time(self): return self.ptr.time() # <<<<<<<<<<<<<<
9538 *
9539 * def tick(self): tick(self.ptr)
9540 */
9541
9542 /* Python wrapper */
9543 static PyObject *__pyx_pw_7pymusic_7Runtime_5time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9544 static PyObject *__pyx_pw_7pymusic_7Runtime_5time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9545 PyObject *__pyx_r = 0;
9546 __Pyx_RefNannyDeclarations
9547 __Pyx_RefNannySetupContext("time (wrapper)", 0);
9548 __pyx_r = __pyx_pf_7pymusic_7Runtime_4time(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self));
9549
9550 /* function exit code */
9551 __Pyx_RefNannyFinishContext();
9552 return __pyx_r;
9553 }
9554
9555 static PyObject *__pyx_pf_7pymusic_7Runtime_4time(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self) {
9556 PyObject *__pyx_r = NULL;
9557 __Pyx_RefNannyDeclarations
9558 PyObject *__pyx_t_1 = NULL;
9559 int __pyx_lineno = 0;
9560 const char *__pyx_filename = NULL;
9561 int __pyx_clineno = 0;
9562 __Pyx_RefNannySetupContext("time", 0);
9563 __Pyx_XDECREF(__pyx_r);
9564 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->ptr->time()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
9565 __Pyx_GOTREF(__pyx_t_1);
9566 __pyx_r = __pyx_t_1;
9567 __pyx_t_1 = 0;
9568 goto __pyx_L0;
9569
9570 /* function exit code */
9571 __pyx_L1_error:;
9572 __Pyx_XDECREF(__pyx_t_1);
9573 __Pyx_AddTraceback("pymusic.Runtime.time", __pyx_clineno, __pyx_lineno, __pyx_filename);
9574 __pyx_r = NULL;
9575 __pyx_L0:;
9576 __Pyx_XGIVEREF(__pyx_r);
9577 __Pyx_RefNannyFinishContext();
9578 return __pyx_r;
9579 }
9580
9581 /* "pymusic.pyx":539
9582 * def time(self): return self.ptr.time()
9583 *
9584 * def tick(self): tick(self.ptr) # <<<<<<<<<<<<<<
9585 *
9586 * def finalize(self):
9587 */
9588
9589 /* Python wrapper */
9590 static PyObject *__pyx_pw_7pymusic_7Runtime_7tick(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9591 static PyObject *__pyx_pw_7pymusic_7Runtime_7tick(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9592 PyObject *__pyx_r = 0;
9593 __Pyx_RefNannyDeclarations
9594 __Pyx_RefNannySetupContext("tick (wrapper)", 0);
9595 __pyx_r = __pyx_pf_7pymusic_7Runtime_6tick(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self));
9596
9597 /* function exit code */
9598 __Pyx_RefNannyFinishContext();
9599 return __pyx_r;
9600 }
9601
9602 static PyObject *__pyx_pf_7pymusic_7Runtime_6tick(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self) {
9603 PyObject *__pyx_r = NULL;
9604 __Pyx_RefNannyDeclarations
9605 bool __pyx_t_1;
9606 int __pyx_lineno = 0;
9607 const char *__pyx_filename = NULL;
9608 int __pyx_clineno = 0;
9609 __Pyx_RefNannySetupContext("tick", 0);
9610 __pyx_t_1 = MUSIC::tick(__pyx_v_self->ptr); if (unlikely(__pyx_t_1 == ((bool)0))) __PYX_ERR(0, 539, __pyx_L1_error)
9611
9612 /* function exit code */
9613 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9614 goto __pyx_L0;
9615 __pyx_L1_error:;
9616 __Pyx_AddTraceback("pymusic.Runtime.tick", __pyx_clineno, __pyx_lineno, __pyx_filename);
9617 __pyx_r = NULL;
9618 __pyx_L0:;
9619 __Pyx_XGIVEREF(__pyx_r);
9620 __Pyx_RefNannyFinishContext();
9621 return __pyx_r;
9622 }
9623
9624 /* "pymusic.pyx":541
9625 * def tick(self): tick(self.ptr)
9626 *
9627 * def finalize(self): # <<<<<<<<<<<<<<
9628 * self.isFinalized = 1
9629 * self.ptr.finalize()
9630 */
9631
9632 /* Python wrapper */
9633 static PyObject *__pyx_pw_7pymusic_7Runtime_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9634 static PyObject *__pyx_pw_7pymusic_7Runtime_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9635 PyObject *__pyx_r = 0;
9636 __Pyx_RefNannyDeclarations
9637 __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
9638 __pyx_r = __pyx_pf_7pymusic_7Runtime_8finalize(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self));
9639
9640 /* function exit code */
9641 __Pyx_RefNannyFinishContext();
9642 return __pyx_r;
9643 }
9644
9645 static PyObject *__pyx_pf_7pymusic_7Runtime_8finalize(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self) {
9646 PyObject *__pyx_r = NULL;
9647 __Pyx_RefNannyDeclarations
9648 __Pyx_RefNannySetupContext("finalize", 0);
9649
9650 /* "pymusic.pyx":542
9651 *
9652 * def finalize(self):
9653 * self.isFinalized = 1 # <<<<<<<<<<<<<<
9654 * self.ptr.finalize()
9655 *
9656 */
9657 __pyx_v_self->isFinalized = 1;
9658
9659 /* "pymusic.pyx":543
9660 * def finalize(self):
9661 * self.isFinalized = 1
9662 * self.ptr.finalize() # <<<<<<<<<<<<<<
9663 *
9664 * def __iter__(self):
9665 */
9666 __pyx_v_self->ptr->finalize();
9667
9668 /* "pymusic.pyx":541
9669 * def tick(self): tick(self.ptr)
9670 *
9671 * def finalize(self): # <<<<<<<<<<<<<<
9672 * self.isFinalized = 1
9673 * self.ptr.finalize()
9674 */
9675
9676 /* function exit code */
9677 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9678 __Pyx_XGIVEREF(__pyx_r);
9679 __Pyx_RefNannyFinishContext();
9680 return __pyx_r;
9681 }
9682 static PyObject *__pyx_gb_7pymusic_7Runtime_12generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
9683
9684 /* "pymusic.pyx":545
9685 * self.ptr.finalize()
9686 *
9687 * def __iter__(self): # <<<<<<<<<<<<<<
9688 * cdef CRuntime* ptr = self.ptr
9689 * while True:
9690 */
9691
9692 /* Python wrapper */
9693 static PyObject *__pyx_pw_7pymusic_7Runtime_11__iter__(PyObject *__pyx_v_self); /*proto*/
9694 static PyObject *__pyx_pw_7pymusic_7Runtime_11__iter__(PyObject *__pyx_v_self) {
9695 PyObject *__pyx_r = 0;
9696 __Pyx_RefNannyDeclarations
9697 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
9698 __pyx_r = __pyx_pf_7pymusic_7Runtime_10__iter__(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self));
9699
9700 /* function exit code */
9701 __Pyx_RefNannyFinishContext();
9702 return __pyx_r;
9703 }
9704
9705 static PyObject *__pyx_pf_7pymusic_7Runtime_10__iter__(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self) {
9706 struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *__pyx_cur_scope;
9707 PyObject *__pyx_r = NULL;
9708 __Pyx_RefNannyDeclarations
9709 int __pyx_lineno = 0;
9710 const char *__pyx_filename = NULL;
9711 int __pyx_clineno = 0;
9712 __Pyx_RefNannySetupContext("__iter__", 0);
9713 __pyx_cur_scope = (struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *)__pyx_tp_new_7pymusic___pyx_scope_struct____iter__(__pyx_ptype_7pymusic___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
9714 if (unlikely(!__pyx_cur_scope)) {
9715 __pyx_cur_scope = ((struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *)Py_None);
9716 __Pyx_INCREF(Py_None);
9717 __PYX_ERR(0, 545, __pyx_L1_error)
9718 } else {
9719 __Pyx_GOTREF(__pyx_cur_scope);
9720 }
9721 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
9722 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
9723 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
9724 {
9725 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pymusic_7Runtime_12generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Runtime___iter, __pyx_n_s_pymusic); if (unlikely(!gen)) __PYX_ERR(0, 545, __pyx_L1_error)
9726 __Pyx_DECREF(__pyx_cur_scope);
9727 __Pyx_RefNannyFinishContext();
9728 return (PyObject *) gen;
9729 }
9730
9731 /* function exit code */
9732 __pyx_L1_error:;
9733 __Pyx_AddTraceback("pymusic.Runtime.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9734 __pyx_r = NULL;
9735 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
9736 __Pyx_XGIVEREF(__pyx_r);
9737 __Pyx_RefNannyFinishContext();
9738 return __pyx_r;
9739 }
9740
9741 static PyObject *__pyx_gb_7pymusic_7Runtime_12generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
9742 {
9743 struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *)__pyx_generator->closure);
9744 PyObject *__pyx_r = NULL;
9745 MUSIC::Runtime *__pyx_t_1;
9746 PyObject *__pyx_t_2 = NULL;
9747 bool __pyx_t_3;
9748 int __pyx_lineno = 0;
9749 const char *__pyx_filename = NULL;
9750 int __pyx_clineno = 0;
9751 __Pyx_RefNannyDeclarations
9752 __Pyx_RefNannySetupContext("__iter__", 0);
9753 switch (__pyx_generator->resume_label) {
9754 case 0: goto __pyx_L3_first_run;
9755 case 1: goto __pyx_L6_resume_from_yield;
9756 default: /* CPython raises the right error here */
9757 __Pyx_RefNannyFinishContext();
9758 return NULL;
9759 }
9760 __pyx_L3_first_run:;
9761 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 545, __pyx_L1_error)
9762
9763 /* "pymusic.pyx":546
9764 *
9765 * def __iter__(self):
9766 * cdef CRuntime* ptr = self.ptr # <<<<<<<<<<<<<<
9767 * while True:
9768 * yield ptr.time()
9769 */
9770 __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->ptr;
9771 __pyx_cur_scope->__pyx_v_ptr = __pyx_t_1;
9772
9773 /* "pymusic.pyx":547
9774 * def __iter__(self):
9775 * cdef CRuntime* ptr = self.ptr
9776 * while True: # <<<<<<<<<<<<<<
9777 * yield ptr.time()
9778 * tick(ptr)
9779 */
9780 while (1) {
9781
9782 /* "pymusic.pyx":548
9783 * cdef CRuntime* ptr = self.ptr
9784 * while True:
9785 * yield ptr.time() # <<<<<<<<<<<<<<
9786 * tick(ptr)
9787 *
9788 */
9789 __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_ptr->time()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
9790 __Pyx_GOTREF(__pyx_t_2);
9791 __pyx_r = __pyx_t_2;
9792 __pyx_t_2 = 0;
9793 __Pyx_XGIVEREF(__pyx_r);
9794 __Pyx_RefNannyFinishContext();
9795 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
9796 /* return from generator, yielding value */
9797 __pyx_generator->resume_label = 1;
9798 return __pyx_r;
9799 __pyx_L6_resume_from_yield:;
9800 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 548, __pyx_L1_error)
9801
9802 /* "pymusic.pyx":549
9803 * while True:
9804 * yield ptr.time()
9805 * tick(ptr) # <<<<<<<<<<<<<<
9806 *
9807 * ###########################################################
9808 */
9809 __pyx_t_3 = MUSIC::tick(__pyx_cur_scope->__pyx_v_ptr); if (unlikely(__pyx_t_3 == ((bool)0))) __PYX_ERR(0, 549, __pyx_L1_error)
9810 }
9811 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
9812
9813 /* "pymusic.pyx":545
9814 * self.ptr.finalize()
9815 *
9816 * def __iter__(self): # <<<<<<<<<<<<<<
9817 * cdef CRuntime* ptr = self.ptr
9818 * while True:
9819 */
9820
9821 /* function exit code */
9822 PyErr_SetNone(PyExc_StopIteration);
9823 goto __pyx_L0;
9824 __pyx_L1_error:;
9825 __Pyx_XDECREF(__pyx_t_2);
9826 __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9827 __pyx_L0:;
9828 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
9829 #if !CYTHON_USE_EXC_INFO_STACK
9830 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
9831 #endif
9832 __pyx_generator->resume_label = -1;
9833 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
9834 __Pyx_RefNannyFinishContext();
9835 return __pyx_r;
9836 }
9837
9838 /* "pymusic.pxd":187
9839 * cdef class Runtime(object):
9840 * cdef CRuntime* ptr
9841 * cdef readonly MPI.Intracomm comm # <<<<<<<<<<<<<<
9842 * cdef set ports
9843 * cdef int isFinalized
9844 */
9845
9846 /* Python wrapper */
9847 static PyObject *__pyx_pw_7pymusic_7Runtime_4comm_1__get__(PyObject *__pyx_v_self); /*proto*/
9848 static PyObject *__pyx_pw_7pymusic_7Runtime_4comm_1__get__(PyObject *__pyx_v_self) {
9849 PyObject *__pyx_r = 0;
9850 __Pyx_RefNannyDeclarations
9851 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9852 __pyx_r = __pyx_pf_7pymusic_7Runtime_4comm___get__(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self));
9853
9854 /* function exit code */
9855 __Pyx_RefNannyFinishContext();
9856 return __pyx_r;
9857 }
9858
9859 static PyObject *__pyx_pf_7pymusic_7Runtime_4comm___get__(struct __pyx_obj_7pymusic_Runtime *__pyx_v_self) {
9860 PyObject *__pyx_r = NULL;
9861 __Pyx_RefNannyDeclarations
9862 __Pyx_RefNannySetupContext("__get__", 0);
9863 __Pyx_XDECREF(__pyx_r);
9864 __Pyx_INCREF(((PyObject *)__pyx_v_self->comm));
9865 __pyx_r = ((PyObject *)__pyx_v_self->comm);
9866 goto __pyx_L0;
9867
9868 /* function exit code */
9869 __pyx_L0:;
9870 __Pyx_XGIVEREF(__pyx_r);
9871 __Pyx_RefNannyFinishContext();
9872 return __pyx_r;
9873 }
9874
9875 /* "(tree fragment)":1
9876 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9877 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9878 * def __setstate_cython__(self, __pyx_state):
9879 */
9880
9881 /* Python wrapper */
9882 static PyObject *__pyx_pw_7pymusic_7Runtime_14__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9883 static PyObject *__pyx_pw_7pymusic_7Runtime_14__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9884 PyObject *__pyx_r = 0;
9885 __Pyx_RefNannyDeclarations
9886 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9887 __pyx_r = __pyx_pf_7pymusic_7Runtime_13__reduce_cython__(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self));
9888
9889 /* function exit code */
9890 __Pyx_RefNannyFinishContext();
9891 return __pyx_r;
9892 }
9893
9894 static PyObject *__pyx_pf_7pymusic_7Runtime_13__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Runtime *__pyx_v_self) {
9895 PyObject *__pyx_r = NULL;
9896 __Pyx_RefNannyDeclarations
9897 PyObject *__pyx_t_1 = NULL;
9898 int __pyx_lineno = 0;
9899 const char *__pyx_filename = NULL;
9900 int __pyx_clineno = 0;
9901 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9902
9903 /* "(tree fragment)":2
9904 * def __reduce_cython__(self):
9905 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9906 * def __setstate_cython__(self, __pyx_state):
9907 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9908 */
9909 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9910 __Pyx_GOTREF(__pyx_t_1);
9911 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9912 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9913 __PYX_ERR(1, 2, __pyx_L1_error)
9914
9915 /* "(tree fragment)":1
9916 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9917 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9918 * def __setstate_cython__(self, __pyx_state):
9919 */
9920
9921 /* function exit code */
9922 __pyx_L1_error:;
9923 __Pyx_XDECREF(__pyx_t_1);
9924 __Pyx_AddTraceback("pymusic.Runtime.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9925 __pyx_r = NULL;
9926 __Pyx_XGIVEREF(__pyx_r);
9927 __Pyx_RefNannyFinishContext();
9928 return __pyx_r;
9929 }
9930
9931 /* "(tree fragment)":3
9932 * def __reduce_cython__(self):
9933 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9934 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9935 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9936 */
9937
9938 /* Python wrapper */
9939 static PyObject *__pyx_pw_7pymusic_7Runtime_16__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9940 static PyObject *__pyx_pw_7pymusic_7Runtime_16__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9941 PyObject *__pyx_r = 0;
9942 __Pyx_RefNannyDeclarations
9943 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9944 __pyx_r = __pyx_pf_7pymusic_7Runtime_15__setstate_cython__(((struct __pyx_obj_7pymusic_Runtime *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9945
9946 /* function exit code */
9947 __Pyx_RefNannyFinishContext();
9948 return __pyx_r;
9949 }
9950
9951 static PyObject *__pyx_pf_7pymusic_7Runtime_15__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_Runtime *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9952 PyObject *__pyx_r = NULL;
9953 __Pyx_RefNannyDeclarations
9954 PyObject *__pyx_t_1 = NULL;
9955 int __pyx_lineno = 0;
9956 const char *__pyx_filename = NULL;
9957 int __pyx_clineno = 0;
9958 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9959
9960 /* "(tree fragment)":4
9961 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9962 * def __setstate_cython__(self, __pyx_state):
9963 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9964 */
9965 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9966 __Pyx_GOTREF(__pyx_t_1);
9967 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9968 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9969 __PYX_ERR(1, 4, __pyx_L1_error)
9970
9971 /* "(tree fragment)":3
9972 * def __reduce_cython__(self):
9973 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9974 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9975 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9976 */
9977
9978 /* function exit code */
9979 __pyx_L1_error:;
9980 __Pyx_XDECREF(__pyx_t_1);
9981 __Pyx_AddTraceback("pymusic.Runtime.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9982 __pyx_r = NULL;
9983 __Pyx_XGIVEREF(__pyx_r);
9984 __Pyx_RefNannyFinishContext();
9985 return __pyx_r;
9986 }
9987
9988 /* "pymusic.pyx":566
9989 * PermutationIndex: g = perm[l], where perm is an array
9990 * """
9991 * def __cinit__(self, object perm=None, int base=0, int size=-1): # <<<<<<<<<<<<<<
9992 * """
9993 * Created internally
9994 */
9995
9996 /* Python wrapper */
9997 static int __pyx_pw_7pymusic_8IndexMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9998 static int __pyx_pw_7pymusic_8IndexMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9999 PyObject *__pyx_v_perm = 0;
10000 int __pyx_v_base;
10001 int __pyx_v_size;
10002 int __pyx_lineno = 0;
10003 const char *__pyx_filename = NULL;
10004 int __pyx_clineno = 0;
10005 int __pyx_r;
10006 __Pyx_RefNannyDeclarations
10007 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10008 {
10009 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_perm,&__pyx_n_s_base,&__pyx_n_s_size,0};
10010 PyObject* values[3] = {0,0,0};
10011 values[0] = ((PyObject *)Py_None);
10012 if (unlikely(__pyx_kwds)) {
10013 Py_ssize_t kw_args;
10014 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10015 switch (pos_args) {
10016 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10017 CYTHON_FALLTHROUGH;
10018 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10019 CYTHON_FALLTHROUGH;
10020 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10021 CYTHON_FALLTHROUGH;
10022 case 0: break;
10023 default: goto __pyx_L5_argtuple_error;
10024 }
10025 kw_args = PyDict_Size(__pyx_kwds);
10026 switch (pos_args) {
10027 case 0:
10028 if (kw_args > 0) {
10029 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_perm);
10030 if (value) { values[0] = value; kw_args--; }
10031 }
10032 CYTHON_FALLTHROUGH;
10033 case 1:
10034 if (kw_args > 0) {
10035 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
10036 if (value) { values[1] = value; kw_args--; }
10037 }
10038 CYTHON_FALLTHROUGH;
10039 case 2:
10040 if (kw_args > 0) {
10041 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
10042 if (value) { values[2] = value; kw_args--; }
10043 }
10044 }
10045 if (unlikely(kw_args > 0)) {
10046 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 566, __pyx_L3_error)
10047 }
10048 } else {
10049 switch (PyTuple_GET_SIZE(__pyx_args)) {
10050 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10051 CYTHON_FALLTHROUGH;
10052 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10053 CYTHON_FALLTHROUGH;
10054 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10055 CYTHON_FALLTHROUGH;
10056 case 0: break;
10057 default: goto __pyx_L5_argtuple_error;
10058 }
10059 }
10060 __pyx_v_perm = values[0];
10061 if (values[1]) {
10062 __pyx_v_base = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error)
10063 } else {
10064 __pyx_v_base = ((int)0);
10065 }
10066 if (values[2]) {
10067 __pyx_v_size = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error)
10068 } else {
10069 __pyx_v_size = ((int)-1);
10070 }
10071 }
10072 goto __pyx_L4_argument_unpacking_done;
10073 __pyx_L5_argtuple_error:;
10074 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 566, __pyx_L3_error)
10075 __pyx_L3_error:;
10076 __Pyx_AddTraceback("pymusic.IndexMap.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10077 __Pyx_RefNannyFinishContext();
10078 return -1;
10079 __pyx_L4_argument_unpacking_done:;
10080 __pyx_r = __pyx_pf_7pymusic_8IndexMap___cinit__(((struct __pyx_obj_7pymusic_IndexMap *)__pyx_v_self), __pyx_v_perm, __pyx_v_base, __pyx_v_size);
10081
10082 /* function exit code */
10083 __Pyx_RefNannyFinishContext();
10084 return __pyx_r;
10085 }
10086
10087 static int __pyx_pf_7pymusic_8IndexMap___cinit__(struct __pyx_obj_7pymusic_IndexMap *__pyx_v_self, PyObject *__pyx_v_perm, int __pyx_v_base, int __pyx_v_size) {
10088 arrayobject *__pyx_v_arr = 0;
10089 int __pyx_r;
10090 __Pyx_RefNannyDeclarations
10091 int __pyx_t_1;
10092 int __pyx_t_2;
10093 PyObject *__pyx_t_3 = NULL;
10094 PyObject *__pyx_t_4 = NULL;
10095 PyObject *__pyx_t_5 = NULL;
10096 int __pyx_t_6;
10097 PyObject *__pyx_t_7 = NULL;
10098 int __pyx_lineno = 0;
10099 const char *__pyx_filename = NULL;
10100 int __pyx_clineno = 0;
10101 __Pyx_RefNannySetupContext("__cinit__", 0);
10102
10103 /* "pymusic.pyx":577
10104 * cdef array.array arr
10105 *
10106 * if perm is None: # <<<<<<<<<<<<<<
10107 * self.buf = None
10108 * self.ptr = new LinearIndex(GlobalIndex(base), size)
10109 */
10110 __pyx_t_1 = (__pyx_v_perm == Py_None);
10111 __pyx_t_2 = (__pyx_t_1 != 0);
10112 if (__pyx_t_2) {
10113
10114 /* "pymusic.pyx":578
10115 *
10116 * if perm is None:
10117 * self.buf = None # <<<<<<<<<<<<<<
10118 * self.ptr = new LinearIndex(GlobalIndex(base), size)
10119 * else:
10120 */
10121 __Pyx_INCREF(Py_None);
10122 __Pyx_GIVEREF(Py_None);
10123 __Pyx_GOTREF(__pyx_v_self->buf);
10124 __Pyx_DECREF(((PyObject *)__pyx_v_self->buf));
10125 __pyx_v_self->buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)Py_None);
10126
10127 /* "pymusic.pyx":579
10128 * if perm is None:
10129 * self.buf = None
10130 * self.ptr = new LinearIndex(GlobalIndex(base), size) # <<<<<<<<<<<<<<
10131 * else:
10132 * self.buf = Buffer(perm)
10133 */
10134 __pyx_v_self->ptr = new MUSIC::LinearIndex(MUSIC::GlobalIndex(__pyx_v_base), __pyx_v_size);
10135
10136 /* "pymusic.pyx":577
10137 * cdef array.array arr
10138 *
10139 * if perm is None: # <<<<<<<<<<<<<<
10140 * self.buf = None
10141 * self.ptr = new LinearIndex(GlobalIndex(base), size)
10142 */
10143 goto __pyx_L3;
10144 }
10145
10146 /* "pymusic.pyx":581
10147 * self.ptr = new LinearIndex(GlobalIndex(base), size)
10148 * else:
10149 * self.buf = Buffer(perm) # <<<<<<<<<<<<<<
10150 * if self.buf.dtype.size() != sizeof(int):
10151 * arr = array('i', perm)
10152 */
10153 /*else*/ {
10154 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5music_8pybuffer_Buffer), __pyx_v_perm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error)
10155 __Pyx_GOTREF(__pyx_t_3);
10156 __Pyx_GIVEREF(__pyx_t_3);
10157 __Pyx_GOTREF(__pyx_v_self->buf);
10158 __Pyx_DECREF(((PyObject *)__pyx_v_self->buf));
10159 __pyx_v_self->buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)__pyx_t_3);
10160 __pyx_t_3 = 0;
10161
10162 /* "pymusic.pyx":582
10163 * else:
10164 * self.buf = Buffer(perm)
10165 * if self.buf.dtype.size() != sizeof(int): # <<<<<<<<<<<<<<
10166 * arr = array('i', perm)
10167 * self.buf = Buffer(arr)
10168 */
10169 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->buf->dtype), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
10170 __Pyx_GOTREF(__pyx_t_4);
10171 __pyx_t_5 = NULL;
10172 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10173 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10174 if (likely(__pyx_t_5)) {
10175 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10176 __Pyx_INCREF(__pyx_t_5);
10177 __Pyx_INCREF(function);
10178 __Pyx_DECREF_SET(__pyx_t_4, function);
10179 }
10180 }
10181 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
10182 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10183 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error)
10184 __Pyx_GOTREF(__pyx_t_3);
10185 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10186 __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(int))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
10187 __Pyx_GOTREF(__pyx_t_4);
10188 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
10189 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10190 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10191 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 582, __pyx_L1_error)
10192 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10193 if (__pyx_t_2) {
10194
10195 /* "pymusic.pyx":583
10196 * self.buf = Buffer(perm)
10197 * if self.buf.dtype.size() != sizeof(int):
10198 * arr = array('i', perm) # <<<<<<<<<<<<<<
10199 * self.buf = Buffer(arr)
10200 * self.ptr = new PermutationIndex(<GlobalIndex*>
10201 */
10202 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
10203 __Pyx_GOTREF(__pyx_t_4);
10204 __pyx_t_3 = NULL;
10205 __pyx_t_6 = 0;
10206 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
10207 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
10208 if (likely(__pyx_t_3)) {
10209 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10210 __Pyx_INCREF(__pyx_t_3);
10211 __Pyx_INCREF(function);
10212 __Pyx_DECREF_SET(__pyx_t_4, function);
10213 __pyx_t_6 = 1;
10214 }
10215 }
10216 #if CYTHON_FAST_PYCALL
10217 if (PyFunction_Check(__pyx_t_4)) {
10218 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_i, __pyx_v_perm};
10219 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error)
10220 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10221 __Pyx_GOTREF(__pyx_t_5);
10222 } else
10223 #endif
10224 #if CYTHON_FAST_PYCCALL
10225 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10226 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_i, __pyx_v_perm};
10227 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error)
10228 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10229 __Pyx_GOTREF(__pyx_t_5);
10230 } else
10231 #endif
10232 {
10233 __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 583, __pyx_L1_error)
10234 __Pyx_GOTREF(__pyx_t_7);
10235 if (__pyx_t_3) {
10236 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
10237 }
10238 __Pyx_INCREF(__pyx_n_s_i);
10239 __Pyx_GIVEREF(__pyx_n_s_i);
10240 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_s_i);
10241 __Pyx_INCREF(__pyx_v_perm);
10242 __Pyx_GIVEREF(__pyx_v_perm);
10243 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_perm);
10244 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error)
10245 __Pyx_GOTREF(__pyx_t_5);
10246 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10247 }
10248 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10249 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_5array_array))))) __PYX_ERR(0, 583, __pyx_L1_error)
10250 __pyx_v_arr = ((arrayobject *)__pyx_t_5);
10251 __pyx_t_5 = 0;
10252
10253 /* "pymusic.pyx":584
10254 * if self.buf.dtype.size() != sizeof(int):
10255 * arr = array('i', perm)
10256 * self.buf = Buffer(arr) # <<<<<<<<<<<<<<
10257 * self.ptr = new PermutationIndex(<GlobalIndex*>
10258 * self.buf.pybuf.buf,
10259 */
10260 __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5music_8pybuffer_Buffer), ((PyObject *)__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error)
10261 __Pyx_GOTREF(__pyx_t_5);
10262 __Pyx_GIVEREF(__pyx_t_5);
10263 __Pyx_GOTREF(__pyx_v_self->buf);
10264 __Pyx_DECREF(((PyObject *)__pyx_v_self->buf));
10265 __pyx_v_self->buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)__pyx_t_5);
10266 __pyx_t_5 = 0;
10267
10268 /* "pymusic.pyx":582
10269 * else:
10270 * self.buf = Buffer(perm)
10271 * if self.buf.dtype.size() != sizeof(int): # <<<<<<<<<<<<<<
10272 * arr = array('i', perm)
10273 * self.buf = Buffer(arr)
10274 */
10275 }
10276
10277 /* "pymusic.pyx":585
10278 * arr = array('i', perm)
10279 * self.buf = Buffer(arr)
10280 * self.ptr = new PermutationIndex(<GlobalIndex*> # <<<<<<<<<<<<<<
10281 * self.buf.pybuf.buf,
10282 * self.buf.items)
10283 */
10284 __pyx_v_self->ptr = new MUSIC::PermutationIndex(((MUSIC::GlobalIndex *)__pyx_v_self->buf->pybuf.buf), __pyx_v_self->buf->items);
10285 }
10286 __pyx_L3:;
10287
10288 /* "pymusic.pyx":566
10289 * PermutationIndex: g = perm[l], where perm is an array
10290 * """
10291 * def __cinit__(self, object perm=None, int base=0, int size=-1): # <<<<<<<<<<<<<<
10292 * """
10293 * Created internally
10294 */
10295
10296 /* function exit code */
10297 __pyx_r = 0;
10298 goto __pyx_L0;
10299 __pyx_L1_error:;
10300 __Pyx_XDECREF(__pyx_t_3);
10301 __Pyx_XDECREF(__pyx_t_4);
10302 __Pyx_XDECREF(__pyx_t_5);
10303 __Pyx_XDECREF(__pyx_t_7);
10304 __Pyx_AddTraceback("pymusic.IndexMap.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10305 __pyx_r = -1;
10306 __pyx_L0:;
10307 __Pyx_XDECREF((PyObject *)__pyx_v_arr);
10308 __Pyx_RefNannyFinishContext();
10309 return __pyx_r;
10310 }
10311
10312 /* "pymusic.pyx":589
10313 * self.buf.items)
10314 *
10315 * def __dealloc__(self): # <<<<<<<<<<<<<<
10316 * del self.ptr
10317 *
10318 */
10319
10320 /* Python wrapper */
10321 static void __pyx_pw_7pymusic_8IndexMap_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
10322 static void __pyx_pw_7pymusic_8IndexMap_3__dealloc__(PyObject *__pyx_v_self) {
10323 __Pyx_RefNannyDeclarations
10324 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10325 __pyx_pf_7pymusic_8IndexMap_2__dealloc__(((struct __pyx_obj_7pymusic_IndexMap *)__pyx_v_self));
10326
10327 /* function exit code */
10328 __Pyx_RefNannyFinishContext();
10329 }
10330
10331 static void __pyx_pf_7pymusic_8IndexMap_2__dealloc__(struct __pyx_obj_7pymusic_IndexMap *__pyx_v_self) {
10332 __Pyx_RefNannyDeclarations
10333 __Pyx_RefNannySetupContext("__dealloc__", 0);
10334
10335 /* "pymusic.pyx":590
10336 *
10337 * def __dealloc__(self):
10338 * del self.ptr # <<<<<<<<<<<<<<
10339 *
10340 * cdef class DataMap(object):
10341 */
10342 delete __pyx_v_self->ptr;
10343
10344 /* "pymusic.pyx":589
10345 * self.buf.items)
10346 *
10347 * def __dealloc__(self): # <<<<<<<<<<<<<<
10348 * del self.ptr
10349 *
10350 */
10351
10352 /* function exit code */
10353 __Pyx_RefNannyFinishContext();
10354 }
10355
10356 /* "(tree fragment)":1
10357 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10358 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10359 * def __setstate_cython__(self, __pyx_state):
10360 */
10361
10362 /* Python wrapper */
10363 static PyObject *__pyx_pw_7pymusic_8IndexMap_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10364 static PyObject *__pyx_pw_7pymusic_8IndexMap_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10365 PyObject *__pyx_r = 0;
10366 __Pyx_RefNannyDeclarations
10367 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10368 __pyx_r = __pyx_pf_7pymusic_8IndexMap_4__reduce_cython__(((struct __pyx_obj_7pymusic_IndexMap *)__pyx_v_self));
10369
10370 /* function exit code */
10371 __Pyx_RefNannyFinishContext();
10372 return __pyx_r;
10373 }
10374
10375 static PyObject *__pyx_pf_7pymusic_8IndexMap_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_IndexMap *__pyx_v_self) {
10376 PyObject *__pyx_r = NULL;
10377 __Pyx_RefNannyDeclarations
10378 PyObject *__pyx_t_1 = NULL;
10379 int __pyx_lineno = 0;
10380 const char *__pyx_filename = NULL;
10381 int __pyx_clineno = 0;
10382 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10383
10384 /* "(tree fragment)":2
10385 * def __reduce_cython__(self):
10386 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10387 * def __setstate_cython__(self, __pyx_state):
10388 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10389 */
10390 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10391 __Pyx_GOTREF(__pyx_t_1);
10392 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10394 __PYX_ERR(1, 2, __pyx_L1_error)
10395
10396 /* "(tree fragment)":1
10397 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10398 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10399 * def __setstate_cython__(self, __pyx_state):
10400 */
10401
10402 /* function exit code */
10403 __pyx_L1_error:;
10404 __Pyx_XDECREF(__pyx_t_1);
10405 __Pyx_AddTraceback("pymusic.IndexMap.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10406 __pyx_r = NULL;
10407 __Pyx_XGIVEREF(__pyx_r);
10408 __Pyx_RefNannyFinishContext();
10409 return __pyx_r;
10410 }
10411
10412 /* "(tree fragment)":3
10413 * def __reduce_cython__(self):
10414 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10415 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10416 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10417 */
10418
10419 /* Python wrapper */
10420 static PyObject *__pyx_pw_7pymusic_8IndexMap_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10421 static PyObject *__pyx_pw_7pymusic_8IndexMap_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10422 PyObject *__pyx_r = 0;
10423 __Pyx_RefNannyDeclarations
10424 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10425 __pyx_r = __pyx_pf_7pymusic_8IndexMap_6__setstate_cython__(((struct __pyx_obj_7pymusic_IndexMap *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10426
10427 /* function exit code */
10428 __Pyx_RefNannyFinishContext();
10429 return __pyx_r;
10430 }
10431
10432 static PyObject *__pyx_pf_7pymusic_8IndexMap_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_IndexMap *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10433 PyObject *__pyx_r = NULL;
10434 __Pyx_RefNannyDeclarations
10435 PyObject *__pyx_t_1 = NULL;
10436 int __pyx_lineno = 0;
10437 const char *__pyx_filename = NULL;
10438 int __pyx_clineno = 0;
10439 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10440
10441 /* "(tree fragment)":4
10442 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10443 * def __setstate_cython__(self, __pyx_state):
10444 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10445 */
10446 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10447 __Pyx_GOTREF(__pyx_t_1);
10448 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10449 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10450 __PYX_ERR(1, 4, __pyx_L1_error)
10451
10452 /* "(tree fragment)":3
10453 * def __reduce_cython__(self):
10454 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10455 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10456 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10457 */
10458
10459 /* function exit code */
10460 __pyx_L1_error:;
10461 __Pyx_XDECREF(__pyx_t_1);
10462 __Pyx_AddTraceback("pymusic.IndexMap.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10463 __pyx_r = NULL;
10464 __Pyx_XGIVEREF(__pyx_r);
10465 __Pyx_RefNannyFinishContext();
10466 return __pyx_r;
10467 }
10468
10469 /* "pymusic.pyx":598
10470 * IndexMap to construct a mapping for the Cont*Port transfers.
10471 * """
10472 * def __cinit__(self, Buffer buf, IndexMap index_map=None, int index=0): # <<<<<<<<<<<<<<
10473 * """
10474 * Maps the Buffer of a data object between local and global indices.
10475 */
10476
10477 /* Python wrapper */
10478 static int __pyx_pw_7pymusic_7DataMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10479 static int __pyx_pw_7pymusic_7DataMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10480 struct __pyx_obj_5music_8pybuffer_Buffer *__pyx_v_buf = 0;
10481 struct __pyx_obj_7pymusic_IndexMap *__pyx_v_index_map = 0;
10482 int __pyx_v_index;
10483 int __pyx_lineno = 0;
10484 const char *__pyx_filename = NULL;
10485 int __pyx_clineno = 0;
10486 int __pyx_r;
10487 __Pyx_RefNannyDeclarations
10488 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10489 {
10490 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buf,&__pyx_n_s_index_map,&__pyx_n_s_index,0};
10491 PyObject* values[3] = {0,0,0};
10492 values[1] = (PyObject *)((struct __pyx_obj_7pymusic_IndexMap *)Py_None);
10493 if (unlikely(__pyx_kwds)) {
10494 Py_ssize_t kw_args;
10495 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10496 switch (pos_args) {
10497 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10498 CYTHON_FALLTHROUGH;
10499 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10500 CYTHON_FALLTHROUGH;
10501 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10502 CYTHON_FALLTHROUGH;
10503 case 0: break;
10504 default: goto __pyx_L5_argtuple_error;
10505 }
10506 kw_args = PyDict_Size(__pyx_kwds);
10507 switch (pos_args) {
10508 case 0:
10509 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--;
10510 else goto __pyx_L5_argtuple_error;
10511 CYTHON_FALLTHROUGH;
10512 case 1:
10513 if (kw_args > 0) {
10514 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index_map);
10515 if (value) { values[1] = value; kw_args--; }
10516 }
10517 CYTHON_FALLTHROUGH;
10518 case 2:
10519 if (kw_args > 0) {
10520 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
10521 if (value) { values[2] = value; kw_args--; }
10522 }
10523 }
10524 if (unlikely(kw_args > 0)) {
10525 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 598, __pyx_L3_error)
10526 }
10527 } else {
10528 switch (PyTuple_GET_SIZE(__pyx_args)) {
10529 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10530 CYTHON_FALLTHROUGH;
10531 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10532 CYTHON_FALLTHROUGH;
10533 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10534 break;
10535 default: goto __pyx_L5_argtuple_error;
10536 }
10537 }
10538 __pyx_v_buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)values[0]);
10539 __pyx_v_index_map = ((struct __pyx_obj_7pymusic_IndexMap *)values[1]);
10540 if (values[2]) {
10541 __pyx_v_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error)
10542 } else {
10543 __pyx_v_index = ((int)0);
10544 }
10545 }
10546 goto __pyx_L4_argument_unpacking_done;
10547 __pyx_L5_argtuple_error:;
10548 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 598, __pyx_L3_error)
10549 __pyx_L3_error:;
10550 __Pyx_AddTraceback("pymusic.DataMap.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10551 __Pyx_RefNannyFinishContext();
10552 return -1;
10553 __pyx_L4_argument_unpacking_done:;
10554 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buf), __pyx_ptype_5music_8pybuffer_Buffer, 1, "buf", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
10555 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index_map), __pyx_ptype_7pymusic_IndexMap, 1, "index_map", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
10556 __pyx_r = __pyx_pf_7pymusic_7DataMap___cinit__(((struct __pyx_obj_7pymusic_DataMap *)__pyx_v_self), __pyx_v_buf, __pyx_v_index_map, __pyx_v_index);
10557
10558 /* function exit code */
10559 goto __pyx_L0;
10560 __pyx_L1_error:;
10561 __pyx_r = -1;
10562 __pyx_L0:;
10563 __Pyx_RefNannyFinishContext();
10564 return __pyx_r;
10565 }
10566
10567 static int __pyx_pf_7pymusic_7DataMap___cinit__(struct __pyx_obj_7pymusic_DataMap *__pyx_v_self, struct __pyx_obj_5music_8pybuffer_Buffer *__pyx_v_buf, struct __pyx_obj_7pymusic_IndexMap *__pyx_v_index_map, int __pyx_v_index) {
10568 int __pyx_r;
10569 __Pyx_RefNannyDeclarations
10570 MUSIC::ArrayData *__pyx_t_1;
10571 int __pyx_t_2;
10572 __Pyx_RefNannySetupContext("__cinit__", 0);
10573
10574 /* "pymusic.pyx":606
10575 * a linear index
10576 * """
10577 * self.buf = buf # <<<<<<<<<<<<<<
10578 * self.ptr = new CArrayData(buf.pybuf.buf,
10579 * buf.dtype.ob_mpi,
10580 */
10581 __Pyx_INCREF(((PyObject *)__pyx_v_buf));
10582 __Pyx_GIVEREF(((PyObject *)__pyx_v_buf));
10583 __Pyx_GOTREF(__pyx_v_self->buf);
10584 __Pyx_DECREF(((PyObject *)__pyx_v_self->buf));
10585 __pyx_v_self->buf = __pyx_v_buf;
10586
10587 /* "pymusic.pyx":610
10588 * buf.dtype.ob_mpi,
10589 * index, buf.items) \
10590 * if index_map is None else \ # <<<<<<<<<<<<<<
10591 * new CArrayData(buf.pybuf.buf,
10592 * buf.dtype.ob_mpi,
10593 */
10594 __pyx_t_2 = (((PyObject *)__pyx_v_index_map) == Py_None);
10595 if ((__pyx_t_2 != 0)) {
10596
10597 /* "pymusic.pyx":607
10598 * """
10599 * self.buf = buf
10600 * self.ptr = new CArrayData(buf.pybuf.buf, # <<<<<<<<<<<<<<
10601 * buf.dtype.ob_mpi,
10602 * index, buf.items) \
10603 */
10604 __pyx_t_1 = new MUSIC::ArrayData(__pyx_v_buf->pybuf.buf, __pyx_v_buf->dtype->ob_mpi, __pyx_v_index, __pyx_v_buf->items);
10605 } else {
10606
10607 /* "pymusic.pyx":611
10608 * index, buf.items) \
10609 * if index_map is None else \
10610 * new CArrayData(buf.pybuf.buf, # <<<<<<<<<<<<<<
10611 * buf.dtype.ob_mpi,
10612 * index_map.ptr)
10613 */
10614 __pyx_t_1 = new MUSIC::ArrayData(__pyx_v_buf->pybuf.buf, __pyx_v_buf->dtype->ob_mpi, __pyx_v_index_map->ptr);
10615 }
10616
10617 /* "pymusic.pyx":607
10618 * """
10619 * self.buf = buf
10620 * self.ptr = new CArrayData(buf.pybuf.buf, # <<<<<<<<<<<<<<
10621 * buf.dtype.ob_mpi,
10622 * index, buf.items) \
10623 */
10624 __pyx_v_self->ptr = __pyx_t_1;
10625
10626 /* "pymusic.pyx":598
10627 * IndexMap to construct a mapping for the Cont*Port transfers.
10628 * """
10629 * def __cinit__(self, Buffer buf, IndexMap index_map=None, int index=0): # <<<<<<<<<<<<<<
10630 * """
10631 * Maps the Buffer of a data object between local and global indices.
10632 */
10633
10634 /* function exit code */
10635 __pyx_r = 0;
10636 __Pyx_RefNannyFinishContext();
10637 return __pyx_r;
10638 }
10639
10640 /* "pymusic.pyx":615
10641 * index_map.ptr)
10642 *
10643 * def __dealloc__(self): del self.ptr # <<<<<<<<<<<<<<
10644 *
10645 * cdef class EventHandler:
10646 */
10647
10648 /* Python wrapper */
10649 static void __pyx_pw_7pymusic_7DataMap_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
10650 static void __pyx_pw_7pymusic_7DataMap_3__dealloc__(PyObject *__pyx_v_self) {
10651 __Pyx_RefNannyDeclarations
10652 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10653 __pyx_pf_7pymusic_7DataMap_2__dealloc__(((struct __pyx_obj_7pymusic_DataMap *)__pyx_v_self));
10654
10655 /* function exit code */
10656 __Pyx_RefNannyFinishContext();
10657 }
10658
10659 static void __pyx_pf_7pymusic_7DataMap_2__dealloc__(struct __pyx_obj_7pymusic_DataMap *__pyx_v_self) {
10660 __Pyx_RefNannyDeclarations
10661 __Pyx_RefNannySetupContext("__dealloc__", 0);
10662 delete __pyx_v_self->ptr;
10663
10664 /* function exit code */
10665 __Pyx_RefNannyFinishContext();
10666 }
10667
10668 /* "(tree fragment)":1
10669 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10670 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10671 * def __setstate_cython__(self, __pyx_state):
10672 */
10673
10674 /* Python wrapper */
10675 static PyObject *__pyx_pw_7pymusic_7DataMap_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10676 static PyObject *__pyx_pw_7pymusic_7DataMap_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10677 PyObject *__pyx_r = 0;
10678 __Pyx_RefNannyDeclarations
10679 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10680 __pyx_r = __pyx_pf_7pymusic_7DataMap_4__reduce_cython__(((struct __pyx_obj_7pymusic_DataMap *)__pyx_v_self));
10681
10682 /* function exit code */
10683 __Pyx_RefNannyFinishContext();
10684 return __pyx_r;
10685 }
10686
10687 static PyObject *__pyx_pf_7pymusic_7DataMap_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_DataMap *__pyx_v_self) {
10688 PyObject *__pyx_r = NULL;
10689 __Pyx_RefNannyDeclarations
10690 PyObject *__pyx_t_1 = NULL;
10691 int __pyx_lineno = 0;
10692 const char *__pyx_filename = NULL;
10693 int __pyx_clineno = 0;
10694 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10695
10696 /* "(tree fragment)":2
10697 * def __reduce_cython__(self):
10698 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10699 * def __setstate_cython__(self, __pyx_state):
10700 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10701 */
10702 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10703 __Pyx_GOTREF(__pyx_t_1);
10704 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10705 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10706 __PYX_ERR(1, 2, __pyx_L1_error)
10707
10708 /* "(tree fragment)":1
10709 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10710 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10711 * def __setstate_cython__(self, __pyx_state):
10712 */
10713
10714 /* function exit code */
10715 __pyx_L1_error:;
10716 __Pyx_XDECREF(__pyx_t_1);
10717 __Pyx_AddTraceback("pymusic.DataMap.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10718 __pyx_r = NULL;
10719 __Pyx_XGIVEREF(__pyx_r);
10720 __Pyx_RefNannyFinishContext();
10721 return __pyx_r;
10722 }
10723
10724 /* "(tree fragment)":3
10725 * def __reduce_cython__(self):
10726 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10727 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10728 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10729 */
10730
10731 /* Python wrapper */
10732 static PyObject *__pyx_pw_7pymusic_7DataMap_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10733 static PyObject *__pyx_pw_7pymusic_7DataMap_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10734 PyObject *__pyx_r = 0;
10735 __Pyx_RefNannyDeclarations
10736 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10737 __pyx_r = __pyx_pf_7pymusic_7DataMap_6__setstate_cython__(((struct __pyx_obj_7pymusic_DataMap *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10738
10739 /* function exit code */
10740 __Pyx_RefNannyFinishContext();
10741 return __pyx_r;
10742 }
10743
10744 static PyObject *__pyx_pf_7pymusic_7DataMap_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_DataMap *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10745 PyObject *__pyx_r = NULL;
10746 __Pyx_RefNannyDeclarations
10747 PyObject *__pyx_t_1 = NULL;
10748 int __pyx_lineno = 0;
10749 const char *__pyx_filename = NULL;
10750 int __pyx_clineno = 0;
10751 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10752
10753 /* "(tree fragment)":4
10754 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10755 * def __setstate_cython__(self, __pyx_state):
10756 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10757 */
10758 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10759 __Pyx_GOTREF(__pyx_t_1);
10760 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10761 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10762 __PYX_ERR(1, 4, __pyx_L1_error)
10763
10764 /* "(tree fragment)":3
10765 * def __reduce_cython__(self):
10766 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10767 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10768 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10769 */
10770
10771 /* function exit code */
10772 __pyx_L1_error:;
10773 __Pyx_XDECREF(__pyx_t_1);
10774 __Pyx_AddTraceback("pymusic.DataMap.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10775 __pyx_r = NULL;
10776 __Pyx_XGIVEREF(__pyx_r);
10777 __Pyx_RefNannyFinishContext();
10778 return __pyx_r;
10779 }
10780
10781 /* "pymusic.pyx":623
10782 * or local EventHandler object for EventInputPort
10783 * """
10784 * def __cinit__(self, object func, IndexType t): # <<<<<<<<<<<<<<
10785 * """
10786 * func: a callable of the form
10787 */
10788
10789 /* Python wrapper */
10790 static int __pyx_pw_7pymusic_12EventHandler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10791 static int __pyx_pw_7pymusic_12EventHandler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10792 PyObject *__pyx_v_func = 0;
10793 MUSIC::Index::Type __pyx_v_t;
10794 int __pyx_lineno = 0;
10795 const char *__pyx_filename = NULL;
10796 int __pyx_clineno = 0;
10797 int __pyx_r;
10798 __Pyx_RefNannyDeclarations
10799 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10800 {
10801 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_t,0};
10802 PyObject* values[2] = {0,0};
10803 if (unlikely(__pyx_kwds)) {
10804 Py_ssize_t kw_args;
10805 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10806 switch (pos_args) {
10807 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10808 CYTHON_FALLTHROUGH;
10809 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10810 CYTHON_FALLTHROUGH;
10811 case 0: break;
10812 default: goto __pyx_L5_argtuple_error;
10813 }
10814 kw_args = PyDict_Size(__pyx_kwds);
10815 switch (pos_args) {
10816 case 0:
10817 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
10818 else goto __pyx_L5_argtuple_error;
10819 CYTHON_FALLTHROUGH;
10820 case 1:
10821 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
10822 else {
10823 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 623, __pyx_L3_error)
10824 }
10825 }
10826 if (unlikely(kw_args > 0)) {
10827 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 623, __pyx_L3_error)
10828 }
10829 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10830 goto __pyx_L5_argtuple_error;
10831 } else {
10832 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10833 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10834 }
10835 __pyx_v_func = values[0];
10836 __pyx_v_t = ((MUSIC::Index::Type)__Pyx_PyInt_As_MUSIC_3a__3a_Index_3a__3a_Type(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L3_error)
10837 }
10838 goto __pyx_L4_argument_unpacking_done;
10839 __pyx_L5_argtuple_error:;
10840 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 623, __pyx_L3_error)
10841 __pyx_L3_error:;
10842 __Pyx_AddTraceback("pymusic.EventHandler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10843 __Pyx_RefNannyFinishContext();
10844 return -1;
10845 __pyx_L4_argument_unpacking_done:;
10846 __pyx_r = __pyx_pf_7pymusic_12EventHandler___cinit__(((struct __pyx_obj_7pymusic_EventHandler *)__pyx_v_self), __pyx_v_func, __pyx_v_t);
10847
10848 /* function exit code */
10849 __Pyx_RefNannyFinishContext();
10850 return __pyx_r;
10851 }
10852
10853 static int __pyx_pf_7pymusic_12EventHandler___cinit__(struct __pyx_obj_7pymusic_EventHandler *__pyx_v_self, PyObject *__pyx_v_func, MUSIC::Index::Type __pyx_v_t) {
10854 int __pyx_r;
10855 __Pyx_RefNannyDeclarations
10856 MUSIC::EventHandler *__pyx_t_1;
10857 __Pyx_RefNannySetupContext("__cinit__", 0);
10858
10859 /* "pymusic.pyx":636
10860 * self.ptr = <CEventHandler*> \
10861 * new CEHGlobal(<PyObject*>func) \
10862 * if t == IndexGLOBAL else \ # <<<<<<<<<<<<<<
10863 * <CEventHandler*> \
10864 * new CEHLocal(<PyObject*>func)
10865 */
10866 if (((__pyx_v_t == MUSIC::Index::GLOBAL) != 0)) {
10867
10868 /* "pymusic.pyx":634
10869 * to generalize func like this??)
10870 * """
10871 * self.ptr = <CEventHandler*> \ # <<<<<<<<<<<<<<
10872 * new CEHGlobal(<PyObject*>func) \
10873 * if t == IndexGLOBAL else \
10874 */
10875 __pyx_t_1 = ((MUSIC::EventHandler *)new MUSIC::EHGlobal(((PyObject *)__pyx_v_func)));
10876 } else {
10877
10878 /* "pymusic.pyx":637
10879 * new CEHGlobal(<PyObject*>func) \
10880 * if t == IndexGLOBAL else \
10881 * <CEventHandler*> \ # <<<<<<<<<<<<<<
10882 * new CEHLocal(<PyObject*>func)
10883 * self.func = func
10884 */
10885 __pyx_t_1 = ((MUSIC::EventHandler *)new MUSIC::EHLocal(((PyObject *)__pyx_v_func)));
10886 }
10887
10888 /* "pymusic.pyx":634
10889 * to generalize func like this??)
10890 * """
10891 * self.ptr = <CEventHandler*> \ # <<<<<<<<<<<<<<
10892 * new CEHGlobal(<PyObject*>func) \
10893 * if t == IndexGLOBAL else \
10894 */
10895 __pyx_v_self->ptr = __pyx_t_1;
10896
10897 /* "pymusic.pyx":639
10898 * <CEventHandler*> \
10899 * new CEHLocal(<PyObject*>func)
10900 * self.func = func # <<<<<<<<<<<<<<
10901 *
10902 * def __dealloc__(self): del self.ptr
10903 */
10904 __Pyx_INCREF(__pyx_v_func);
10905 __Pyx_GIVEREF(__pyx_v_func);
10906 __Pyx_GOTREF(__pyx_v_self->func);
10907 __Pyx_DECREF(__pyx_v_self->func);
10908 __pyx_v_self->func = __pyx_v_func;
10909
10910 /* "pymusic.pyx":623
10911 * or local EventHandler object for EventInputPort
10912 * """
10913 * def __cinit__(self, object func, IndexType t): # <<<<<<<<<<<<<<
10914 * """
10915 * func: a callable of the form
10916 */
10917
10918 /* function exit code */
10919 __pyx_r = 0;
10920 __Pyx_RefNannyFinishContext();
10921 return __pyx_r;
10922 }
10923
10924 /* "pymusic.pyx":641
10925 * self.func = func
10926 *
10927 * def __dealloc__(self): del self.ptr # <<<<<<<<<<<<<<
10928 *
10929 * cdef class _Index:
10930 */
10931
10932 /* Python wrapper */
10933 static void __pyx_pw_7pymusic_12EventHandler_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
10934 static void __pyx_pw_7pymusic_12EventHandler_3__dealloc__(PyObject *__pyx_v_self) {
10935 __Pyx_RefNannyDeclarations
10936 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10937 __pyx_pf_7pymusic_12EventHandler_2__dealloc__(((struct __pyx_obj_7pymusic_EventHandler *)__pyx_v_self));
10938
10939 /* function exit code */
10940 __Pyx_RefNannyFinishContext();
10941 }
10942
10943 static void __pyx_pf_7pymusic_12EventHandler_2__dealloc__(struct __pyx_obj_7pymusic_EventHandler *__pyx_v_self) {
10944 __Pyx_RefNannyDeclarations
10945 __Pyx_RefNannySetupContext("__dealloc__", 0);
10946 delete __pyx_v_self->ptr;
10947
10948 /* function exit code */
10949 __Pyx_RefNannyFinishContext();
10950 }
10951
10952 /* "(tree fragment)":1
10953 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10954 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10955 * def __setstate_cython__(self, __pyx_state):
10956 */
10957
10958 /* Python wrapper */
10959 static PyObject *__pyx_pw_7pymusic_12EventHandler_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10960 static PyObject *__pyx_pw_7pymusic_12EventHandler_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10961 PyObject *__pyx_r = 0;
10962 __Pyx_RefNannyDeclarations
10963 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10964 __pyx_r = __pyx_pf_7pymusic_12EventHandler_4__reduce_cython__(((struct __pyx_obj_7pymusic_EventHandler *)__pyx_v_self));
10965
10966 /* function exit code */
10967 __Pyx_RefNannyFinishContext();
10968 return __pyx_r;
10969 }
10970
10971 static PyObject *__pyx_pf_7pymusic_12EventHandler_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventHandler *__pyx_v_self) {
10972 PyObject *__pyx_r = NULL;
10973 __Pyx_RefNannyDeclarations
10974 PyObject *__pyx_t_1 = NULL;
10975 int __pyx_lineno = 0;
10976 const char *__pyx_filename = NULL;
10977 int __pyx_clineno = 0;
10978 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10979
10980 /* "(tree fragment)":2
10981 * def __reduce_cython__(self):
10982 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10983 * def __setstate_cython__(self, __pyx_state):
10984 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10985 */
10986 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10987 __Pyx_GOTREF(__pyx_t_1);
10988 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10989 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10990 __PYX_ERR(1, 2, __pyx_L1_error)
10991
10992 /* "(tree fragment)":1
10993 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10994 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10995 * def __setstate_cython__(self, __pyx_state):
10996 */
10997
10998 /* function exit code */
10999 __pyx_L1_error:;
11000 __Pyx_XDECREF(__pyx_t_1);
11001 __Pyx_AddTraceback("pymusic.EventHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11002 __pyx_r = NULL;
11003 __Pyx_XGIVEREF(__pyx_r);
11004 __Pyx_RefNannyFinishContext();
11005 return __pyx_r;
11006 }
11007
11008 /* "(tree fragment)":3
11009 * def __reduce_cython__(self):
11010 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11011 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11012 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11013 */
11014
11015 /* Python wrapper */
11016 static PyObject *__pyx_pw_7pymusic_12EventHandler_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11017 static PyObject *__pyx_pw_7pymusic_12EventHandler_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11018 PyObject *__pyx_r = 0;
11019 __Pyx_RefNannyDeclarations
11020 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11021 __pyx_r = __pyx_pf_7pymusic_12EventHandler_6__setstate_cython__(((struct __pyx_obj_7pymusic_EventHandler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11022
11023 /* function exit code */
11024 __Pyx_RefNannyFinishContext();
11025 return __pyx_r;
11026 }
11027
11028 static PyObject *__pyx_pf_7pymusic_12EventHandler_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_EventHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11029 PyObject *__pyx_r = NULL;
11030 __Pyx_RefNannyDeclarations
11031 PyObject *__pyx_t_1 = NULL;
11032 int __pyx_lineno = 0;
11033 const char *__pyx_filename = NULL;
11034 int __pyx_clineno = 0;
11035 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11036
11037 /* "(tree fragment)":4
11038 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11039 * def __setstate_cython__(self, __pyx_state):
11040 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11041 */
11042 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11043 __Pyx_GOTREF(__pyx_t_1);
11044 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11045 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11046 __PYX_ERR(1, 4, __pyx_L1_error)
11047
11048 /* "(tree fragment)":3
11049 * def __reduce_cython__(self):
11050 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11051 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11052 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11053 */
11054
11055 /* function exit code */
11056 __pyx_L1_error:;
11057 __Pyx_XDECREF(__pyx_t_1);
11058 __Pyx_AddTraceback("pymusic.EventHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11059 __pyx_r = NULL;
11060 __Pyx_XGIVEREF(__pyx_r);
11061 __Pyx_RefNannyFinishContext();
11062 return __pyx_r;
11063 }
11064
11065 /* "pymusic.pyx":655
11066 * cdef readonly dict backmap
11067 *
11068 * def __cinit__(self): # <<<<<<<<<<<<<<
11069 * """ SINGLETON """
11070 * self.GLOBAL = IndexGLOBAL
11071 */
11072
11073 /* Python wrapper */
11074 static int __pyx_pw_7pymusic_6_Index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11075 static int __pyx_pw_7pymusic_6_Index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11076 int __pyx_r;
11077 __Pyx_RefNannyDeclarations
11078 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11079 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
11080 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
11081 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
11082 __pyx_r = __pyx_pf_7pymusic_6_Index___cinit__(((struct __pyx_obj_7pymusic__Index *)__pyx_v_self));
11083
11084 /* function exit code */
11085 __Pyx_RefNannyFinishContext();
11086 return __pyx_r;
11087 }
11088
11089 static int __pyx_pf_7pymusic_6_Index___cinit__(struct __pyx_obj_7pymusic__Index *__pyx_v_self) {
11090 int __pyx_r;
11091 __Pyx_RefNannyDeclarations
11092 PyObject *__pyx_t_1 = NULL;
11093 PyObject *__pyx_t_2 = NULL;
11094 int __pyx_lineno = 0;
11095 const char *__pyx_filename = NULL;
11096 int __pyx_clineno = 0;
11097 __Pyx_RefNannySetupContext("__cinit__", 0);
11098
11099 /* "pymusic.pyx":657
11100 * def __cinit__(self):
11101 * """ SINGLETON """
11102 * self.GLOBAL = IndexGLOBAL # <<<<<<<<<<<<<<
11103 * self.LOCAL = IndexLOCAL
11104 * self.backmap = {
11105 */
11106 __pyx_v_self->GLOBAL = MUSIC::Index::GLOBAL;
11107
11108 /* "pymusic.pyx":658
11109 * """ SINGLETON """
11110 * self.GLOBAL = IndexGLOBAL
11111 * self.LOCAL = IndexLOCAL # <<<<<<<<<<<<<<
11112 * self.backmap = {
11113 * IndexGLOBAL: "GLOBAL",
11114 */
11115 __pyx_v_self->LOCAL = MUSIC::Index::LOCAL;
11116
11117 /* "pymusic.pyx":660
11118 * self.LOCAL = IndexLOCAL
11119 * self.backmap = {
11120 * IndexGLOBAL: "GLOBAL", # <<<<<<<<<<<<<<
11121 * IndexLOCAL: "LOCAL"
11122 * };
11123 */
11124 __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
11125 __Pyx_GOTREF(__pyx_t_1);
11126 __pyx_t_2 = __Pyx_PyInt_From_MUSIC_3a__3a_Index_3a__3a_Type(MUSIC::Index::GLOBAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
11127 __Pyx_GOTREF(__pyx_t_2);
11128 if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_n_s_GLOBAL) < 0) __PYX_ERR(0, 660, __pyx_L1_error)
11129 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11130
11131 /* "pymusic.pyx":661
11132 * self.backmap = {
11133 * IndexGLOBAL: "GLOBAL",
11134 * IndexLOCAL: "LOCAL" # <<<<<<<<<<<<<<
11135 * };
11136 *
11137 */
11138 __pyx_t_2 = __Pyx_PyInt_From_MUSIC_3a__3a_Index_3a__3a_Type(MUSIC::Index::LOCAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
11139 __Pyx_GOTREF(__pyx_t_2);
11140 if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_n_s_LOCAL) < 0) __PYX_ERR(0, 660, __pyx_L1_error)
11141 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11142
11143 /* "pymusic.pyx":659
11144 * self.GLOBAL = IndexGLOBAL
11145 * self.LOCAL = IndexLOCAL
11146 * self.backmap = { # <<<<<<<<<<<<<<
11147 * IndexGLOBAL: "GLOBAL",
11148 * IndexLOCAL: "LOCAL"
11149 */
11150 __Pyx_GIVEREF(__pyx_t_1);
11151 __Pyx_GOTREF(__pyx_v_self->backmap);
11152 __Pyx_DECREF(__pyx_v_self->backmap);
11153 __pyx_v_self->backmap = ((PyObject*)__pyx_t_1);
11154 __pyx_t_1 = 0;
11155
11156 /* "pymusic.pyx":655
11157 * cdef readonly dict backmap
11158 *
11159 * def __cinit__(self): # <<<<<<<<<<<<<<
11160 * """ SINGLETON """
11161 * self.GLOBAL = IndexGLOBAL
11162 */
11163
11164 /* function exit code */
11165 __pyx_r = 0;
11166 goto __pyx_L0;
11167 __pyx_L1_error:;
11168 __Pyx_XDECREF(__pyx_t_1);
11169 __Pyx_XDECREF(__pyx_t_2);
11170 __Pyx_AddTraceback("pymusic._Index.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11171 __pyx_r = -1;
11172 __pyx_L0:;
11173 __Pyx_RefNannyFinishContext();
11174 return __pyx_r;
11175 }
11176
11177 /* "pymusic.pyx":664
11178 * };
11179 *
11180 * def tostr(self, int index): # <<<<<<<<<<<<<<
11181 * """" tostring(Index.{GLOBAL,LOCAL}) --> "{GLOBAL,LOCAL}" """
11182 * return self.backmap[index]
11183 */
11184
11185 /* Python wrapper */
11186 static PyObject *__pyx_pw_7pymusic_6_Index_3tostr(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
11187 static char __pyx_doc_7pymusic_6_Index_2tostr[] = "\" tostring(Index.{GLOBAL,LOCAL}) --> \"{GLOBAL,LOCAL}\" ";
11188 static PyObject *__pyx_pw_7pymusic_6_Index_3tostr(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
11189 int __pyx_v_index;
11190 int __pyx_lineno = 0;
11191 const char *__pyx_filename = NULL;
11192 int __pyx_clineno = 0;
11193 PyObject *__pyx_r = 0;
11194 __Pyx_RefNannyDeclarations
11195 __Pyx_RefNannySetupContext("tostr (wrapper)", 0);
11196 assert(__pyx_arg_index); {
11197 __pyx_v_index = __Pyx_PyInt_As_int(__pyx_arg_index); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error)
11198 }
11199 goto __pyx_L4_argument_unpacking_done;
11200 __pyx_L3_error:;
11201 __Pyx_AddTraceback("pymusic._Index.tostr", __pyx_clineno, __pyx_lineno, __pyx_filename);
11202 __Pyx_RefNannyFinishContext();
11203 return NULL;
11204 __pyx_L4_argument_unpacking_done:;
11205 __pyx_r = __pyx_pf_7pymusic_6_Index_2tostr(((struct __pyx_obj_7pymusic__Index *)__pyx_v_self), ((int)__pyx_v_index));
11206
11207 /* function exit code */
11208 __Pyx_RefNannyFinishContext();
11209 return __pyx_r;
11210 }
11211
11212 static PyObject *__pyx_pf_7pymusic_6_Index_2tostr(struct __pyx_obj_7pymusic__Index *__pyx_v_self, int __pyx_v_index) {
11213 PyObject *__pyx_r = NULL;
11214 __Pyx_RefNannyDeclarations
11215 PyObject *__pyx_t_1 = NULL;
11216 PyObject *__pyx_t_2 = NULL;
11217 int __pyx_lineno = 0;
11218 const char *__pyx_filename = NULL;
11219 int __pyx_clineno = 0;
11220 __Pyx_RefNannySetupContext("tostr", 0);
11221
11222 /* "pymusic.pyx":666
11223 * def tostr(self, int index):
11224 * """" tostring(Index.{GLOBAL,LOCAL}) --> "{GLOBAL,LOCAL}" """
11225 * return self.backmap[index] # <<<<<<<<<<<<<<
11226 *
11227 * # And here is the singleton def
11228 */
11229 __Pyx_XDECREF(__pyx_r);
11230 if (unlikely(__pyx_v_self->backmap == Py_None)) {
11231 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
11232 __PYX_ERR(0, 666, __pyx_L1_error)
11233 }
11234 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
11235 __Pyx_GOTREF(__pyx_t_1);
11236 __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->backmap, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
11237 __Pyx_GOTREF(__pyx_t_2);
11238 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11239 __pyx_r = __pyx_t_2;
11240 __pyx_t_2 = 0;
11241 goto __pyx_L0;
11242
11243 /* "pymusic.pyx":664
11244 * };
11245 *
11246 * def tostr(self, int index): # <<<<<<<<<<<<<<
11247 * """" tostring(Index.{GLOBAL,LOCAL}) --> "{GLOBAL,LOCAL}" """
11248 * return self.backmap[index]
11249 */
11250
11251 /* function exit code */
11252 __pyx_L1_error:;
11253 __Pyx_XDECREF(__pyx_t_1);
11254 __Pyx_XDECREF(__pyx_t_2);
11255 __Pyx_AddTraceback("pymusic._Index.tostr", __pyx_clineno, __pyx_lineno, __pyx_filename);
11256 __pyx_r = NULL;
11257 __pyx_L0:;
11258 __Pyx_XGIVEREF(__pyx_r);
11259 __Pyx_RefNannyFinishContext();
11260 return __pyx_r;
11261 }
11262
11263 /* "pymusic.pyx":651
11264 * purposes
11265 * """
11266 * cdef readonly int GLOBAL # <<<<<<<<<<<<<<
11267 * cdef readonly int LOCAL
11268 * cdef readonly dict backmap
11269 */
11270
11271 /* Python wrapper */
11272 static PyObject *__pyx_pw_7pymusic_6_Index_6GLOBAL_1__get__(PyObject *__pyx_v_self); /*proto*/
11273 static PyObject *__pyx_pw_7pymusic_6_Index_6GLOBAL_1__get__(PyObject *__pyx_v_self) {
11274 PyObject *__pyx_r = 0;
11275 __Pyx_RefNannyDeclarations
11276 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11277 __pyx_r = __pyx_pf_7pymusic_6_Index_6GLOBAL___get__(((struct __pyx_obj_7pymusic__Index *)__pyx_v_self));
11278
11279 /* function exit code */
11280 __Pyx_RefNannyFinishContext();
11281 return __pyx_r;
11282 }
11283
11284 static PyObject *__pyx_pf_7pymusic_6_Index_6GLOBAL___get__(struct __pyx_obj_7pymusic__Index *__pyx_v_self) {
11285 PyObject *__pyx_r = NULL;
11286 __Pyx_RefNannyDeclarations
11287 PyObject *__pyx_t_1 = NULL;
11288 int __pyx_lineno = 0;
11289 const char *__pyx_filename = NULL;
11290 int __pyx_clineno = 0;
11291 __Pyx_RefNannySetupContext("__get__", 0);
11292 __Pyx_XDECREF(__pyx_r);
11293 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->GLOBAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
11294 __Pyx_GOTREF(__pyx_t_1);
11295 __pyx_r = __pyx_t_1;
11296 __pyx_t_1 = 0;
11297 goto __pyx_L0;
11298
11299 /* function exit code */
11300 __pyx_L1_error:;
11301 __Pyx_XDECREF(__pyx_t_1);
11302 __Pyx_AddTraceback("pymusic._Index.GLOBAL.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11303 __pyx_r = NULL;
11304 __pyx_L0:;
11305 __Pyx_XGIVEREF(__pyx_r);
11306 __Pyx_RefNannyFinishContext();
11307 return __pyx_r;
11308 }
11309
11310 /* "pymusic.pyx":652
11311 * """
11312 * cdef readonly int GLOBAL
11313 * cdef readonly int LOCAL # <<<<<<<<<<<<<<
11314 * cdef readonly dict backmap
11315 *
11316 */
11317
11318 /* Python wrapper */
11319 static PyObject *__pyx_pw_7pymusic_6_Index_5LOCAL_1__get__(PyObject *__pyx_v_self); /*proto*/
11320 static PyObject *__pyx_pw_7pymusic_6_Index_5LOCAL_1__get__(PyObject *__pyx_v_self) {
11321 PyObject *__pyx_r = 0;
11322 __Pyx_RefNannyDeclarations
11323 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11324 __pyx_r = __pyx_pf_7pymusic_6_Index_5LOCAL___get__(((struct __pyx_obj_7pymusic__Index *)__pyx_v_self));
11325
11326 /* function exit code */
11327 __Pyx_RefNannyFinishContext();
11328 return __pyx_r;
11329 }
11330
11331 static PyObject *__pyx_pf_7pymusic_6_Index_5LOCAL___get__(struct __pyx_obj_7pymusic__Index *__pyx_v_self) {
11332 PyObject *__pyx_r = NULL;
11333 __Pyx_RefNannyDeclarations
11334 PyObject *__pyx_t_1 = NULL;
11335 int __pyx_lineno = 0;
11336 const char *__pyx_filename = NULL;
11337 int __pyx_clineno = 0;
11338 __Pyx_RefNannySetupContext("__get__", 0);
11339 __Pyx_XDECREF(__pyx_r);
11340 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->LOCAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
11341 __Pyx_GOTREF(__pyx_t_1);
11342 __pyx_r = __pyx_t_1;
11343 __pyx_t_1 = 0;
11344 goto __pyx_L0;
11345
11346 /* function exit code */
11347 __pyx_L1_error:;
11348 __Pyx_XDECREF(__pyx_t_1);
11349 __Pyx_AddTraceback("pymusic._Index.LOCAL.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11350 __pyx_r = NULL;
11351 __pyx_L0:;
11352 __Pyx_XGIVEREF(__pyx_r);
11353 __Pyx_RefNannyFinishContext();
11354 return __pyx_r;
11355 }
11356
11357 /* "pymusic.pyx":653
11358 * cdef readonly int GLOBAL
11359 * cdef readonly int LOCAL
11360 * cdef readonly dict backmap # <<<<<<<<<<<<<<
11361 *
11362 * def __cinit__(self):
11363 */
11364
11365 /* Python wrapper */
11366 static PyObject *__pyx_pw_7pymusic_6_Index_7backmap_1__get__(PyObject *__pyx_v_self); /*proto*/
11367 static PyObject *__pyx_pw_7pymusic_6_Index_7backmap_1__get__(PyObject *__pyx_v_self) {
11368 PyObject *__pyx_r = 0;
11369 __Pyx_RefNannyDeclarations
11370 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11371 __pyx_r = __pyx_pf_7pymusic_6_Index_7backmap___get__(((struct __pyx_obj_7pymusic__Index *)__pyx_v_self));
11372
11373 /* function exit code */
11374 __Pyx_RefNannyFinishContext();
11375 return __pyx_r;
11376 }
11377
11378 static PyObject *__pyx_pf_7pymusic_6_Index_7backmap___get__(struct __pyx_obj_7pymusic__Index *__pyx_v_self) {
11379 PyObject *__pyx_r = NULL;
11380 __Pyx_RefNannyDeclarations
11381 __Pyx_RefNannySetupContext("__get__", 0);
11382 __Pyx_XDECREF(__pyx_r);
11383 __Pyx_INCREF(__pyx_v_self->backmap);
11384 __pyx_r = __pyx_v_self->backmap;
11385 goto __pyx_L0;
11386
11387 /* function exit code */
11388 __pyx_L0:;
11389 __Pyx_XGIVEREF(__pyx_r);
11390 __Pyx_RefNannyFinishContext();
11391 return __pyx_r;
11392 }
11393
11394 /* "(tree fragment)":1
11395 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11396 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11397 * def __setstate_cython__(self, __pyx_state):
11398 */
11399
11400 /* Python wrapper */
11401 static PyObject *__pyx_pw_7pymusic_6_Index_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11402 static PyObject *__pyx_pw_7pymusic_6_Index_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11403 PyObject *__pyx_r = 0;
11404 __Pyx_RefNannyDeclarations
11405 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11406 __pyx_r = __pyx_pf_7pymusic_6_Index_4__reduce_cython__(((struct __pyx_obj_7pymusic__Index *)__pyx_v_self));
11407
11408 /* function exit code */
11409 __Pyx_RefNannyFinishContext();
11410 return __pyx_r;
11411 }
11412
11413 static PyObject *__pyx_pf_7pymusic_6_Index_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic__Index *__pyx_v_self) {
11414 PyObject *__pyx_r = NULL;
11415 __Pyx_RefNannyDeclarations
11416 PyObject *__pyx_t_1 = NULL;
11417 int __pyx_lineno = 0;
11418 const char *__pyx_filename = NULL;
11419 int __pyx_clineno = 0;
11420 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11421
11422 /* "(tree fragment)":2
11423 * def __reduce_cython__(self):
11424 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11425 * def __setstate_cython__(self, __pyx_state):
11426 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11427 */
11428 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11429 __Pyx_GOTREF(__pyx_t_1);
11430 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11431 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11432 __PYX_ERR(1, 2, __pyx_L1_error)
11433
11434 /* "(tree fragment)":1
11435 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11436 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11437 * def __setstate_cython__(self, __pyx_state):
11438 */
11439
11440 /* function exit code */
11441 __pyx_L1_error:;
11442 __Pyx_XDECREF(__pyx_t_1);
11443 __Pyx_AddTraceback("pymusic._Index.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11444 __pyx_r = NULL;
11445 __Pyx_XGIVEREF(__pyx_r);
11446 __Pyx_RefNannyFinishContext();
11447 return __pyx_r;
11448 }
11449
11450 /* "(tree fragment)":3
11451 * def __reduce_cython__(self):
11452 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11453 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11454 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11455 */
11456
11457 /* Python wrapper */
11458 static PyObject *__pyx_pw_7pymusic_6_Index_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11459 static PyObject *__pyx_pw_7pymusic_6_Index_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11460 PyObject *__pyx_r = 0;
11461 __Pyx_RefNannyDeclarations
11462 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11463 __pyx_r = __pyx_pf_7pymusic_6_Index_6__setstate_cython__(((struct __pyx_obj_7pymusic__Index *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11464
11465 /* function exit code */
11466 __Pyx_RefNannyFinishContext();
11467 return __pyx_r;
11468 }
11469
11470 static PyObject *__pyx_pf_7pymusic_6_Index_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic__Index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11471 PyObject *__pyx_r = NULL;
11472 __Pyx_RefNannyDeclarations
11473 PyObject *__pyx_t_1 = NULL;
11474 int __pyx_lineno = 0;
11475 const char *__pyx_filename = NULL;
11476 int __pyx_clineno = 0;
11477 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11478
11479 /* "(tree fragment)":4
11480 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11481 * def __setstate_cython__(self, __pyx_state):
11482 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11483 */
11484 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11485 __Pyx_GOTREF(__pyx_t_1);
11486 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11487 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11488 __PYX_ERR(1, 4, __pyx_L1_error)
11489
11490 /* "(tree fragment)":3
11491 * def __reduce_cython__(self):
11492 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11493 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11494 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11495 */
11496
11497 /* function exit code */
11498 __pyx_L1_error:;
11499 __Pyx_XDECREF(__pyx_t_1);
11500 __Pyx_AddTraceback("pymusic._Index.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11501 __pyx_r = NULL;
11502 __Pyx_XGIVEREF(__pyx_r);
11503 __Pyx_RefNannyFinishContext();
11504 return __pyx_r;
11505 }
11506
11507 /* "pymusic.pyx":671
11508 * Index = _Index()
11509 *
11510 * cdef cbool EventCallback(PyObject* func, # <<<<<<<<<<<<<<
11511 * double d,
11512 * IndexType t,
11513 */
11514
11515 bool MUSIC::EventCallback(PyObject *__pyx_v_func, double __pyx_v_d, MUSIC::Index::Type __pyx_v_t, int __pyx_v_i) {
11516 bool __pyx_r;
11517 __Pyx_RefNannyDeclarations
11518 PyObject *__pyx_t_1 = NULL;
11519 PyObject *__pyx_t_2 = NULL;
11520 PyObject *__pyx_t_3 = NULL;
11521 PyObject *__pyx_t_4 = NULL;
11522 PyObject *__pyx_t_5 = NULL;
11523 PyObject *__pyx_t_6 = NULL;
11524 int __pyx_t_7;
11525 PyObject *__pyx_t_8 = NULL;
11526 int __pyx_lineno = 0;
11527 const char *__pyx_filename = NULL;
11528 int __pyx_clineno = 0;
11529 __Pyx_RefNannySetupContext("EventCallback", 0);
11530
11531 /* "pymusic.pyx":683
11532 * int i: index of event
11533 * """
11534 * (<object>func)(d, t, i) # <<<<<<<<<<<<<<
11535 * return True
11536 *
11537 */
11538 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
11539 __Pyx_GOTREF(__pyx_t_2);
11540 __pyx_t_3 = __Pyx_PyInt_From_MUSIC_3a__3a_Index_3a__3a_Type(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error)
11541 __Pyx_GOTREF(__pyx_t_3);
11542 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error)
11543 __Pyx_GOTREF(__pyx_t_4);
11544 __Pyx_INCREF(((PyObject *)__pyx_v_func));
11545 __pyx_t_5 = ((PyObject *)__pyx_v_func); __pyx_t_6 = NULL;
11546 __pyx_t_7 = 0;
11547 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
11548 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
11549 if (likely(__pyx_t_6)) {
11550 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11551 __Pyx_INCREF(__pyx_t_6);
11552 __Pyx_INCREF(function);
11553 __Pyx_DECREF_SET(__pyx_t_5, function);
11554 __pyx_t_7 = 1;
11555 }
11556 }
11557 #if CYTHON_FAST_PYCALL
11558 if (PyFunction_Check(__pyx_t_5)) {
11559 PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_2, __pyx_t_3, __pyx_t_4};
11560 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
11561 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11562 __Pyx_GOTREF(__pyx_t_1);
11563 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11564 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11565 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11566 } else
11567 #endif
11568 #if CYTHON_FAST_PYCCALL
11569 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11570 PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_2, __pyx_t_3, __pyx_t_4};
11571 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
11572 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11573 __Pyx_GOTREF(__pyx_t_1);
11574 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11575 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11576 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11577 } else
11578 #endif
11579 {
11580 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L1_error)
11581 __Pyx_GOTREF(__pyx_t_8);
11582 if (__pyx_t_6) {
11583 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
11584 }
11585 __Pyx_GIVEREF(__pyx_t_2);
11586 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_2);
11587 __Pyx_GIVEREF(__pyx_t_3);
11588 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
11589 __Pyx_GIVEREF(__pyx_t_4);
11590 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4);
11591 __pyx_t_2 = 0;
11592 __pyx_t_3 = 0;
11593 __pyx_t_4 = 0;
11594 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
11595 __Pyx_GOTREF(__pyx_t_1);
11596 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11597 }
11598 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11599 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11600
11601 /* "pymusic.pyx":684
11602 * """
11603 * (<object>func)(d, t, i)
11604 * return True # <<<<<<<<<<<<<<
11605 *
11606 * cdef class MessageHandler:
11607 */
11608 __pyx_r = 1;
11609 goto __pyx_L0;
11610
11611 /* "pymusic.pyx":671
11612 * Index = _Index()
11613 *
11614 * cdef cbool EventCallback(PyObject* func, # <<<<<<<<<<<<<<
11615 * double d,
11616 * IndexType t,
11617 */
11618
11619 /* function exit code */
11620 __pyx_L1_error:;
11621 __Pyx_XDECREF(__pyx_t_1);
11622 __Pyx_XDECREF(__pyx_t_2);
11623 __Pyx_XDECREF(__pyx_t_3);
11624 __Pyx_XDECREF(__pyx_t_4);
11625 __Pyx_XDECREF(__pyx_t_5);
11626 __Pyx_XDECREF(__pyx_t_6);
11627 __Pyx_XDECREF(__pyx_t_8);
11628 __Pyx_AddTraceback("pymusic.EventCallback", __pyx_clineno, __pyx_lineno, __pyx_filename);
11629 __pyx_r = 0;
11630 __pyx_L0:;
11631 __Pyx_RefNannyFinishContext();
11632 return __pyx_r;
11633 }
11634
11635 /* "pymusic.pyx":692
11636 * It may (or may not) depickle messages
11637 * """
11638 * def __cinit__(self, object func, bint pickled): # <<<<<<<<<<<<<<
11639 * """
11640 * func: The function to be called on a message, of the form
11641 */
11642
11643 /* Python wrapper */
11644 static int __pyx_pw_7pymusic_14MessageHandler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11645 static int __pyx_pw_7pymusic_14MessageHandler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11646 PyObject *__pyx_v_func = 0;
11647 int __pyx_v_pickled;
11648 int __pyx_lineno = 0;
11649 const char *__pyx_filename = NULL;
11650 int __pyx_clineno = 0;
11651 int __pyx_r;
11652 __Pyx_RefNannyDeclarations
11653 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11654 {
11655 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_pickled,0};
11656 PyObject* values[2] = {0,0};
11657 if (unlikely(__pyx_kwds)) {
11658 Py_ssize_t kw_args;
11659 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11660 switch (pos_args) {
11661 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11662 CYTHON_FALLTHROUGH;
11663 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11664 CYTHON_FALLTHROUGH;
11665 case 0: break;
11666 default: goto __pyx_L5_argtuple_error;
11667 }
11668 kw_args = PyDict_Size(__pyx_kwds);
11669 switch (pos_args) {
11670 case 0:
11671 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
11672 else goto __pyx_L5_argtuple_error;
11673 CYTHON_FALLTHROUGH;
11674 case 1:
11675 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pickled)) != 0)) kw_args--;
11676 else {
11677 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 692, __pyx_L3_error)
11678 }
11679 }
11680 if (unlikely(kw_args > 0)) {
11681 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 692, __pyx_L3_error)
11682 }
11683 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
11684 goto __pyx_L5_argtuple_error;
11685 } else {
11686 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11687 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11688 }
11689 __pyx_v_func = values[0];
11690 __pyx_v_pickled = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pickled == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L3_error)
11691 }
11692 goto __pyx_L4_argument_unpacking_done;
11693 __pyx_L5_argtuple_error:;
11694 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 692, __pyx_L3_error)
11695 __pyx_L3_error:;
11696 __Pyx_AddTraceback("pymusic.MessageHandler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11697 __Pyx_RefNannyFinishContext();
11698 return -1;
11699 __pyx_L4_argument_unpacking_done:;
11700 __pyx_r = __pyx_pf_7pymusic_14MessageHandler___cinit__(((struct __pyx_obj_7pymusic_MessageHandler *)__pyx_v_self), __pyx_v_func, __pyx_v_pickled);
11701
11702 /* function exit code */
11703 __Pyx_RefNannyFinishContext();
11704 return __pyx_r;
11705 }
11706
11707 static int __pyx_pf_7pymusic_14MessageHandler___cinit__(struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_self, PyObject *__pyx_v_func, int __pyx_v_pickled) {
11708 int __pyx_r;
11709 __Pyx_RefNannyDeclarations
11710 __Pyx_RefNannySetupContext("__cinit__", 0);
11711
11712 /* "pymusic.pyx":700
11713 * pickled: if true, the msg needs to be depickled
11714 * """
11715 * self.ptr = new CMHandler(<PyObject*>func, pickled) # <<<<<<<<<<<<<<
11716 * self.func = func
11717 *
11718 */
11719 __pyx_v_self->ptr = new MUSIC::MHandler(((PyObject *)__pyx_v_func), __pyx_v_pickled);
11720
11721 /* "pymusic.pyx":701
11722 * """
11723 * self.ptr = new CMHandler(<PyObject*>func, pickled)
11724 * self.func = func # <<<<<<<<<<<<<<
11725 *
11726 * def __dealloc__(self): del self.ptr
11727 */
11728 __Pyx_INCREF(__pyx_v_func);
11729 __Pyx_GIVEREF(__pyx_v_func);
11730 __Pyx_GOTREF(__pyx_v_self->func);
11731 __Pyx_DECREF(__pyx_v_self->func);
11732 __pyx_v_self->func = __pyx_v_func;
11733
11734 /* "pymusic.pyx":692
11735 * It may (or may not) depickle messages
11736 * """
11737 * def __cinit__(self, object func, bint pickled): # <<<<<<<<<<<<<<
11738 * """
11739 * func: The function to be called on a message, of the form
11740 */
11741
11742 /* function exit code */
11743 __pyx_r = 0;
11744 __Pyx_RefNannyFinishContext();
11745 return __pyx_r;
11746 }
11747
11748 /* "pymusic.pyx":703
11749 * self.func = func
11750 *
11751 * def __dealloc__(self): del self.ptr # <<<<<<<<<<<<<<
11752 *
11753 * cdef cbool MessageCallback(PyObject* func,
11754 */
11755
11756 /* Python wrapper */
11757 static void __pyx_pw_7pymusic_14MessageHandler_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
11758 static void __pyx_pw_7pymusic_14MessageHandler_3__dealloc__(PyObject *__pyx_v_self) {
11759 __Pyx_RefNannyDeclarations
11760 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11761 __pyx_pf_7pymusic_14MessageHandler_2__dealloc__(((struct __pyx_obj_7pymusic_MessageHandler *)__pyx_v_self));
11762
11763 /* function exit code */
11764 __Pyx_RefNannyFinishContext();
11765 }
11766
11767 static void __pyx_pf_7pymusic_14MessageHandler_2__dealloc__(struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_self) {
11768 __Pyx_RefNannyDeclarations
11769 __Pyx_RefNannySetupContext("__dealloc__", 0);
11770 delete __pyx_v_self->ptr;
11771
11772 /* function exit code */
11773 __Pyx_RefNannyFinishContext();
11774 }
11775
11776 /* "(tree fragment)":1
11777 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11778 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11779 * def __setstate_cython__(self, __pyx_state):
11780 */
11781
11782 /* Python wrapper */
11783 static PyObject *__pyx_pw_7pymusic_14MessageHandler_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11784 static PyObject *__pyx_pw_7pymusic_14MessageHandler_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11785 PyObject *__pyx_r = 0;
11786 __Pyx_RefNannyDeclarations
11787 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11788 __pyx_r = __pyx_pf_7pymusic_14MessageHandler_4__reduce_cython__(((struct __pyx_obj_7pymusic_MessageHandler *)__pyx_v_self));
11789
11790 /* function exit code */
11791 __Pyx_RefNannyFinishContext();
11792 return __pyx_r;
11793 }
11794
11795 static PyObject *__pyx_pf_7pymusic_14MessageHandler_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_self) {
11796 PyObject *__pyx_r = NULL;
11797 __Pyx_RefNannyDeclarations
11798 PyObject *__pyx_t_1 = NULL;
11799 int __pyx_lineno = 0;
11800 const char *__pyx_filename = NULL;
11801 int __pyx_clineno = 0;
11802 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11803
11804 /* "(tree fragment)":2
11805 * def __reduce_cython__(self):
11806 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11807 * def __setstate_cython__(self, __pyx_state):
11808 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11809 */
11810 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11811 __Pyx_GOTREF(__pyx_t_1);
11812 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11814 __PYX_ERR(1, 2, __pyx_L1_error)
11815
11816 /* "(tree fragment)":1
11817 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11818 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11819 * def __setstate_cython__(self, __pyx_state):
11820 */
11821
11822 /* function exit code */
11823 __pyx_L1_error:;
11824 __Pyx_XDECREF(__pyx_t_1);
11825 __Pyx_AddTraceback("pymusic.MessageHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11826 __pyx_r = NULL;
11827 __Pyx_XGIVEREF(__pyx_r);
11828 __Pyx_RefNannyFinishContext();
11829 return __pyx_r;
11830 }
11831
11832 /* "(tree fragment)":3
11833 * def __reduce_cython__(self):
11834 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11835 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11836 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11837 */
11838
11839 /* Python wrapper */
11840 static PyObject *__pyx_pw_7pymusic_14MessageHandler_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11841 static PyObject *__pyx_pw_7pymusic_14MessageHandler_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11842 PyObject *__pyx_r = 0;
11843 __Pyx_RefNannyDeclarations
11844 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11845 __pyx_r = __pyx_pf_7pymusic_14MessageHandler_6__setstate_cython__(((struct __pyx_obj_7pymusic_MessageHandler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11846
11847 /* function exit code */
11848 __Pyx_RefNannyFinishContext();
11849 return __pyx_r;
11850 }
11851
11852 static PyObject *__pyx_pf_7pymusic_14MessageHandler_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pymusic_MessageHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11853 PyObject *__pyx_r = NULL;
11854 __Pyx_RefNannyDeclarations
11855 PyObject *__pyx_t_1 = NULL;
11856 int __pyx_lineno = 0;
11857 const char *__pyx_filename = NULL;
11858 int __pyx_clineno = 0;
11859 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11860
11861 /* "(tree fragment)":4
11862 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11863 * def __setstate_cython__(self, __pyx_state):
11864 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11865 */
11866 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11867 __Pyx_GOTREF(__pyx_t_1);
11868 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11869 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11870 __PYX_ERR(1, 4, __pyx_L1_error)
11871
11872 /* "(tree fragment)":3
11873 * def __reduce_cython__(self):
11874 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11875 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11876 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11877 */
11878
11879 /* function exit code */
11880 __pyx_L1_error:;
11881 __Pyx_XDECREF(__pyx_t_1);
11882 __Pyx_AddTraceback("pymusic.MessageHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11883 __pyx_r = NULL;
11884 __Pyx_XGIVEREF(__pyx_r);
11885 __Pyx_RefNannyFinishContext();
11886 return __pyx_r;
11887 }
11888
11889 /* "pymusic.pyx":705
11890 * def __dealloc__(self): del self.ptr
11891 *
11892 * cdef cbool MessageCallback(PyObject* func, # <<<<<<<<<<<<<<
11893 * double t,
11894 * void* msg,
11895 */
11896
11897 bool MUSIC::MessageCallback(PyObject *__pyx_v_func, double __pyx_v_t, void *__pyx_v_msg, size_t __pyx_v_s, bool __pyx_v_pickled) {
11898 PyObject *__pyx_v_pobj = 0;
11899 PyObject *__pyx_v_obj = 0;
11900 bool __pyx_r;
11901 __Pyx_RefNannyDeclarations
11902 PyObject *__pyx_t_1 = NULL;
11903 PyObject *__pyx_t_2 = NULL;
11904 PyObject *__pyx_t_3 = NULL;
11905 PyObject *__pyx_t_4 = NULL;
11906 int __pyx_t_5;
11907 PyObject *__pyx_t_6 = NULL;
11908 int __pyx_lineno = 0;
11909 const char *__pyx_filename = NULL;
11910 int __pyx_clineno = 0;
11911 __Pyx_RefNannySetupContext("MessageCallback", 0);
11912
11913 /* "pymusic.pyx":720
11914 * """
11915 * #cdef str pobj = (<char*>msg)[:s]
11916 * cdef bytearray pobj = (<char*>msg)[:s] # <<<<<<<<<<<<<<
11917 * cdef object obj = pickle.loads(pobj) if pickled else pobj
11918 * (<object>func)(t, obj)
11919 */
11920 __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(((char *)__pyx_v_msg) + 0, __pyx_v_s - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
11921 __Pyx_GOTREF(__pyx_t_1);
11922 __pyx_v_pobj = ((PyObject*)__pyx_t_1);
11923 __pyx_t_1 = 0;
11924
11925 /* "pymusic.pyx":721
11926 * #cdef str pobj = (<char*>msg)[:s]
11927 * cdef bytearray pobj = (<char*>msg)[:s]
11928 * cdef object obj = pickle.loads(pobj) if pickled else pobj # <<<<<<<<<<<<<<
11929 * (<object>func)(t, obj)
11930 * return True
11931 */
11932 if ((__pyx_v_pickled != 0)) {
11933 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
11934 __Pyx_GOTREF(__pyx_t_3);
11935 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
11936 __Pyx_GOTREF(__pyx_t_4);
11937 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11938 __pyx_t_3 = NULL;
11939 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11940 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
11941 if (likely(__pyx_t_3)) {
11942 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11943 __Pyx_INCREF(__pyx_t_3);
11944 __Pyx_INCREF(function);
11945 __Pyx_DECREF_SET(__pyx_t_4, function);
11946 }
11947 }
11948 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_pobj) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_pobj);
11949 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11950 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
11951 __Pyx_GOTREF(__pyx_t_2);
11952 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11953 __pyx_t_1 = __pyx_t_2;
11954 __pyx_t_2 = 0;
11955 } else {
11956 __Pyx_INCREF(__pyx_v_pobj);
11957 __pyx_t_1 = __pyx_v_pobj;
11958 }
11959 __pyx_v_obj = __pyx_t_1;
11960 __pyx_t_1 = 0;
11961
11962 /* "pymusic.pyx":722
11963 * cdef bytearray pobj = (<char*>msg)[:s]
11964 * cdef object obj = pickle.loads(pobj) if pickled else pobj
11965 * (<object>func)(t, obj) # <<<<<<<<<<<<<<
11966 * return True
11967 *
11968 */
11969 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
11970 __Pyx_GOTREF(__pyx_t_2);
11971 __Pyx_INCREF(((PyObject *)__pyx_v_func));
11972 __pyx_t_4 = ((PyObject *)__pyx_v_func); __pyx_t_3 = NULL;
11973 __pyx_t_5 = 0;
11974 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11975 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
11976 if (likely(__pyx_t_3)) {
11977 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11978 __Pyx_INCREF(__pyx_t_3);
11979 __Pyx_INCREF(function);
11980 __Pyx_DECREF_SET(__pyx_t_4, function);
11981 __pyx_t_5 = 1;
11982 }
11983 }
11984 #if CYTHON_FAST_PYCALL
11985 if (PyFunction_Check(__pyx_t_4)) {
11986 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, __pyx_v_obj};
11987 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
11988 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11989 __Pyx_GOTREF(__pyx_t_1);
11990 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11991 } else
11992 #endif
11993 #if CYTHON_FAST_PYCCALL
11994 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11995 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, __pyx_v_obj};
11996 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
11997 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11998 __Pyx_GOTREF(__pyx_t_1);
11999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12000 } else
12001 #endif
12002 {
12003 __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 722, __pyx_L1_error)
12004 __Pyx_GOTREF(__pyx_t_6);
12005 if (__pyx_t_3) {
12006 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
12007 }
12008 __Pyx_GIVEREF(__pyx_t_2);
12009 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
12010 __Pyx_INCREF(__pyx_v_obj);
12011 __Pyx_GIVEREF(__pyx_v_obj);
12012 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_obj);
12013 __pyx_t_2 = 0;
12014 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
12015 __Pyx_GOTREF(__pyx_t_1);
12016 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12017 }
12018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12019 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12020
12021 /* "pymusic.pyx":723
12022 * cdef object obj = pickle.loads(pobj) if pickled else pobj
12023 * (<object>func)(t, obj)
12024 * return True # <<<<<<<<<<<<<<
12025 *
12026 * #############################################################################
12027 */
12028 __pyx_r = 1;
12029 goto __pyx_L0;
12030
12031 /* "pymusic.pyx":705
12032 * def __dealloc__(self): del self.ptr
12033 *
12034 * cdef cbool MessageCallback(PyObject* func, # <<<<<<<<<<<<<<
12035 * double t,
12036 * void* msg,
12037 */
12038
12039 /* function exit code */
12040 __pyx_L1_error:;
12041 __Pyx_XDECREF(__pyx_t_1);
12042 __Pyx_XDECREF(__pyx_t_2);
12043 __Pyx_XDECREF(__pyx_t_3);
12044 __Pyx_XDECREF(__pyx_t_4);
12045 __Pyx_XDECREF(__pyx_t_6);
12046 __Pyx_AddTraceback("pymusic.MessageCallback", __pyx_clineno, __pyx_lineno, __pyx_filename);
12047 __pyx_r = 0;
12048 __pyx_L0:;
12049 __Pyx_XDECREF(__pyx_v_pobj);
12050 __Pyx_XDECREF(__pyx_v_obj);
12051 __Pyx_RefNannyFinishContext();
12052 return __pyx_r;
12053 }
12054
12055 /* "array.pxd":93
12056 * __data_union data
12057 *
12058 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
12059 * # This implementation of getbuffer is geared towards Cython
12060 * # requirements, and does not yet fulfill the PEP.
12061 */
12062
12063 /* Python wrapper */
12064 static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12065 static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12066 int __pyx_r;
12067 __Pyx_RefNannyDeclarations
12068 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12069 __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12070
12071 /* function exit code */
12072 __Pyx_RefNannyFinishContext();
12073 return __pyx_r;
12074 }
12075
12076 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
12077 PyObject *__pyx_v_item_count = NULL;
12078 int __pyx_r;
12079 __Pyx_RefNannyDeclarations
12080 PyObject *__pyx_t_1 = NULL;
12081 char *__pyx_t_2;
12082 int __pyx_t_3;
12083 PyObject *__pyx_t_4 = NULL;
12084 Py_ssize_t __pyx_t_5;
12085 int __pyx_t_6;
12086 char __pyx_t_7;
12087 int __pyx_lineno = 0;
12088 const char *__pyx_filename = NULL;
12089 int __pyx_clineno = 0;
12090 if (__pyx_v_info == NULL) {
12091 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12092 return -1;
12093 }
12094 __Pyx_RefNannySetupContext("__getbuffer__", 0);
12095 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12096 __Pyx_GIVEREF(__pyx_v_info->obj);
12097
12098 /* "array.pxd":98
12099 * # In particular strided access is always provided regardless
12100 * # of flags
12101 * item_count = Py_SIZE(self) # <<<<<<<<<<<<<<
12102 *
12103 * info.suboffsets = NULL
12104 */
12105 __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
12106 __Pyx_GOTREF(__pyx_t_1);
12107 __pyx_v_item_count = __pyx_t_1;
12108 __pyx_t_1 = 0;
12109
12110 /* "array.pxd":100
12111 * item_count = Py_SIZE(self)
12112 *
12113 * info.suboffsets = NULL # <<<<<<<<<<<<<<
12114 * info.buf = self.data.as_chars
12115 * info.readonly = 0
12116 */
12117 __pyx_v_info->suboffsets = NULL;
12118
12119 /* "array.pxd":101
12120 *
12121 * info.suboffsets = NULL
12122 * info.buf = self.data.as_chars # <<<<<<<<<<<<<<
12123 * info.readonly = 0
12124 * info.ndim = 1
12125 */
12126 __pyx_t_2 = __pyx_v_self->data.as_chars;
12127 __pyx_v_info->buf = __pyx_t_2;
12128
12129 /* "array.pxd":102
12130 * info.suboffsets = NULL
12131 * info.buf = self.data.as_chars
12132 * info.readonly = 0 # <<<<<<<<<<<<<<
12133 * info.ndim = 1
12134 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
12135 */
12136 __pyx_v_info->readonly = 0;
12137
12138 /* "array.pxd":103
12139 * info.buf = self.data.as_chars
12140 * info.readonly = 0
12141 * info.ndim = 1 # <<<<<<<<<<<<<<
12142 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
12143 * info.len = info.itemsize * item_count
12144 */
12145 __pyx_v_info->ndim = 1;
12146
12147 /* "array.pxd":104
12148 * info.readonly = 0
12149 * info.ndim = 1
12150 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<<
12151 * info.len = info.itemsize * item_count
12152 *
12153 */
12154 __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
12155 __pyx_v_info->itemsize = __pyx_t_3;
12156
12157 /* "array.pxd":105
12158 * info.ndim = 1
12159 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
12160 * info.len = info.itemsize * item_count # <<<<<<<<<<<<<<
12161 *
12162 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
12163 */
12164 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 105, __pyx_L1_error)
12165 __Pyx_GOTREF(__pyx_t_1);
12166 __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 105, __pyx_L1_error)
12167 __Pyx_GOTREF(__pyx_t_4);
12168 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12169 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L1_error)
12170 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12171 __pyx_v_info->len = __pyx_t_5;
12172
12173 /* "array.pxd":107
12174 * info.len = info.itemsize * item_count
12175 *
12176 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<<
12177 * if not info.shape:
12178 * raise MemoryError()
12179 */
12180 __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2)));
12181
12182 /* "array.pxd":108
12183 *
12184 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
12185 * if not info.shape: # <<<<<<<<<<<<<<
12186 * raise MemoryError()
12187 * info.shape[0] = item_count # constant regardless of resizing
12188 */
12189 __pyx_t_6 = ((!(__pyx_v_info->shape != 0)) != 0);
12190 if (unlikely(__pyx_t_6)) {
12191
12192 /* "array.pxd":109
12193 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
12194 * if not info.shape:
12195 * raise MemoryError() # <<<<<<<<<<<<<<
12196 * info.shape[0] = item_count # constant regardless of resizing
12197 * info.strides = &info.itemsize
12198 */
12199 PyErr_NoMemory(); __PYX_ERR(2, 109, __pyx_L1_error)
12200
12201 /* "array.pxd":108
12202 *
12203 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
12204 * if not info.shape: # <<<<<<<<<<<<<<
12205 * raise MemoryError()
12206 * info.shape[0] = item_count # constant regardless of resizing
12207 */
12208 }
12209
12210 /* "array.pxd":110
12211 * if not info.shape:
12212 * raise MemoryError()
12213 * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<<
12214 * info.strides = &info.itemsize
12215 *
12216 */
12217 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 110, __pyx_L1_error)
12218 (__pyx_v_info->shape[0]) = __pyx_t_5;
12219
12220 /* "array.pxd":111
12221 * raise MemoryError()
12222 * info.shape[0] = item_count # constant regardless of resizing
12223 * info.strides = &info.itemsize # <<<<<<<<<<<<<<
12224 *
12225 * info.format = <char*> (info.shape + 1)
12226 */
12227 __pyx_v_info->strides = (&__pyx_v_info->itemsize);
12228
12229 /* "array.pxd":113
12230 * info.strides = &info.itemsize
12231 *
12232 * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<<
12233 * info.format[0] = self.ob_descr.typecode
12234 * info.format[1] = 0
12235 */
12236 __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
12237
12238 /* "array.pxd":114
12239 *
12240 * info.format = <char*> (info.shape + 1)
12241 * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<<
12242 * info.format[1] = 0
12243 * info.obj = self
12244 */
12245 __pyx_t_7 = __pyx_v_self->ob_descr->typecode;
12246 (__pyx_v_info->format[0]) = __pyx_t_7;
12247
12248 /* "array.pxd":115
12249 * info.format = <char*> (info.shape + 1)
12250 * info.format[0] = self.ob_descr.typecode
12251 * info.format[1] = 0 # <<<<<<<<<<<<<<
12252 * info.obj = self
12253 *
12254 */
12255 (__pyx_v_info->format[1]) = 0;
12256
12257 /* "array.pxd":116
12258 * info.format[0] = self.ob_descr.typecode
12259 * info.format[1] = 0
12260 * info.obj = self # <<<<<<<<<<<<<<
12261 *
12262 * def __releasebuffer__(self, Py_buffer* info):
12263 */
12264 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12265 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12266 __Pyx_GOTREF(__pyx_v_info->obj);
12267 __Pyx_DECREF(__pyx_v_info->obj);
12268 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12269
12270 /* "array.pxd":93
12271 * __data_union data
12272 *
12273 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
12274 * # This implementation of getbuffer is geared towards Cython
12275 * # requirements, and does not yet fulfill the PEP.
12276 */
12277
12278 /* function exit code */
12279 __pyx_r = 0;
12280 goto __pyx_L0;
12281 __pyx_L1_error:;
12282 __Pyx_XDECREF(__pyx_t_1);
12283 __Pyx_XDECREF(__pyx_t_4);
12284 __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12285 __pyx_r = -1;
12286 if (__pyx_v_info->obj != NULL) {
12287 __Pyx_GOTREF(__pyx_v_info->obj);
12288 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12289 }
12290 goto __pyx_L2;
12291 __pyx_L0:;
12292 if (__pyx_v_info->obj == Py_None) {
12293 __Pyx_GOTREF(__pyx_v_info->obj);
12294 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12295 }
12296 __pyx_L2:;
12297 __Pyx_XDECREF(__pyx_v_item_count);
12298 __Pyx_RefNannyFinishContext();
12299 return __pyx_r;
12300 }
12301
12302 /* "array.pxd":118
12303 * info.obj = self
12304 *
12305 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
12306 * PyObject_Free(info.shape)
12307 *
12308 */
12309
12310 /* Python wrapper */
12311 static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
12312 static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
12313 __Pyx_RefNannyDeclarations
12314 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
12315 __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
12316
12317 /* function exit code */
12318 __Pyx_RefNannyFinishContext();
12319 }
12320
12321 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
12322 __Pyx_RefNannyDeclarations
12323 __Pyx_RefNannySetupContext("__releasebuffer__", 0);
12324
12325 /* "array.pxd":119
12326 *
12327 * def __releasebuffer__(self, Py_buffer* info):
12328 * PyObject_Free(info.shape) # <<<<<<<<<<<<<<
12329 *
12330 * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
12331 */
12332 PyObject_Free(__pyx_v_info->shape);
12333
12334 /* "array.pxd":118
12335 * info.obj = self
12336 *
12337 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
12338 * PyObject_Free(info.shape)
12339 *
12340 */
12341
12342 /* function exit code */
12343 __Pyx_RefNannyFinishContext();
12344 }
12345
12346 /* "array.pxd":130
12347 *
12348 *
12349 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
12350 * """ fast creation of a new array, given a template array.
12351 * type will be same as template.
12352 */
12353
12354 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
12355 arrayobject *__pyx_v_op = 0;
12356 arrayobject *__pyx_r = NULL;
12357 __Pyx_RefNannyDeclarations
12358 PyObject *__pyx_t_1 = NULL;
12359 int __pyx_t_2;
12360 int __pyx_t_3;
12361 int __pyx_t_4;
12362 int __pyx_lineno = 0;
12363 const char *__pyx_filename = NULL;
12364 int __pyx_clineno = 0;
12365 __Pyx_RefNannySetupContext("clone", 0);
12366
12367 /* "array.pxd":134
12368 * type will be same as template.
12369 * if zero is true, new array will be initialized with zeroes."""
12370 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<<
12371 * if zero and op is not None:
12372 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
12373 */
12374 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 134, __pyx_L1_error)
12375 __Pyx_GOTREF(__pyx_t_1);
12376 __pyx_v_op = ((arrayobject *)__pyx_t_1);
12377 __pyx_t_1 = 0;
12378
12379 /* "array.pxd":135
12380 * if zero is true, new array will be initialized with zeroes."""
12381 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
12382 * if zero and op is not None: # <<<<<<<<<<<<<<
12383 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
12384 * return op
12385 */
12386 __pyx_t_3 = (__pyx_v_zero != 0);
12387 if (__pyx_t_3) {
12388 } else {
12389 __pyx_t_2 = __pyx_t_3;
12390 goto __pyx_L4_bool_binop_done;
12391 }
12392 __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
12393 __pyx_t_4 = (__pyx_t_3 != 0);
12394 __pyx_t_2 = __pyx_t_4;
12395 __pyx_L4_bool_binop_done:;
12396 if (__pyx_t_2) {
12397
12398 /* "array.pxd":136
12399 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
12400 * if zero and op is not None:
12401 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
12402 * return op
12403 *
12404 */
12405 (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));
12406
12407 /* "array.pxd":135
12408 * if zero is true, new array will be initialized with zeroes."""
12409 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
12410 * if zero and op is not None: # <<<<<<<<<<<<<<
12411 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
12412 * return op
12413 */
12414 }
12415
12416 /* "array.pxd":137
12417 * if zero and op is not None:
12418 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
12419 * return op # <<<<<<<<<<<<<<
12420 *
12421 * cdef inline array copy(array self):
12422 */
12423 __Pyx_XDECREF(((PyObject *)__pyx_r));
12424 __Pyx_INCREF(((PyObject *)__pyx_v_op));
12425 __pyx_r = __pyx_v_op;
12426 goto __pyx_L0;
12427
12428 /* "array.pxd":130
12429 *
12430 *
12431 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
12432 * """ fast creation of a new array, given a template array.
12433 * type will be same as template.
12434 */
12435
12436 /* function exit code */
12437 __pyx_L1_error:;
12438 __Pyx_XDECREF(__pyx_t_1);
12439 __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
12440 __pyx_r = 0;
12441 __pyx_L0:;
12442 __Pyx_XDECREF((PyObject *)__pyx_v_op);
12443 __Pyx_XGIVEREF((PyObject *)__pyx_r);
12444 __Pyx_RefNannyFinishContext();
12445 return __pyx_r;
12446 }
12447
12448 /* "array.pxd":139
12449 * return op
12450 *
12451 * cdef inline array copy(array self): # <<<<<<<<<<<<<<
12452 * """ make a copy of an array. """
12453 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
12454 */
12455
12456 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
12457 arrayobject *__pyx_v_op = 0;
12458 arrayobject *__pyx_r = NULL;
12459 __Pyx_RefNannyDeclarations
12460 PyObject *__pyx_t_1 = NULL;
12461 int __pyx_lineno = 0;
12462 const char *__pyx_filename = NULL;
12463 int __pyx_clineno = 0;
12464 __Pyx_RefNannySetupContext("copy", 0);
12465
12466 /* "array.pxd":141
12467 * cdef inline array copy(array self):
12468 * """ make a copy of an array. """
12469 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<<
12470 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
12471 * return op
12472 */
12473 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 141, __pyx_L1_error)
12474 __Pyx_GOTREF(__pyx_t_1);
12475 __pyx_v_op = ((arrayobject *)__pyx_t_1);
12476 __pyx_t_1 = 0;
12477
12478 /* "array.pxd":142
12479 * """ make a copy of an array. """
12480 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
12481 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
12482 * return op
12483 *
12484 */
12485 (void)(memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize)));
12486
12487 /* "array.pxd":143
12488 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
12489 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
12490 * return op # <<<<<<<<<<<<<<
12491 *
12492 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
12493 */
12494 __Pyx_XDECREF(((PyObject *)__pyx_r));
12495 __Pyx_INCREF(((PyObject *)__pyx_v_op));
12496 __pyx_r = __pyx_v_op;
12497 goto __pyx_L0;
12498
12499 /* "array.pxd":139
12500 * return op
12501 *
12502 * cdef inline array copy(array self): # <<<<<<<<<<<<<<
12503 * """ make a copy of an array. """
12504 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
12505 */
12506
12507 /* function exit code */
12508 __pyx_L1_error:;
12509 __Pyx_XDECREF(__pyx_t_1);
12510 __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12511 __pyx_r = 0;
12512 __pyx_L0:;
12513 __Pyx_XDECREF((PyObject *)__pyx_v_op);
12514 __Pyx_XGIVEREF((PyObject *)__pyx_r);
12515 __Pyx_RefNannyFinishContext();
12516 return __pyx_r;
12517 }
12518
12519 /* "array.pxd":145
12520 * return op
12521 *
12522 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
12523 * """ efficient appending of new stuff of same type
12524 * (e.g. of same array type)
12525 */
12526
12527 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
12528 Py_ssize_t __pyx_v_itemsize;
12529 Py_ssize_t __pyx_v_origsize;
12530 int __pyx_r;
12531 __Pyx_RefNannyDeclarations
12532 int __pyx_t_1;
12533 int __pyx_lineno = 0;
12534 const char *__pyx_filename = NULL;
12535 int __pyx_clineno = 0;
12536 __Pyx_RefNannySetupContext("extend_buffer", 0);
12537
12538 /* "array.pxd":149
12539 * (e.g. of same array type)
12540 * n: number of elements (not number of bytes!) """
12541 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<<
12542 * cdef Py_ssize_t origsize = Py_SIZE(self)
12543 * resize_smart(self, origsize + n)
12544 */
12545 __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
12546 __pyx_v_itemsize = __pyx_t_1;
12547
12548 /* "array.pxd":150
12549 * n: number of elements (not number of bytes!) """
12550 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
12551 * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<<
12552 * resize_smart(self, origsize + n)
12553 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
12554 */
12555 __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
12556
12557 /* "array.pxd":151
12558 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
12559 * cdef Py_ssize_t origsize = Py_SIZE(self)
12560 * resize_smart(self, origsize + n) # <<<<<<<<<<<<<<
12561 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
12562 * return 0
12563 */
12564 __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 151, __pyx_L1_error)
12565
12566 /* "array.pxd":152
12567 * cdef Py_ssize_t origsize = Py_SIZE(self)
12568 * resize_smart(self, origsize + n)
12569 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<<
12570 * return 0
12571 *
12572 */
12573 (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));
12574
12575 /* "array.pxd":153
12576 * resize_smart(self, origsize + n)
12577 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
12578 * return 0 # <<<<<<<<<<<<<<
12579 *
12580 * cdef inline int extend(array self, array other) except -1:
12581 */
12582 __pyx_r = 0;
12583 goto __pyx_L0;
12584
12585 /* "array.pxd":145
12586 * return op
12587 *
12588 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
12589 * """ efficient appending of new stuff of same type
12590 * (e.g. of same array type)
12591 */
12592
12593 /* function exit code */
12594 __pyx_L1_error:;
12595 __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
12596 __pyx_r = -1;
12597 __pyx_L0:;
12598 __Pyx_RefNannyFinishContext();
12599 return __pyx_r;
12600 }
12601
12602 /* "array.pxd":155
12603 * return 0
12604 *
12605 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
12606 * """ extend array with data from another array; types must match. """
12607 * if self.ob_descr.typecode != other.ob_descr.typecode:
12608 */
12609
12610 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
12611 int __pyx_r;
12612 __Pyx_RefNannyDeclarations
12613 int __pyx_t_1;
12614 int __pyx_t_2;
12615 int __pyx_lineno = 0;
12616 const char *__pyx_filename = NULL;
12617 int __pyx_clineno = 0;
12618 __Pyx_RefNannySetupContext("extend", 0);
12619
12620 /* "array.pxd":157
12621 * cdef inline int extend(array self, array other) except -1:
12622 * """ extend array with data from another array; types must match. """
12623 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
12624 * PyErr_BadArgument()
12625 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
12626 */
12627 __pyx_t_1 = ((__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode) != 0);
12628 if (__pyx_t_1) {
12629
12630 /* "array.pxd":158
12631 * """ extend array with data from another array; types must match. """
12632 * if self.ob_descr.typecode != other.ob_descr.typecode:
12633 * PyErr_BadArgument() # <<<<<<<<<<<<<<
12634 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
12635 *
12636 */
12637 __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 158, __pyx_L1_error)
12638
12639 /* "array.pxd":157
12640 * cdef inline int extend(array self, array other) except -1:
12641 * """ extend array with data from another array; types must match. """
12642 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
12643 * PyErr_BadArgument()
12644 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
12645 */
12646 }
12647
12648 /* "array.pxd":159
12649 * if self.ob_descr.typecode != other.ob_descr.typecode:
12650 * PyErr_BadArgument()
12651 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<<
12652 *
12653 * cdef inline void zero(array self):
12654 */
12655 __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 159, __pyx_L1_error)
12656 __pyx_r = __pyx_t_2;
12657 goto __pyx_L0;
12658
12659 /* "array.pxd":155
12660 * return 0
12661 *
12662 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
12663 * """ extend array with data from another array; types must match. """
12664 * if self.ob_descr.typecode != other.ob_descr.typecode:
12665 */
12666
12667 /* function exit code */
12668 __pyx_L1_error:;
12669 __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
12670 __pyx_r = -1;
12671 __pyx_L0:;
12672 __Pyx_RefNannyFinishContext();
12673 return __pyx_r;
12674 }
12675
12676 /* "array.pxd":161
12677 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
12678 *
12679 * cdef inline void zero(array self): # <<<<<<<<<<<<<<
12680 * """ set all elements of array to zero. """
12681 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
12682 */
12683
12684 static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
12685 __Pyx_RefNannyDeclarations
12686 __Pyx_RefNannySetupContext("zero", 0);
12687
12688 /* "array.pxd":163
12689 * cdef inline void zero(array self):
12690 * """ set all elements of array to zero. """
12691 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<<
12692 */
12693 (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));
12694
12695 /* "array.pxd":161
12696 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
12697 *
12698 * cdef inline void zero(array self): # <<<<<<<<<<<<<<
12699 * """ set all elements of array to zero. """
12700 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
12701 */
12702
12703 /* function exit code */
12704 __Pyx_RefNannyFinishContext();
12705 }
12706
12707 /* "string.from_py":13
12708 *
12709 * @cname("__pyx_convert_string_from_py_std__in_string")
12710 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
12711 * cdef Py_ssize_t length = 0
12712 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
12713 */
12714
12715 static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
12716 Py_ssize_t __pyx_v_length;
12717 char const *__pyx_v_data;
12718 std::string __pyx_r;
12719 __Pyx_RefNannyDeclarations
12720 char const *__pyx_t_1;
12721 int __pyx_lineno = 0;
12722 const char *__pyx_filename = NULL;
12723 int __pyx_clineno = 0;
12724 __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
12725
12726 /* "string.from_py":14
12727 * @cname("__pyx_convert_string_from_py_std__in_string")
12728 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
12729 * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
12730 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
12731 * return string(data, length)
12732 */
12733 __pyx_v_length = 0;
12734
12735 /* "string.from_py":15
12736 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
12737 * cdef Py_ssize_t length = 0
12738 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
12739 * return string(data, length)
12740 *
12741 */
12742 __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error)
12743 __pyx_v_data = __pyx_t_1;
12744
12745 /* "string.from_py":16
12746 * cdef Py_ssize_t length = 0
12747 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
12748 * return string(data, length) # <<<<<<<<<<<<<<
12749 *
12750 *
12751 */
12752 __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
12753 goto __pyx_L0;
12754
12755 /* "string.from_py":13
12756 *
12757 * @cname("__pyx_convert_string_from_py_std__in_string")
12758 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
12759 * cdef Py_ssize_t length = 0
12760 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
12761 */
12762
12763 /* function exit code */
12764 __pyx_L1_error:;
12765 __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
12766 __Pyx_pretend_to_initialize(&__pyx_r);
12767 __pyx_L0:;
12768 __Pyx_RefNannyFinishContext();
12769 return __pyx_r;
12770 }
12771
12772 /* "string.to_py":31
12773 *
12774 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
12775 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12776 * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
12777 * cdef extern from *:
12778 */
12779
12780 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
12781 PyObject *__pyx_r = NULL;
12782 __Pyx_RefNannyDeclarations
12783 PyObject *__pyx_t_1 = NULL;
12784 int __pyx_lineno = 0;
12785 const char *__pyx_filename = NULL;
12786 int __pyx_clineno = 0;
12787 __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);
12788
12789 /* "string.to_py":32
12790 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
12791 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
12792 * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
12793 * cdef extern from *:
12794 * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
12795 */
12796 __Pyx_XDECREF(__pyx_r);
12797 __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
12798 __Pyx_GOTREF(__pyx_t_1);
12799 __pyx_r = __pyx_t_1;
12800 __pyx_t_1 = 0;
12801 goto __pyx_L0;
12802
12803 /* "string.to_py":31
12804 *
12805 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
12806 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12807 * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
12808 * cdef extern from *:
12809 */
12810
12811 /* function exit code */
12812 __pyx_L1_error:;
12813 __Pyx_XDECREF(__pyx_t_1);
12814 __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
12815 __pyx_r = 0;
12816 __pyx_L0:;
12817 __Pyx_XGIVEREF(__pyx_r);
12818 __Pyx_RefNannyFinishContext();
12819 return __pyx_r;
12820 }
12821
12822 /* "string.to_py":37
12823 *
12824 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
12825 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12826 * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
12827 * cdef extern from *:
12828 */
12829
12830 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
12831 PyObject *__pyx_r = NULL;
12832 __Pyx_RefNannyDeclarations
12833 PyObject *__pyx_t_1 = NULL;
12834 int __pyx_lineno = 0;
12835 const char *__pyx_filename = NULL;
12836 int __pyx_clineno = 0;
12837 __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
12838
12839 /* "string.to_py":38
12840 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
12841 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
12842 * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
12843 * cdef extern from *:
12844 * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
12845 */
12846 __Pyx_XDECREF(__pyx_r);
12847 __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
12848 __Pyx_GOTREF(__pyx_t_1);
12849 __pyx_r = __pyx_t_1;
12850 __pyx_t_1 = 0;
12851 goto __pyx_L0;
12852
12853 /* "string.to_py":37
12854 *
12855 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
12856 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12857 * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
12858 * cdef extern from *:
12859 */
12860
12861 /* function exit code */
12862 __pyx_L1_error:;
12863 __Pyx_XDECREF(__pyx_t_1);
12864 __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
12865 __pyx_r = 0;
12866 __pyx_L0:;
12867 __Pyx_XGIVEREF(__pyx_r);
12868 __Pyx_RefNannyFinishContext();
12869 return __pyx_r;
12870 }
12871
12872 /* "string.to_py":43
12873 *
12874 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
12875 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12876 * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
12877 * cdef extern from *:
12878 */
12879
12880 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
12881 PyObject *__pyx_r = NULL;
12882 __Pyx_RefNannyDeclarations
12883 PyObject *__pyx_t_1 = NULL;
12884 int __pyx_lineno = 0;
12885 const char *__pyx_filename = NULL;
12886 int __pyx_clineno = 0;
12887 __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);
12888
12889 /* "string.to_py":44
12890 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
12891 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
12892 * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
12893 * cdef extern from *:
12894 * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
12895 */
12896 __Pyx_XDECREF(__pyx_r);
12897 __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
12898 __Pyx_GOTREF(__pyx_t_1);
12899 __pyx_r = __pyx_t_1;
12900 __pyx_t_1 = 0;
12901 goto __pyx_L0;
12902
12903 /* "string.to_py":43
12904 *
12905 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
12906 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12907 * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
12908 * cdef extern from *:
12909 */
12910
12911 /* function exit code */
12912 __pyx_L1_error:;
12913 __Pyx_XDECREF(__pyx_t_1);
12914 __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
12915 __pyx_r = 0;
12916 __pyx_L0:;
12917 __Pyx_XGIVEREF(__pyx_r);
12918 __Pyx_RefNannyFinishContext();
12919 return __pyx_r;
12920 }
12921
12922 /* "string.to_py":49
12923 *
12924 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
12925 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12926 * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
12927 * cdef extern from *:
12928 */
12929
12930 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
12931 PyObject *__pyx_r = NULL;
12932 __Pyx_RefNannyDeclarations
12933 PyObject *__pyx_t_1 = NULL;
12934 int __pyx_lineno = 0;
12935 const char *__pyx_filename = NULL;
12936 int __pyx_clineno = 0;
12937 __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
12938
12939 /* "string.to_py":50
12940 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
12941 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
12942 * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
12943 * cdef extern from *:
12944 * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
12945 */
12946 __Pyx_XDECREF(__pyx_r);
12947 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
12948 __Pyx_GOTREF(__pyx_t_1);
12949 __pyx_r = __pyx_t_1;
12950 __pyx_t_1 = 0;
12951 goto __pyx_L0;
12952
12953 /* "string.to_py":49
12954 *
12955 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
12956 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12957 * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
12958 * cdef extern from *:
12959 */
12960
12961 /* function exit code */
12962 __pyx_L1_error:;
12963 __Pyx_XDECREF(__pyx_t_1);
12964 __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
12965 __pyx_r = 0;
12966 __pyx_L0:;
12967 __Pyx_XGIVEREF(__pyx_r);
12968 __Pyx_RefNannyFinishContext();
12969 return __pyx_r;
12970 }
12971
12972 /* "string.to_py":55
12973 *
12974 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
12975 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
12976 * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
12977 *
12978 */
12979
12980 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
12981 PyObject *__pyx_r = NULL;
12982 __Pyx_RefNannyDeclarations
12983 PyObject *__pyx_t_1 = NULL;
12984 int __pyx_lineno = 0;
12985 const char *__pyx_filename = NULL;
12986 int __pyx_clineno = 0;
12987 __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
12988
12989 /* "string.to_py":56
12990 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
12991 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
12992 * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
12993 *
12994 */
12995 __Pyx_XDECREF(__pyx_r);
12996 __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
12997 __Pyx_GOTREF(__pyx_t_1);
12998 __pyx_r = __pyx_t_1;
12999 __pyx_t_1 = 0;
13000 goto __pyx_L0;
13001
13002 /* "string.to_py":55
13003 *
13004 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
13005 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
13006 * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
13007 *
13008 */
13009
13010 /* function exit code */
13011 __pyx_L1_error:;
13012 __Pyx_XDECREF(__pyx_t_1);
13013 __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
13014 __pyx_r = 0;
13015 __pyx_L0:;
13016 __Pyx_XGIVEREF(__pyx_r);
13017 __Pyx_RefNannyFinishContext();
13018 return __pyx_r;
13019 }
13020 static struct __pyx_vtabstruct_7pymusic_Setup __pyx_vtable_7pymusic_Setup;
13021
13022 static PyObject *__pyx_tp_new_7pymusic_Setup(PyTypeObject *t, PyObject *a, PyObject *k) {
13023 struct __pyx_obj_7pymusic_Setup *p;
13024 PyObject *o;
13025 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
13026 o = (*t->tp_alloc)(t, 0);
13027 } else {
13028 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
13029 }
13030 if (unlikely(!o)) return 0;
13031 p = ((struct __pyx_obj_7pymusic_Setup *)o);
13032 p->__pyx_vtab = __pyx_vtabptr_7pymusic_Setup;
13033 p->argv = ((PyObject*)Py_None); Py_INCREF(Py_None);
13034 p->comm = ((struct PyMPIIntracommObject *)Py_None); Py_INCREF(Py_None);
13035 p->ports = ((PyObject*)Py_None); Py_INCREF(Py_None);
13036 if (unlikely(__pyx_pw_7pymusic_5Setup_1__cinit__(o, a, k) < 0)) goto bad;
13037 return o;
13038 bad:
13039 Py_DECREF(o); o = 0;
13040 return NULL;
13041 }
13042
13043 static void __pyx_tp_dealloc_7pymusic_Setup(PyObject *o) {
13044 struct __pyx_obj_7pymusic_Setup *p = (struct __pyx_obj_7pymusic_Setup *)o;
13045 #if CYTHON_USE_TP_FINALIZE
13046 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
13047 if (PyObject_CallFinalizerFromDealloc(o)) return;
13048 }
13049 #endif
13050 PyObject_GC_UnTrack(o);
13051 {
13052 PyObject *etype, *eval, *etb;
13053 PyErr_Fetch(&etype, &eval, &etb);
13054 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
13055 __pyx_pw_7pymusic_5Setup_3__dealloc__(o);
13056 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
13057 PyErr_Restore(etype, eval, etb);
13058 }
13059 Py_CLEAR(p->argv);
13060 Py_CLEAR(p->comm);
13061 Py_CLEAR(p->ports);
13062 (*Py_TYPE(o)->tp_free)(o);
13063 }
13064
13065 static int __pyx_tp_traverse_7pymusic_Setup(PyObject *o, visitproc v, void *a) {
13066 int e;
13067 struct __pyx_obj_7pymusic_Setup *p = (struct __pyx_obj_7pymusic_Setup *)o;
13068 if (p->argv) {
13069 e = (*v)(p->argv, a); if (e) return e;
13070 }
13071 if (p->comm) {
13072 e = (*v)(((PyObject *)p->comm), a); if (e) return e;
13073 }
13074 if (p->ports) {
13075 e = (*v)(p->ports, a); if (e) return e;
13076 }
13077 return 0;
13078 }
13079
13080 static int __pyx_tp_clear_7pymusic_Setup(PyObject *o) {
13081 PyObject* tmp;
13082 struct __pyx_obj_7pymusic_Setup *p = (struct __pyx_obj_7pymusic_Setup *)o;
13083 tmp = ((PyObject*)p->argv);
13084 p->argv = ((PyObject*)Py_None); Py_INCREF(Py_None);
13085 Py_XDECREF(tmp);
13086 tmp = ((PyObject*)p->comm);
13087 p->comm = ((struct PyMPIIntracommObject *)Py_None); Py_INCREF(Py_None);
13088 Py_XDECREF(tmp);
13089 tmp = ((PyObject*)p->ports);
13090 p->ports = ((PyObject*)Py_None); Py_INCREF(Py_None);
13091 Py_XDECREF(tmp);
13092 return 0;
13093 }
13094
13095 static PyObject *__pyx_getprop_7pymusic_5Setup_comm(PyObject *o, CYTHON_UNUSED void *x) {
13096 return __pyx_pw_7pymusic_5Setup_4comm_1__get__(o);
13097 }
13098
13099 static PyMethodDef __pyx_methods_7pymusic_Setup[] = {
13100 {"getcomm", (PyCFunction)__pyx_pw_7pymusic_5Setup_5getcomm, METH_NOARGS, __pyx_doc_7pymusic_5Setup_4getcomm},
13101 {"config", (PyCFunction)__pyx_pw_7pymusic_5Setup_7config, METH_O, __pyx_doc_7pymusic_5Setup_6config},
13102 {"publishContInput", (PyCFunction)__pyx_pw_7pymusic_5Setup_9publishContInput, METH_O, __pyx_doc_7pymusic_5Setup_8publishContInput},
13103 {"publishContOutput", (PyCFunction)__pyx_pw_7pymusic_5Setup_11publishContOutput, METH_O, __pyx_doc_7pymusic_5Setup_10publishContOutput},
13104 {"publishEventOutput", (PyCFunction)__pyx_pw_7pymusic_5Setup_13publishEventOutput, METH_O, __pyx_doc_7pymusic_5Setup_12publishEventOutput},
13105 {"publishEventInput", (PyCFunction)__pyx_pw_7pymusic_5Setup_15publishEventInput, METH_O, __pyx_doc_7pymusic_5Setup_14publishEventInput},
13106 {"publishMessageOutput", (PyCFunction)__pyx_pw_7pymusic_5Setup_17publishMessageOutput, METH_O, __pyx_doc_7pymusic_5Setup_16publishMessageOutput},
13107 {"publishMessageInput", (PyCFunction)__pyx_pw_7pymusic_5Setup_19publishMessageInput, METH_O, __pyx_doc_7pymusic_5Setup_18publishMessageInput},
13108 {"runtime", (PyCFunction)__pyx_pw_7pymusic_5Setup_21runtime, METH_O, __pyx_doc_7pymusic_5Setup_20runtime},
13109 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_5Setup_23__reduce_cython__, METH_NOARGS, 0},
13110 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_5Setup_25__setstate_cython__, METH_O, 0},
13111 {0, 0, 0, 0}
13112 };
13113
13114 static struct PyGetSetDef __pyx_getsets_7pymusic_Setup[] = {
13115 {(char *)"comm", __pyx_getprop_7pymusic_5Setup_comm, 0, (char *)0, 0},
13116 {0, 0, 0, 0, 0}
13117 };
13118
13119 static PyTypeObject __pyx_type_7pymusic_Setup = {
13120 PyVarObject_HEAD_INIT(0, 0)
13121 "pymusic.Setup", /*tp_name*/
13122 sizeof(struct __pyx_obj_7pymusic_Setup), /*tp_basicsize*/
13123 0, /*tp_itemsize*/
13124 __pyx_tp_dealloc_7pymusic_Setup, /*tp_dealloc*/
13125 #if PY_VERSION_HEX < 0x030800b4
13126 0, /*tp_print*/
13127 #endif
13128 #if PY_VERSION_HEX >= 0x030800b4
13129 0, /*tp_vectorcall_offset*/
13130 #endif
13131 0, /*tp_getattr*/
13132 0, /*tp_setattr*/
13133 #if PY_MAJOR_VERSION < 3
13134 0, /*tp_compare*/
13135 #endif
13136 #if PY_MAJOR_VERSION >= 3
13137 0, /*tp_as_async*/
13138 #endif
13139 0, /*tp_repr*/
13140 0, /*tp_as_number*/
13141 0, /*tp_as_sequence*/
13142 0, /*tp_as_mapping*/
13143 0, /*tp_hash*/
13144 0, /*tp_call*/
13145 0, /*tp_str*/
13146 0, /*tp_getattro*/
13147 0, /*tp_setattro*/
13148 0, /*tp_as_buffer*/
13149 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
13150 "\n API to setup the music interface.\n Becomes invalid after a Runtime object is created.\n It gives access to config variables (*.music file),\n and creates sinks and sources which can then be configured with\n the respective map method of each.\n ", /*tp_doc*/
13151 __pyx_tp_traverse_7pymusic_Setup, /*tp_traverse*/
13152 __pyx_tp_clear_7pymusic_Setup, /*tp_clear*/
13153 0, /*tp_richcompare*/
13154 0, /*tp_weaklistoffset*/
13155 0, /*tp_iter*/
13156 0, /*tp_iternext*/
13157 __pyx_methods_7pymusic_Setup, /*tp_methods*/
13158 0, /*tp_members*/
13159 __pyx_getsets_7pymusic_Setup, /*tp_getset*/
13160 0, /*tp_base*/
13161 0, /*tp_dict*/
13162 0, /*tp_descr_get*/
13163 0, /*tp_descr_set*/
13164 0, /*tp_dictoffset*/
13165 0, /*tp_init*/
13166 0, /*tp_alloc*/
13167 __pyx_tp_new_7pymusic_Setup, /*tp_new*/
13168 0, /*tp_free*/
13169 0, /*tp_is_gc*/
13170 0, /*tp_bases*/
13171 0, /*tp_mro*/
13172 0, /*tp_cache*/
13173 0, /*tp_subclasses*/
13174 0, /*tp_weaklist*/
13175 0, /*tp_del*/
13176 0, /*tp_version_tag*/
13177 #if PY_VERSION_HEX >= 0x030400a1
13178 0, /*tp_finalize*/
13179 #endif
13180 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
13181 0, /*tp_vectorcall*/
13182 #endif
13183 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13184 0, /*tp_print*/
13185 #endif
13186 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
13187 0, /*tp_pypy_flags*/
13188 #endif
13189 };
13190
13191 static PyObject *__pyx_tp_new_7pymusic_Runtime(PyTypeObject *t, PyObject *a, PyObject *k) {
13192 struct __pyx_obj_7pymusic_Runtime *p;
13193 PyObject *o;
13194 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
13195 o = (*t->tp_alloc)(t, 0);
13196 } else {
13197 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
13198 }
13199 if (unlikely(!o)) return 0;
13200 p = ((struct __pyx_obj_7pymusic_Runtime *)o);
13201 p->comm = ((struct PyMPIIntracommObject *)Py_None); Py_INCREF(Py_None);
13202 p->ports = ((PyObject*)Py_None); Py_INCREF(Py_None);
13203 if (unlikely(__pyx_pw_7pymusic_7Runtime_1__cinit__(o, a, k) < 0)) goto bad;
13204 return o;
13205 bad:
13206 Py_DECREF(o); o = 0;
13207 return NULL;
13208 }
13209
13210 static void __pyx_tp_dealloc_7pymusic_Runtime(PyObject *o) {
13211 struct __pyx_obj_7pymusic_Runtime *p = (struct __pyx_obj_7pymusic_Runtime *)o;
13212 #if CYTHON_USE_TP_FINALIZE
13213 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
13214 if (PyObject_CallFinalizerFromDealloc(o)) return;
13215 }
13216 #endif
13217 PyObject_GC_UnTrack(o);
13218 {
13219 PyObject *etype, *eval, *etb;
13220 PyErr_Fetch(&etype, &eval, &etb);
13221 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
13222 __pyx_pw_7pymusic_7Runtime_3__dealloc__(o);
13223 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
13224 PyErr_Restore(etype, eval, etb);
13225 }
13226 Py_CLEAR(p->comm);
13227 Py_CLEAR(p->ports);
13228 (*Py_TYPE(o)->tp_free)(o);
13229 }
13230
13231 static int __pyx_tp_traverse_7pymusic_Runtime(PyObject *o, visitproc v, void *a) {
13232 int e;
13233 struct __pyx_obj_7pymusic_Runtime *p = (struct __pyx_obj_7pymusic_Runtime *)o;
13234 if (p->comm) {
13235 e = (*v)(((PyObject *)p->comm), a); if (e) return e;
13236 }
13237 if (p->ports) {
13238 e = (*v)(p->ports, a); if (e) return e;
13239 }
13240 return 0;
13241 }
13242
13243 static int __pyx_tp_clear_7pymusic_Runtime(PyObject *o) {
13244 PyObject* tmp;
13245 struct __pyx_obj_7pymusic_Runtime *p = (struct __pyx_obj_7pymusic_Runtime *)o;
13246 tmp = ((PyObject*)p->comm);
13247 p->comm = ((struct PyMPIIntracommObject *)Py_None); Py_INCREF(Py_None);
13248 Py_XDECREF(tmp);
13249 tmp = ((PyObject*)p->ports);
13250 p->ports = ((PyObject*)Py_None); Py_INCREF(Py_None);
13251 Py_XDECREF(tmp);
13252 return 0;
13253 }
13254
13255 static PyObject *__pyx_getprop_7pymusic_7Runtime_comm(PyObject *o, CYTHON_UNUSED void *x) {
13256 return __pyx_pw_7pymusic_7Runtime_4comm_1__get__(o);
13257 }
13258
13259 static PyMethodDef __pyx_methods_7pymusic_Runtime[] = {
13260 {"time", (PyCFunction)__pyx_pw_7pymusic_7Runtime_5time, METH_NOARGS, 0},
13261 {"tick", (PyCFunction)__pyx_pw_7pymusic_7Runtime_7tick, METH_NOARGS, 0},
13262 {"finalize", (PyCFunction)__pyx_pw_7pymusic_7Runtime_9finalize, METH_NOARGS, 0},
13263 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_7Runtime_14__reduce_cython__, METH_NOARGS, 0},
13264 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_7Runtime_16__setstate_cython__, METH_O, 0},
13265 {0, 0, 0, 0}
13266 };
13267
13268 static struct PyGetSetDef __pyx_getsets_7pymusic_Runtime[] = {
13269 {(char *)"comm", __pyx_getprop_7pymusic_7Runtime_comm, 0, (char *)0, 0},
13270 {0, 0, 0, 0, 0}
13271 };
13272
13273 static PyTypeObject __pyx_type_7pymusic_Runtime = {
13274 PyVarObject_HEAD_INIT(0, 0)
13275 "pymusic.Runtime", /*tp_name*/
13276 sizeof(struct __pyx_obj_7pymusic_Runtime), /*tp_basicsize*/
13277 0, /*tp_itemsize*/
13278 __pyx_tp_dealloc_7pymusic_Runtime, /*tp_dealloc*/
13279 #if PY_VERSION_HEX < 0x030800b4
13280 0, /*tp_print*/
13281 #endif
13282 #if PY_VERSION_HEX >= 0x030800b4
13283 0, /*tp_vectorcall_offset*/
13284 #endif
13285 0, /*tp_getattr*/
13286 0, /*tp_setattr*/
13287 #if PY_MAJOR_VERSION < 3
13288 0, /*tp_compare*/
13289 #endif
13290 #if PY_MAJOR_VERSION >= 3
13291 0, /*tp_as_async*/
13292 #endif
13293 0, /*tp_repr*/
13294 0, /*tp_as_number*/
13295 0, /*tp_as_sequence*/
13296 0, /*tp_as_mapping*/
13297 0, /*tp_hash*/
13298 0, /*tp_call*/
13299 0, /*tp_str*/
13300 0, /*tp_getattro*/
13301 0, /*tp_setattro*/
13302 0, /*tp_as_buffer*/
13303 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
13304 0, /*tp_doc*/
13305 __pyx_tp_traverse_7pymusic_Runtime, /*tp_traverse*/
13306 __pyx_tp_clear_7pymusic_Runtime, /*tp_clear*/
13307 0, /*tp_richcompare*/
13308 0, /*tp_weaklistoffset*/
13309 __pyx_pw_7pymusic_7Runtime_11__iter__, /*tp_iter*/
13310 0, /*tp_iternext*/
13311 __pyx_methods_7pymusic_Runtime, /*tp_methods*/
13312 0, /*tp_members*/
13313 __pyx_getsets_7pymusic_Runtime, /*tp_getset*/
13314 0, /*tp_base*/
13315 0, /*tp_dict*/
13316 0, /*tp_descr_get*/
13317 0, /*tp_descr_set*/
13318 0, /*tp_dictoffset*/
13319 0, /*tp_init*/
13320 0, /*tp_alloc*/
13321 __pyx_tp_new_7pymusic_Runtime, /*tp_new*/
13322 0, /*tp_free*/
13323 0, /*tp_is_gc*/
13324 0, /*tp_bases*/
13325 0, /*tp_mro*/
13326 0, /*tp_cache*/
13327 0, /*tp_subclasses*/
13328 0, /*tp_weaklist*/
13329 0, /*tp_del*/
13330 0, /*tp_version_tag*/
13331 #if PY_VERSION_HEX >= 0x030400a1
13332 0, /*tp_finalize*/
13333 #endif
13334 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
13335 0, /*tp_vectorcall*/
13336 #endif
13337 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13338 0, /*tp_print*/
13339 #endif
13340 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
13341 0, /*tp_pypy_flags*/
13342 #endif
13343 };
13344 static struct __pyx_vtabstruct_7pymusic_Port __pyx_vtable_7pymusic_Port;
13345
13346 static PyObject *__pyx_tp_new_7pymusic_Port(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
13347 struct __pyx_obj_7pymusic_Port *p;
13348 PyObject *o;
13349 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
13350 o = (*t->tp_alloc)(t, 0);
13351 } else {
13352 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
13353 }
13354 if (unlikely(!o)) return 0;
13355 p = ((struct __pyx_obj_7pymusic_Port *)o);
13356 p->__pyx_vtab = __pyx_vtabptr_7pymusic_Port;
13357 if (unlikely(__pyx_pw_7pymusic_4Port_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
13358 return o;
13359 bad:
13360 Py_DECREF(o); o = 0;
13361 return NULL;
13362 }
13363
13364 static void __pyx_tp_dealloc_7pymusic_Port(PyObject *o) {
13365 #if CYTHON_USE_TP_FINALIZE
13366 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))) {
13367 if (PyObject_CallFinalizerFromDealloc(o)) return;
13368 }
13369 #endif
13370 (*Py_TYPE(o)->tp_free)(o);
13371 }
13372
13373 static PyMethodDef __pyx_methods_7pymusic_Port[] = {
13374 {"null", (PyCFunction)__pyx_pw_7pymusic_4Port_5null, METH_NOARGS, __pyx_doc_7pymusic_4Port_4null},
13375 {"isConnected", (PyCFunction)__pyx_pw_7pymusic_4Port_7isConnected, METH_NOARGS, __pyx_doc_7pymusic_4Port_6isConnected},
13376 {"width", (PyCFunction)__pyx_pw_7pymusic_4Port_9width, METH_NOARGS, __pyx_doc_7pymusic_4Port_8width},
13377 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_4Port_11__reduce_cython__, METH_NOARGS, 0},
13378 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_4Port_13__setstate_cython__, METH_O, 0},
13379 {0, 0, 0, 0}
13380 };
13381
13382 static PyTypeObject __pyx_type_7pymusic_Port = {
13383 PyVarObject_HEAD_INIT(0, 0)
13384 "pymusic.Port", /*tp_name*/
13385 sizeof(struct __pyx_obj_7pymusic_Port), /*tp_basicsize*/
13386 0, /*tp_itemsize*/
13387 __pyx_tp_dealloc_7pymusic_Port, /*tp_dealloc*/
13388 #if PY_VERSION_HEX < 0x030800b4
13389 0, /*tp_print*/
13390 #endif
13391 #if PY_VERSION_HEX >= 0x030800b4
13392 0, /*tp_vectorcall_offset*/
13393 #endif
13394 0, /*tp_getattr*/
13395 0, /*tp_setattr*/
13396 #if PY_MAJOR_VERSION < 3
13397 0, /*tp_compare*/
13398 #endif
13399 #if PY_MAJOR_VERSION >= 3
13400 0, /*tp_as_async*/
13401 #endif
13402 0, /*tp_repr*/
13403 0, /*tp_as_number*/
13404 0, /*tp_as_sequence*/
13405 0, /*tp_as_mapping*/
13406 __pyx_pw_7pymusic_4Port_3__hash__, /*tp_hash*/
13407 0, /*tp_call*/
13408 0, /*tp_str*/
13409 0, /*tp_getattro*/
13410 0, /*tp_setattro*/
13411 0, /*tp_as_buffer*/
13412 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
13413 "\n Base Port class.\n\n The underlying pointer is not deallocated here, since in MUSIC the\n port is owned by Setup/Runtime. This does null the value when we\n believe the underlying object may be deallocated by the\n container.\n ", /*tp_doc*/
13414 0, /*tp_traverse*/
13415 0, /*tp_clear*/
13416 0, /*tp_richcompare*/
13417 0, /*tp_weaklistoffset*/
13418 0, /*tp_iter*/
13419 0, /*tp_iternext*/
13420 __pyx_methods_7pymusic_Port, /*tp_methods*/
13421 0, /*tp_members*/
13422 0, /*tp_getset*/
13423 0, /*tp_base*/
13424 0, /*tp_dict*/
13425 0, /*tp_descr_get*/
13426 0, /*tp_descr_set*/
13427 0, /*tp_dictoffset*/
13428 0, /*tp_init*/
13429 0, /*tp_alloc*/
13430 __pyx_tp_new_7pymusic_Port, /*tp_new*/
13431 0, /*tp_free*/
13432 0, /*tp_is_gc*/
13433 0, /*tp_bases*/
13434 0, /*tp_mro*/
13435 0, /*tp_cache*/
13436 0, /*tp_subclasses*/
13437 0, /*tp_weaklist*/
13438 0, /*tp_del*/
13439 0, /*tp_version_tag*/
13440 #if PY_VERSION_HEX >= 0x030400a1
13441 0, /*tp_finalize*/
13442 #endif
13443 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
13444 0, /*tp_vectorcall*/
13445 #endif
13446 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13447 0, /*tp_print*/
13448 #endif
13449 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
13450 0, /*tp_pypy_flags*/
13451 #endif
13452 };
13453 static struct __pyx_vtabstruct_7pymusic_ContInputPort __pyx_vtable_7pymusic_ContInputPort;
13454
13455 static PyObject *__pyx_tp_new_7pymusic_ContInputPort(PyTypeObject *t, PyObject *a, PyObject *k) {
13456 struct __pyx_obj_7pymusic_ContInputPort *p;
13457 PyObject *o = __pyx_tp_new_7pymusic_Port(t, a, k);
13458 if (unlikely(!o)) return 0;
13459 p = ((struct __pyx_obj_7pymusic_ContInputPort *)o);
13460 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pymusic_Port*)__pyx_vtabptr_7pymusic_ContInputPort;
13461 return o;
13462 }
13463
13464 static PyMethodDef __pyx_methods_7pymusic_ContInputPort[] = {
13465 {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_13ContInputPort_1map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_13ContInputPort_map},
13466 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_13ContInputPort_3__reduce_cython__, METH_NOARGS, 0},
13467 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_13ContInputPort_5__setstate_cython__, METH_O, 0},
13468 {0, 0, 0, 0}
13469 };
13470
13471 static PyTypeObject __pyx_type_7pymusic_ContInputPort = {
13472 PyVarObject_HEAD_INIT(0, 0)
13473 "pymusic.ContInputPort", /*tp_name*/
13474 sizeof(struct __pyx_obj_7pymusic_ContInputPort), /*tp_basicsize*/
13475 0, /*tp_itemsize*/
13476 __pyx_tp_dealloc_7pymusic_Port, /*tp_dealloc*/
13477 #if PY_VERSION_HEX < 0x030800b4
13478 0, /*tp_print*/
13479 #endif
13480 #if PY_VERSION_HEX >= 0x030800b4
13481 0, /*tp_vectorcall_offset*/
13482 #endif
13483 0, /*tp_getattr*/
13484 0, /*tp_setattr*/
13485 #if PY_MAJOR_VERSION < 3
13486 0, /*tp_compare*/
13487 #endif
13488 #if PY_MAJOR_VERSION >= 3
13489 0, /*tp_as_async*/
13490 #endif
13491 0, /*tp_repr*/
13492 0, /*tp_as_number*/
13493 0, /*tp_as_sequence*/
13494 0, /*tp_as_mapping*/
13495 0, /*tp_hash*/
13496 0, /*tp_call*/
13497 0, /*tp_str*/
13498 0, /*tp_getattro*/
13499 0, /*tp_setattro*/
13500 0, /*tp_as_buffer*/
13501 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
13502 "\n ContInputPort maps data indices between sources and sinks. This is\n the sink side; source is ContOutputPort. Created by\n Setup.publishContInputPort(portname).\n ", /*tp_doc*/
13503 0, /*tp_traverse*/
13504 0, /*tp_clear*/
13505 0, /*tp_richcompare*/
13506 0, /*tp_weaklistoffset*/
13507 0, /*tp_iter*/
13508 0, /*tp_iternext*/
13509 __pyx_methods_7pymusic_ContInputPort, /*tp_methods*/
13510 0, /*tp_members*/
13511 0, /*tp_getset*/
13512 0, /*tp_base*/
13513 0, /*tp_dict*/
13514 0, /*tp_descr_get*/
13515 0, /*tp_descr_set*/
13516 0, /*tp_dictoffset*/
13517 0, /*tp_init*/
13518 0, /*tp_alloc*/
13519 __pyx_tp_new_7pymusic_ContInputPort, /*tp_new*/
13520 0, /*tp_free*/
13521 0, /*tp_is_gc*/
13522 0, /*tp_bases*/
13523 0, /*tp_mro*/
13524 0, /*tp_cache*/
13525 0, /*tp_subclasses*/
13526 0, /*tp_weaklist*/
13527 0, /*tp_del*/
13528 0, /*tp_version_tag*/
13529 #if PY_VERSION_HEX >= 0x030400a1
13530 0, /*tp_finalize*/
13531 #endif
13532 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
13533 0, /*tp_vectorcall*/
13534 #endif
13535 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13536 0, /*tp_print*/
13537 #endif
13538 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
13539 0, /*tp_pypy_flags*/
13540 #endif
13541 };
13542 static struct __pyx_vtabstruct_7pymusic_ContOutputPort __pyx_vtable_7pymusic_ContOutputPort;
13543
13544 static PyObject *__pyx_tp_new_7pymusic_ContOutputPort(PyTypeObject *t, PyObject *a, PyObject *k) {
13545 struct __pyx_obj_7pymusic_ContOutputPort *p;
13546 PyObject *o = __pyx_tp_new_7pymusic_Port(t, a, k);
13547 if (unlikely(!o)) return 0;
13548 p = ((struct __pyx_obj_7pymusic_ContOutputPort *)o);
13549 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pymusic_Port*)__pyx_vtabptr_7pymusic_ContOutputPort;
13550 return o;
13551 }
13552
13553 static PyMethodDef __pyx_methods_7pymusic_ContOutputPort[] = {
13554 {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_14ContOutputPort_1map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_14ContOutputPort_map},
13555 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_14ContOutputPort_3__reduce_cython__, METH_NOARGS, 0},
13556 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_14ContOutputPort_5__setstate_cython__, METH_O, 0},
13557 {0, 0, 0, 0}
13558 };
13559
13560 static PyTypeObject __pyx_type_7pymusic_ContOutputPort = {
13561 PyVarObject_HEAD_INIT(0, 0)
13562 "pymusic.ContOutputPort", /*tp_name*/
13563 sizeof(struct __pyx_obj_7pymusic_ContOutputPort), /*tp_basicsize*/
13564 0, /*tp_itemsize*/
13565 __pyx_tp_dealloc_7pymusic_Port, /*tp_dealloc*/
13566 #if PY_VERSION_HEX < 0x030800b4
13567 0, /*tp_print*/
13568 #endif
13569 #if PY_VERSION_HEX >= 0x030800b4
13570 0, /*tp_vectorcall_offset*/
13571 #endif
13572 0, /*tp_getattr*/
13573 0, /*tp_setattr*/
13574 #if PY_MAJOR_VERSION < 3
13575 0, /*tp_compare*/
13576 #endif
13577 #if PY_MAJOR_VERSION >= 3
13578 0, /*tp_as_async*/
13579 #endif
13580 0, /*tp_repr*/
13581 0, /*tp_as_number*/
13582 0, /*tp_as_sequence*/
13583 0, /*tp_as_mapping*/
13584 0, /*tp_hash*/
13585 0, /*tp_call*/
13586 0, /*tp_str*/
13587 0, /*tp_getattro*/
13588 0, /*tp_setattro*/
13589 0, /*tp_as_buffer*/
13590 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
13591 "\n ContOutputPort maps data indices between sources and sinks. This\n is the source side; ContInputPort is the sink. Created by\n Setup.publishContOutputPort(portname).\n ", /*tp_doc*/
13592 0, /*tp_traverse*/
13593 0, /*tp_clear*/
13594 0, /*tp_richcompare*/
13595 0, /*tp_weaklistoffset*/
13596 0, /*tp_iter*/
13597 0, /*tp_iternext*/
13598 __pyx_methods_7pymusic_ContOutputPort, /*tp_methods*/
13599 0, /*tp_members*/
13600 0, /*tp_getset*/
13601 0, /*tp_base*/
13602 0, /*tp_dict*/
13603 0, /*tp_descr_get*/
13604 0, /*tp_descr_set*/
13605 0, /*tp_dictoffset*/
13606 0, /*tp_init*/
13607 0, /*tp_alloc*/
13608 __pyx_tp_new_7pymusic_ContOutputPort, /*tp_new*/
13609 0, /*tp_free*/
13610 0, /*tp_is_gc*/
13611 0, /*tp_bases*/
13612 0, /*tp_mro*/
13613 0, /*tp_cache*/
13614 0, /*tp_subclasses*/
13615 0, /*tp_weaklist*/
13616 0, /*tp_del*/
13617 0, /*tp_version_tag*/
13618 #if PY_VERSION_HEX >= 0x030400a1
13619 0, /*tp_finalize*/
13620 #endif
13621 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
13622 0, /*tp_vectorcall*/
13623 #endif
13624 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13625 0, /*tp_print*/
13626 #endif
13627 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
13628 0, /*tp_pypy_flags*/
13629 #endif
13630 };
13631 static struct __pyx_vtabstruct_7pymusic_EventInputPort __pyx_vtable_7pymusic_EventInputPort;
13632
13633 static PyObject *__pyx_tp_new_7pymusic_EventInputPort(PyTypeObject *t, PyObject *a, PyObject *k) {
13634 struct __pyx_obj_7pymusic_EventInputPort *p;
13635 PyObject *o = __pyx_tp_new_7pymusic_Port(t, a, k);
13636 if (unlikely(!o)) return 0;
13637 p = ((struct __pyx_obj_7pymusic_EventInputPort *)o);
13638 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pymusic_Port*)__pyx_vtabptr_7pymusic_EventInputPort;
13639 p->events = ((PyObject*)Py_None); Py_INCREF(Py_None);
13640 if (unlikely(__pyx_pw_7pymusic_14EventInputPort_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
13641 return o;
13642 bad:
13643 Py_DECREF(o); o = 0;
13644 return NULL;
13645 }
13646
13647 static void __pyx_tp_dealloc_7pymusic_EventInputPort(PyObject *o) {
13648 struct __pyx_obj_7pymusic_EventInputPort *p = (struct __pyx_obj_7pymusic_EventInputPort *)o;
13649 #if CYTHON_USE_TP_FINALIZE
13650 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
13651 if (PyObject_CallFinalizerFromDealloc(o)) return;
13652 }
13653 #endif
13654 PyObject_GC_UnTrack(o);
13655 Py_CLEAR(p->events);
13656 #if CYTHON_USE_TYPE_SLOTS
13657 if (PyType_IS_GC(Py_TYPE(o)->tp_base))
13658 #endif
13659 PyObject_GC_Track(o);
13660 __pyx_tp_dealloc_7pymusic_Port(o);
13661 }
13662
13663 static int __pyx_tp_traverse_7pymusic_EventInputPort(PyObject *o, visitproc v, void *a) {
13664 int e;
13665 struct __pyx_obj_7pymusic_EventInputPort *p = (struct __pyx_obj_7pymusic_EventInputPort *)o;
13666 e = ((likely(__pyx_ptype_7pymusic_Port)) ? ((__pyx_ptype_7pymusic_Port->tp_traverse) ? __pyx_ptype_7pymusic_Port->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pymusic_EventInputPort)); if (e) return e;
13667 if (p->events) {
13668 e = (*v)(p->events, a); if (e) return e;
13669 }
13670 return 0;
13671 }
13672
13673 static int __pyx_tp_clear_7pymusic_EventInputPort(PyObject *o) {
13674 PyObject* tmp;
13675 struct __pyx_obj_7pymusic_EventInputPort *p = (struct __pyx_obj_7pymusic_EventInputPort *)o;
13676 if (likely(__pyx_ptype_7pymusic_Port)) { if (__pyx_ptype_7pymusic_Port->tp_clear) __pyx_ptype_7pymusic_Port->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pymusic_EventInputPort);
13677 tmp = ((PyObject*)p->events);
13678 p->events = ((PyObject*)Py_None); Py_INCREF(Py_None);
13679 Py_XDECREF(tmp);
13680 return 0;
13681 }
13682
13683 static PyMethodDef __pyx_methods_7pymusic_EventInputPort[] = {
13684 {"null", (PyCFunction)__pyx_pw_7pymusic_14EventInputPort_3null, METH_NOARGS, __pyx_doc_7pymusic_14EventInputPort_2null},
13685 {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_14EventInputPort_5map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_14EventInputPort_4map},
13686 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_14EventInputPort_7__reduce_cython__, METH_NOARGS, 0},
13687 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_14EventInputPort_9__setstate_cython__, METH_O, 0},
13688 {0, 0, 0, 0}
13689 };
13690
13691 static PyTypeObject __pyx_type_7pymusic_EventInputPort = {
13692 PyVarObject_HEAD_INIT(0, 0)
13693 "pymusic.EventInputPort", /*tp_name*/
13694 sizeof(struct __pyx_obj_7pymusic_EventInputPort), /*tp_basicsize*/
13695 0, /*tp_itemsize*/
13696 __pyx_tp_dealloc_7pymusic_EventInputPort, /*tp_dealloc*/
13697 #if PY_VERSION_HEX < 0x030800b4
13698 0, /*tp_print*/
13699 #endif
13700 #if PY_VERSION_HEX >= 0x030800b4
13701 0, /*tp_vectorcall_offset*/
13702 #endif
13703 0, /*tp_getattr*/
13704 0, /*tp_setattr*/
13705 #if PY_MAJOR_VERSION < 3
13706 0, /*tp_compare*/
13707 #endif
13708 #if PY_MAJOR_VERSION >= 3
13709 0, /*tp_as_async*/
13710 #endif
13711 0, /*tp_repr*/
13712 0, /*tp_as_number*/
13713 0, /*tp_as_sequence*/
13714 0, /*tp_as_mapping*/
13715 0, /*tp_hash*/
13716 0, /*tp_call*/
13717 0, /*tp_str*/
13718 0, /*tp_getattro*/
13719 0, /*tp_setattro*/
13720 0, /*tp_as_buffer*/
13721 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
13722 "\n Event sink. Maps 'events' to handlers. Events are spike-like\n events at a defined time associated with an id, either/or\n global/local in some (unclear to me) way.\n\n Since these 'events' must be protected from deallocation as long\n as the port exists (until finalization), we keep a set of them\n here and drop the reference when this object is null'd (events member).\n ", /*tp_doc*/
13723 __pyx_tp_traverse_7pymusic_EventInputPort, /*tp_traverse*/
13724 __pyx_tp_clear_7pymusic_EventInputPort, /*tp_clear*/
13725 0, /*tp_richcompare*/
13726 0, /*tp_weaklistoffset*/
13727 0, /*tp_iter*/
13728 0, /*tp_iternext*/
13729 __pyx_methods_7pymusic_EventInputPort, /*tp_methods*/
13730 0, /*tp_members*/
13731 0, /*tp_getset*/
13732 0, /*tp_base*/
13733 0, /*tp_dict*/
13734 0, /*tp_descr_get*/
13735 0, /*tp_descr_set*/
13736 0, /*tp_dictoffset*/
13737 0, /*tp_init*/
13738 0, /*tp_alloc*/
13739 __pyx_tp_new_7pymusic_EventInputPort, /*tp_new*/
13740 0, /*tp_free*/
13741 0, /*tp_is_gc*/
13742 0, /*tp_bases*/
13743 0, /*tp_mro*/
13744 0, /*tp_cache*/
13745 0, /*tp_subclasses*/
13746 0, /*tp_weaklist*/
13747 0, /*tp_del*/
13748 0, /*tp_version_tag*/
13749 #if PY_VERSION_HEX >= 0x030400a1
13750 0, /*tp_finalize*/
13751 #endif
13752 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
13753 0, /*tp_vectorcall*/
13754 #endif
13755 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13756 0, /*tp_print*/
13757 #endif
13758 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
13759 0, /*tp_pypy_flags*/
13760 #endif
13761 };
13762 static struct __pyx_vtabstruct_7pymusic_EventOutputPort __pyx_vtable_7pymusic_EventOutputPort;
13763
13764 static PyObject *__pyx_tp_new_7pymusic_EventOutputPort(PyTypeObject *t, PyObject *a, PyObject *k) {
13765 struct __pyx_obj_7pymusic_EventOutputPort *p;
13766 PyObject *o = __pyx_tp_new_7pymusic_Port(t, a, k);
13767 if (unlikely(!o)) return 0;
13768 p = ((struct __pyx_obj_7pymusic_EventOutputPort *)o);
13769 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pymusic_Port*)__pyx_vtabptr_7pymusic_EventOutputPort;
13770 return o;
13771 }
13772
13773 static PyMethodDef __pyx_methods_7pymusic_EventOutputPort[] = {
13774 {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_15EventOutputPort_1map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_15EventOutputPort_map},
13775 {"insertEvent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_15EventOutputPort_3insertEvent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_15EventOutputPort_2insertEvent},
13776 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_15EventOutputPort_5__reduce_cython__, METH_NOARGS, 0},
13777 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_15EventOutputPort_7__setstate_cython__, METH_O, 0},
13778 {0, 0, 0, 0}
13779 };
13780
13781 static PyTypeObject __pyx_type_7pymusic_EventOutputPort = {
13782 PyVarObject_HEAD_INIT(0, 0)
13783 "pymusic.EventOutputPort", /*tp_name*/
13784 sizeof(struct __pyx_obj_7pymusic_EventOutputPort), /*tp_basicsize*/
13785 0, /*tp_itemsize*/
13786 __pyx_tp_dealloc_7pymusic_Port, /*tp_dealloc*/
13787 #if PY_VERSION_HEX < 0x030800b4
13788 0, /*tp_print*/
13789 #endif
13790 #if PY_VERSION_HEX >= 0x030800b4
13791 0, /*tp_vectorcall_offset*/
13792 #endif
13793 0, /*tp_getattr*/
13794 0, /*tp_setattr*/
13795 #if PY_MAJOR_VERSION < 3
13796 0, /*tp_compare*/
13797 #endif
13798 #if PY_MAJOR_VERSION >= 3
13799 0, /*tp_as_async*/
13800 #endif
13801 0, /*tp_repr*/
13802 0, /*tp_as_number*/
13803 0, /*tp_as_sequence*/
13804 0, /*tp_as_mapping*/
13805 0, /*tp_hash*/
13806 0, /*tp_call*/
13807 0, /*tp_str*/
13808 0, /*tp_getattro*/
13809 0, /*tp_setattro*/
13810 0, /*tp_as_buffer*/
13811 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
13812 "\n Map events from this sink. See EventInputPort for description of\n events.\n ", /*tp_doc*/
13813 0, /*tp_traverse*/
13814 0, /*tp_clear*/
13815 0, /*tp_richcompare*/
13816 0, /*tp_weaklistoffset*/
13817 0, /*tp_iter*/
13818 0, /*tp_iternext*/
13819 __pyx_methods_7pymusic_EventOutputPort, /*tp_methods*/
13820 0, /*tp_members*/
13821 0, /*tp_getset*/
13822 0, /*tp_base*/
13823 0, /*tp_dict*/
13824 0, /*tp_descr_get*/
13825 0, /*tp_descr_set*/
13826 0, /*tp_dictoffset*/
13827 0, /*tp_init*/
13828 0, /*tp_alloc*/
13829 __pyx_tp_new_7pymusic_EventOutputPort, /*tp_new*/
13830 0, /*tp_free*/
13831 0, /*tp_is_gc*/
13832 0, /*tp_bases*/
13833 0, /*tp_mro*/
13834 0, /*tp_cache*/
13835 0, /*tp_subclasses*/
13836 0, /*tp_weaklist*/
13837 0, /*tp_del*/
13838 0, /*tp_version_tag*/
13839 #if PY_VERSION_HEX >= 0x030400a1
13840 0, /*tp_finalize*/
13841 #endif
13842 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
13843 0, /*tp_vectorcall*/
13844 #endif
13845 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13846 0, /*tp_print*/
13847 #endif
13848 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
13849 0, /*tp_pypy_flags*/
13850 #endif
13851 };
13852 static struct __pyx_vtabstruct_7pymusic_MessageInputPort __pyx_vtable_7pymusic_MessageInputPort;
13853
13854 static PyObject *__pyx_tp_new_7pymusic_MessageInputPort(PyTypeObject *t, PyObject *a, PyObject *k) {
13855 struct __pyx_obj_7pymusic_MessageInputPort *p;
13856 PyObject *o = __pyx_tp_new_7pymusic_Port(t, a, k);
13857 if (unlikely(!o)) return 0;
13858 p = ((struct __pyx_obj_7pymusic_MessageInputPort *)o);
13859 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pymusic_Port*)__pyx_vtabptr_7pymusic_MessageInputPort;
13860 p->events = ((PyObject*)Py_None); Py_INCREF(Py_None);
13861 if (unlikely(__pyx_pw_7pymusic_16MessageInputPort_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
13862 return o;
13863 bad:
13864 Py_DECREF(o); o = 0;
13865 return NULL;
13866 }
13867
13868 static void __pyx_tp_dealloc_7pymusic_MessageInputPort(PyObject *o) {
13869 struct __pyx_obj_7pymusic_MessageInputPort *p = (struct __pyx_obj_7pymusic_MessageInputPort *)o;
13870 #if CYTHON_USE_TP_FINALIZE
13871 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
13872 if (PyObject_CallFinalizerFromDealloc(o)) return;
13873 }
13874 #endif
13875 PyObject_GC_UnTrack(o);
13876 Py_CLEAR(p->events);
13877 #if CYTHON_USE_TYPE_SLOTS
13878 if (PyType_IS_GC(Py_TYPE(o)->tp_base))
13879 #endif
13880 PyObject_GC_Track(o);
13881 __pyx_tp_dealloc_7pymusic_Port(o);
13882 }
13883
13884 static int __pyx_tp_traverse_7pymusic_MessageInputPort(PyObject *o, visitproc v, void *a) {
13885 int e;
13886 struct __pyx_obj_7pymusic_MessageInputPort *p = (struct __pyx_obj_7pymusic_MessageInputPort *)o;
13887 e = ((likely(__pyx_ptype_7pymusic_Port)) ? ((__pyx_ptype_7pymusic_Port->tp_traverse) ? __pyx_ptype_7pymusic_Port->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pymusic_MessageInputPort)); if (e) return e;
13888 if (p->events) {
13889 e = (*v)(p->events, a); if (e) return e;
13890 }
13891 return 0;
13892 }
13893
13894 static int __pyx_tp_clear_7pymusic_MessageInputPort(PyObject *o) {
13895 PyObject* tmp;
13896 struct __pyx_obj_7pymusic_MessageInputPort *p = (struct __pyx_obj_7pymusic_MessageInputPort *)o;
13897 if (likely(__pyx_ptype_7pymusic_Port)) { if (__pyx_ptype_7pymusic_Port->tp_clear) __pyx_ptype_7pymusic_Port->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pymusic_MessageInputPort);
13898 tmp = ((PyObject*)p->events);
13899 p->events = ((PyObject*)Py_None); Py_INCREF(Py_None);
13900 Py_XDECREF(tmp);
13901 return 0;
13902 }
13903
13904 static PyMethodDef __pyx_methods_7pymusic_MessageInputPort[] = {
13905 {"null", (PyCFunction)__pyx_pw_7pymusic_16MessageInputPort_3null, METH_NOARGS, __pyx_doc_7pymusic_16MessageInputPort_2null},
13906 {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_16MessageInputPort_5map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_16MessageInputPort_4map},
13907 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_16MessageInputPort_7__reduce_cython__, METH_NOARGS, 0},
13908 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_16MessageInputPort_9__setstate_cython__, METH_O, 0},
13909 {0, 0, 0, 0}
13910 };
13911
13912 static PyTypeObject __pyx_type_7pymusic_MessageInputPort = {
13913 PyVarObject_HEAD_INIT(0, 0)
13914 "pymusic.MessageInputPort", /*tp_name*/
13915 sizeof(struct __pyx_obj_7pymusic_MessageInputPort), /*tp_basicsize*/
13916 0, /*tp_itemsize*/
13917 __pyx_tp_dealloc_7pymusic_MessageInputPort, /*tp_dealloc*/
13918 #if PY_VERSION_HEX < 0x030800b4
13919 0, /*tp_print*/
13920 #endif
13921 #if PY_VERSION_HEX >= 0x030800b4
13922 0, /*tp_vectorcall_offset*/
13923 #endif
13924 0, /*tp_getattr*/
13925 0, /*tp_setattr*/
13926 #if PY_MAJOR_VERSION < 3
13927 0, /*tp_compare*/
13928 #endif
13929 #if PY_MAJOR_VERSION >= 3
13930 0, /*tp_as_async*/
13931 #endif
13932 0, /*tp_repr*/
13933 0, /*tp_as_number*/
13934 0, /*tp_as_sequence*/
13935 0, /*tp_as_mapping*/
13936 0, /*tp_hash*/
13937 0, /*tp_call*/
13938 0, /*tp_str*/
13939 0, /*tp_getattro*/
13940 0, /*tp_setattro*/
13941 0, /*tp_as_buffer*/
13942 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
13943 "\n Maps 'events' to handlers.\n\n Since these 'events' must be protected from deallocation as long\n as the port exists (until finalization), we keep a set of them\n here and drop the reference when this object is null'd.\n ", /*tp_doc*/
13944 __pyx_tp_traverse_7pymusic_MessageInputPort, /*tp_traverse*/
13945 __pyx_tp_clear_7pymusic_MessageInputPort, /*tp_clear*/
13946 0, /*tp_richcompare*/
13947 0, /*tp_weaklistoffset*/
13948 0, /*tp_iter*/
13949 0, /*tp_iternext*/
13950 __pyx_methods_7pymusic_MessageInputPort, /*tp_methods*/
13951 0, /*tp_members*/
13952 0, /*tp_getset*/
13953 0, /*tp_base*/
13954 0, /*tp_dict*/
13955 0, /*tp_descr_get*/
13956 0, /*tp_descr_set*/
13957 0, /*tp_dictoffset*/
13958 0, /*tp_init*/
13959 0, /*tp_alloc*/
13960 __pyx_tp_new_7pymusic_MessageInputPort, /*tp_new*/
13961 0, /*tp_free*/
13962 0, /*tp_is_gc*/
13963 0, /*tp_bases*/
13964 0, /*tp_mro*/
13965 0, /*tp_cache*/
13966 0, /*tp_subclasses*/
13967 0, /*tp_weaklist*/
13968 0, /*tp_del*/
13969 0, /*tp_version_tag*/
13970 #if PY_VERSION_HEX >= 0x030400a1
13971 0, /*tp_finalize*/
13972 #endif
13973 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
13974 0, /*tp_vectorcall*/
13975 #endif
13976 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13977 0, /*tp_print*/
13978 #endif
13979 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
13980 0, /*tp_pypy_flags*/
13981 #endif
13982 };
13983 static struct __pyx_vtabstruct_7pymusic_MessageOutputPort __pyx_vtable_7pymusic_MessageOutputPort;
13984
13985 static PyObject *__pyx_tp_new_7pymusic_MessageOutputPort(PyTypeObject *t, PyObject *a, PyObject *k) {
13986 struct __pyx_obj_7pymusic_MessageOutputPort *p;
13987 PyObject *o = __pyx_tp_new_7pymusic_Port(t, a, k);
13988 if (unlikely(!o)) return 0;
13989 p = ((struct __pyx_obj_7pymusic_MessageOutputPort *)o);
13990 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pymusic_Port*)__pyx_vtabptr_7pymusic_MessageOutputPort;
13991 return o;
13992 }
13993
13994 static PyMethodDef __pyx_methods_7pymusic_MessageOutputPort[] = {
13995 {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_17MessageOutputPort_1map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_17MessageOutputPort_map},
13996 {"insertMessage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pymusic_17MessageOutputPort_3insertMessage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pymusic_17MessageOutputPort_2insertMessage},
13997 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_17MessageOutputPort_5__reduce_cython__, METH_NOARGS, 0},
13998 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_17MessageOutputPort_7__setstate_cython__, METH_O, 0},
13999 {0, 0, 0, 0}
14000 };
14001
14002 static PyTypeObject __pyx_type_7pymusic_MessageOutputPort = {
14003 PyVarObject_HEAD_INIT(0, 0)
14004 "pymusic.MessageOutputPort", /*tp_name*/
14005 sizeof(struct __pyx_obj_7pymusic_MessageOutputPort), /*tp_basicsize*/
14006 0, /*tp_itemsize*/
14007 __pyx_tp_dealloc_7pymusic_Port, /*tp_dealloc*/
14008 #if PY_VERSION_HEX < 0x030800b4
14009 0, /*tp_print*/
14010 #endif
14011 #if PY_VERSION_HEX >= 0x030800b4
14012 0, /*tp_vectorcall_offset*/
14013 #endif
14014 0, /*tp_getattr*/
14015 0, /*tp_setattr*/
14016 #if PY_MAJOR_VERSION < 3
14017 0, /*tp_compare*/
14018 #endif
14019 #if PY_MAJOR_VERSION >= 3
14020 0, /*tp_as_async*/
14021 #endif
14022 0, /*tp_repr*/
14023 0, /*tp_as_number*/
14024 0, /*tp_as_sequence*/
14025 0, /*tp_as_mapping*/
14026 0, /*tp_hash*/
14027 0, /*tp_call*/
14028 0, /*tp_str*/
14029 0, /*tp_getattro*/
14030 0, /*tp_setattro*/
14031 0, /*tp_as_buffer*/
14032 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
14033 "\n The source of \"messages\". A message is a python object that is\n pickled and fed to the other end, associated with a time.\n ", /*tp_doc*/
14034 0, /*tp_traverse*/
14035 0, /*tp_clear*/
14036 0, /*tp_richcompare*/
14037 0, /*tp_weaklistoffset*/
14038 0, /*tp_iter*/
14039 0, /*tp_iternext*/
14040 __pyx_methods_7pymusic_MessageOutputPort, /*tp_methods*/
14041 0, /*tp_members*/
14042 0, /*tp_getset*/
14043 0, /*tp_base*/
14044 0, /*tp_dict*/
14045 0, /*tp_descr_get*/
14046 0, /*tp_descr_set*/
14047 0, /*tp_dictoffset*/
14048 0, /*tp_init*/
14049 0, /*tp_alloc*/
14050 __pyx_tp_new_7pymusic_MessageOutputPort, /*tp_new*/
14051 0, /*tp_free*/
14052 0, /*tp_is_gc*/
14053 0, /*tp_bases*/
14054 0, /*tp_mro*/
14055 0, /*tp_cache*/
14056 0, /*tp_subclasses*/
14057 0, /*tp_weaklist*/
14058 0, /*tp_del*/
14059 0, /*tp_version_tag*/
14060 #if PY_VERSION_HEX >= 0x030400a1
14061 0, /*tp_finalize*/
14062 #endif
14063 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
14064 0, /*tp_vectorcall*/
14065 #endif
14066 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
14067 0, /*tp_print*/
14068 #endif
14069 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
14070 0, /*tp_pypy_flags*/
14071 #endif
14072 };
14073
14074 static PyObject *__pyx_tp_new_7pymusic_DataMap(PyTypeObject *t, PyObject *a, PyObject *k) {
14075 struct __pyx_obj_7pymusic_DataMap *p;
14076 PyObject *o;
14077 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
14078 o = (*t->tp_alloc)(t, 0);
14079 } else {
14080 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
14081 }
14082 if (unlikely(!o)) return 0;
14083 p = ((struct __pyx_obj_7pymusic_DataMap *)o);
14084 p->buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)Py_None); Py_INCREF(Py_None);
14085 if (unlikely(__pyx_pw_7pymusic_7DataMap_1__cinit__(o, a, k) < 0)) goto bad;
14086 return o;
14087 bad:
14088 Py_DECREF(o); o = 0;
14089 return NULL;
14090 }
14091
14092 static void __pyx_tp_dealloc_7pymusic_DataMap(PyObject *o) {
14093 struct __pyx_obj_7pymusic_DataMap *p = (struct __pyx_obj_7pymusic_DataMap *)o;
14094 #if CYTHON_USE_TP_FINALIZE
14095 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
14096 if (PyObject_CallFinalizerFromDealloc(o)) return;
14097 }
14098 #endif
14099 PyObject_GC_UnTrack(o);
14100 {
14101 PyObject *etype, *eval, *etb;
14102 PyErr_Fetch(&etype, &eval, &etb);
14103 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
14104 __pyx_pw_7pymusic_7DataMap_3__dealloc__(o);
14105 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
14106 PyErr_Restore(etype, eval, etb);
14107 }
14108 Py_CLEAR(p->buf);
14109 (*Py_TYPE(o)->tp_free)(o);
14110 }
14111
14112 static int __pyx_tp_traverse_7pymusic_DataMap(PyObject *o, visitproc v, void *a) {
14113 int e;
14114 struct __pyx_obj_7pymusic_DataMap *p = (struct __pyx_obj_7pymusic_DataMap *)o;
14115 if (p->buf) {
14116 e = (*v)(((PyObject *)p->buf), a); if (e) return e;
14117 }
14118 return 0;
14119 }
14120
14121 static int __pyx_tp_clear_7pymusic_DataMap(PyObject *o) {
14122 PyObject* tmp;
14123 struct __pyx_obj_7pymusic_DataMap *p = (struct __pyx_obj_7pymusic_DataMap *)o;
14124 tmp = ((PyObject*)p->buf);
14125 p->buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)Py_None); Py_INCREF(Py_None);
14126 Py_XDECREF(tmp);
14127 return 0;
14128 }
14129
14130 static PyMethodDef __pyx_methods_7pymusic_DataMap[] = {
14131 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_7DataMap_5__reduce_cython__, METH_NOARGS, 0},
14132 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_7DataMap_7__setstate_cython__, METH_O, 0},
14133 {0, 0, 0, 0}
14134 };
14135
14136 static PyTypeObject __pyx_type_7pymusic_DataMap = {
14137 PyVarObject_HEAD_INIT(0, 0)
14138 "pymusic.DataMap", /*tp_name*/
14139 sizeof(struct __pyx_obj_7pymusic_DataMap), /*tp_basicsize*/
14140 0, /*tp_itemsize*/
14141 __pyx_tp_dealloc_7pymusic_DataMap, /*tp_dealloc*/
14142 #if PY_VERSION_HEX < 0x030800b4
14143 0, /*tp_print*/
14144 #endif
14145 #if PY_VERSION_HEX >= 0x030800b4
14146 0, /*tp_vectorcall_offset*/
14147 #endif
14148 0, /*tp_getattr*/
14149 0, /*tp_setattr*/
14150 #if PY_MAJOR_VERSION < 3
14151 0, /*tp_compare*/
14152 #endif
14153 #if PY_MAJOR_VERSION >= 3
14154 0, /*tp_as_async*/
14155 #endif
14156 0, /*tp_repr*/
14157 0, /*tp_as_number*/
14158 0, /*tp_as_sequence*/
14159 0, /*tp_as_mapping*/
14160 0, /*tp_hash*/
14161 0, /*tp_call*/
14162 0, /*tp_str*/
14163 0, /*tp_getattro*/
14164 0, /*tp_setattro*/
14165 0, /*tp_as_buffer*/
14166 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14167 "\n Internal:\n An ArrayData object. Takes a data object as a Buffer and possibly an\n IndexMap to construct a mapping for the Cont*Port transfers.\n ", /*tp_doc*/
14168 __pyx_tp_traverse_7pymusic_DataMap, /*tp_traverse*/
14169 __pyx_tp_clear_7pymusic_DataMap, /*tp_clear*/
14170 0, /*tp_richcompare*/
14171 0, /*tp_weaklistoffset*/
14172 0, /*tp_iter*/
14173 0, /*tp_iternext*/
14174 __pyx_methods_7pymusic_DataMap, /*tp_methods*/
14175 0, /*tp_members*/
14176 0, /*tp_getset*/
14177 0, /*tp_base*/
14178 0, /*tp_dict*/
14179 0, /*tp_descr_get*/
14180 0, /*tp_descr_set*/
14181 0, /*tp_dictoffset*/
14182 0, /*tp_init*/
14183 0, /*tp_alloc*/
14184 __pyx_tp_new_7pymusic_DataMap, /*tp_new*/
14185 0, /*tp_free*/
14186 0, /*tp_is_gc*/
14187 0, /*tp_bases*/
14188 0, /*tp_mro*/
14189 0, /*tp_cache*/
14190 0, /*tp_subclasses*/
14191 0, /*tp_weaklist*/
14192 0, /*tp_del*/
14193 0, /*tp_version_tag*/
14194 #if PY_VERSION_HEX >= 0x030400a1
14195 0, /*tp_finalize*/
14196 #endif
14197 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
14198 0, /*tp_vectorcall*/
14199 #endif
14200 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
14201 0, /*tp_print*/
14202 #endif
14203 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
14204 0, /*tp_pypy_flags*/
14205 #endif
14206 };
14207
14208 static PyObject *__pyx_tp_new_7pymusic_IndexMap(PyTypeObject *t, PyObject *a, PyObject *k) {
14209 struct __pyx_obj_7pymusic_IndexMap *p;
14210 PyObject *o;
14211 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
14212 o = (*t->tp_alloc)(t, 0);
14213 } else {
14214 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
14215 }
14216 if (unlikely(!o)) return 0;
14217 p = ((struct __pyx_obj_7pymusic_IndexMap *)o);
14218 p->buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)Py_None); Py_INCREF(Py_None);
14219 if (unlikely(__pyx_pw_7pymusic_8IndexMap_1__cinit__(o, a, k) < 0)) goto bad;
14220 return o;
14221 bad:
14222 Py_DECREF(o); o = 0;
14223 return NULL;
14224 }
14225
14226 static void __pyx_tp_dealloc_7pymusic_IndexMap(PyObject *o) {
14227 struct __pyx_obj_7pymusic_IndexMap *p = (struct __pyx_obj_7pymusic_IndexMap *)o;
14228 #if CYTHON_USE_TP_FINALIZE
14229 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
14230 if (PyObject_CallFinalizerFromDealloc(o)) return;
14231 }
14232 #endif
14233 PyObject_GC_UnTrack(o);
14234 {
14235 PyObject *etype, *eval, *etb;
14236 PyErr_Fetch(&etype, &eval, &etb);
14237 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
14238 __pyx_pw_7pymusic_8IndexMap_3__dealloc__(o);
14239 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
14240 PyErr_Restore(etype, eval, etb);
14241 }
14242 Py_CLEAR(p->buf);
14243 (*Py_TYPE(o)->tp_free)(o);
14244 }
14245
14246 static int __pyx_tp_traverse_7pymusic_IndexMap(PyObject *o, visitproc v, void *a) {
14247 int e;
14248 struct __pyx_obj_7pymusic_IndexMap *p = (struct __pyx_obj_7pymusic_IndexMap *)o;
14249 if (p->buf) {
14250 e = (*v)(((PyObject *)p->buf), a); if (e) return e;
14251 }
14252 return 0;
14253 }
14254
14255 static int __pyx_tp_clear_7pymusic_IndexMap(PyObject *o) {
14256 PyObject* tmp;
14257 struct __pyx_obj_7pymusic_IndexMap *p = (struct __pyx_obj_7pymusic_IndexMap *)o;
14258 tmp = ((PyObject*)p->buf);
14259 p->buf = ((struct __pyx_obj_5music_8pybuffer_Buffer *)Py_None); Py_INCREF(Py_None);
14260 Py_XDECREF(tmp);
14261 return 0;
14262 }
14263
14264 static PyMethodDef __pyx_methods_7pymusic_IndexMap[] = {
14265 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_8IndexMap_5__reduce_cython__, METH_NOARGS, 0},
14266 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_8IndexMap_7__setstate_cython__, METH_O, 0},
14267 {0, 0, 0, 0}
14268 };
14269
14270 static PyTypeObject __pyx_type_7pymusic_IndexMap = {
14271 PyVarObject_HEAD_INIT(0, 0)
14272 "pymusic.IndexMap", /*tp_name*/
14273 sizeof(struct __pyx_obj_7pymusic_IndexMap), /*tp_basicsize*/
14274 0, /*tp_itemsize*/
14275 __pyx_tp_dealloc_7pymusic_IndexMap, /*tp_dealloc*/
14276 #if PY_VERSION_HEX < 0x030800b4
14277 0, /*tp_print*/
14278 #endif
14279 #if PY_VERSION_HEX >= 0x030800b4
14280 0, /*tp_vectorcall_offset*/
14281 #endif
14282 0, /*tp_getattr*/
14283 0, /*tp_setattr*/
14284 #if PY_MAJOR_VERSION < 3
14285 0, /*tp_compare*/
14286 #endif
14287 #if PY_MAJOR_VERSION >= 3
14288 0, /*tp_as_async*/
14289 #endif
14290 0, /*tp_repr*/
14291 0, /*tp_as_number*/
14292 0, /*tp_as_sequence*/
14293 0, /*tp_as_mapping*/
14294 0, /*tp_hash*/
14295 0, /*tp_call*/
14296 0, /*tp_str*/
14297 0, /*tp_getattro*/
14298 0, /*tp_setattro*/
14299 0, /*tp_as_buffer*/
14300 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14301 "\n Internal:\n Contains a C++ LinearIndex or PermutationIndex.\n These map between \"local\" index i to \"global\" index j\n LinearIndex: g = l + base, for l < size\n PermutationIndex: g = perm[l], where perm is an array\n ", /*tp_doc*/
14302 __pyx_tp_traverse_7pymusic_IndexMap, /*tp_traverse*/
14303 __pyx_tp_clear_7pymusic_IndexMap, /*tp_clear*/
14304 0, /*tp_richcompare*/
14305 0, /*tp_weaklistoffset*/
14306 0, /*tp_iter*/
14307 0, /*tp_iternext*/
14308 __pyx_methods_7pymusic_IndexMap, /*tp_methods*/
14309 0, /*tp_members*/
14310 0, /*tp_getset*/
14311 0, /*tp_base*/
14312 0, /*tp_dict*/
14313 0, /*tp_descr_get*/
14314 0, /*tp_descr_set*/
14315 0, /*tp_dictoffset*/
14316 0, /*tp_init*/
14317 0, /*tp_alloc*/
14318 __pyx_tp_new_7pymusic_IndexMap, /*tp_new*/
14319 0, /*tp_free*/
14320 0, /*tp_is_gc*/
14321 0, /*tp_bases*/
14322 0, /*tp_mro*/
14323 0, /*tp_cache*/
14324 0, /*tp_subclasses*/
14325 0, /*tp_weaklist*/
14326 0, /*tp_del*/
14327 0, /*tp_version_tag*/
14328 #if PY_VERSION_HEX >= 0x030400a1
14329 0, /*tp_finalize*/
14330 #endif
14331 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
14332 0, /*tp_vectorcall*/
14333 #endif
14334 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
14335 0, /*tp_print*/
14336 #endif
14337 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
14338 0, /*tp_pypy_flags*/
14339 #endif
14340 };
14341
14342 static PyObject *__pyx_tp_new_7pymusic_EventHandler(PyTypeObject *t, PyObject *a, PyObject *k) {
14343 struct __pyx_obj_7pymusic_EventHandler *p;
14344 PyObject *o;
14345 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
14346 o = (*t->tp_alloc)(t, 0);
14347 } else {
14348 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
14349 }
14350 if (unlikely(!o)) return 0;
14351 p = ((struct __pyx_obj_7pymusic_EventHandler *)o);
14352 p->func = Py_None; Py_INCREF(Py_None);
14353 if (unlikely(__pyx_pw_7pymusic_12EventHandler_1__cinit__(o, a, k) < 0)) goto bad;
14354 return o;
14355 bad:
14356 Py_DECREF(o); o = 0;
14357 return NULL;
14358 }
14359
14360 static void __pyx_tp_dealloc_7pymusic_EventHandler(PyObject *o) {
14361 struct __pyx_obj_7pymusic_EventHandler *p = (struct __pyx_obj_7pymusic_EventHandler *)o;
14362 #if CYTHON_USE_TP_FINALIZE
14363 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
14364 if (PyObject_CallFinalizerFromDealloc(o)) return;
14365 }
14366 #endif
14367 PyObject_GC_UnTrack(o);
14368 {
14369 PyObject *etype, *eval, *etb;
14370 PyErr_Fetch(&etype, &eval, &etb);
14371 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
14372 __pyx_pw_7pymusic_12EventHandler_3__dealloc__(o);
14373 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
14374 PyErr_Restore(etype, eval, etb);
14375 }
14376 Py_CLEAR(p->func);
14377 (*Py_TYPE(o)->tp_free)(o);
14378 }
14379
14380 static int __pyx_tp_traverse_7pymusic_EventHandler(PyObject *o, visitproc v, void *a) {
14381 int e;
14382 struct __pyx_obj_7pymusic_EventHandler *p = (struct __pyx_obj_7pymusic_EventHandler *)o;
14383 if (p->func) {
14384 e = (*v)(p->func, a); if (e) return e;
14385 }
14386 return 0;
14387 }
14388
14389 static int __pyx_tp_clear_7pymusic_EventHandler(PyObject *o) {
14390 PyObject* tmp;
14391 struct __pyx_obj_7pymusic_EventHandler *p = (struct __pyx_obj_7pymusic_EventHandler *)o;
14392 tmp = ((PyObject*)p->func);
14393 p->func = Py_None; Py_INCREF(Py_None);
14394 Py_XDECREF(tmp);
14395 return 0;
14396 }
14397
14398 static PyMethodDef __pyx_methods_7pymusic_EventHandler[] = {
14399 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_12EventHandler_5__reduce_cython__, METH_NOARGS, 0},
14400 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_12EventHandler_7__setstate_cython__, METH_O, 0},
14401 {0, 0, 0, 0}
14402 };
14403
14404 static PyTypeObject __pyx_type_7pymusic_EventHandler = {
14405 PyVarObject_HEAD_INIT(0, 0)
14406 "pymusic.EventHandler", /*tp_name*/
14407 sizeof(struct __pyx_obj_7pymusic_EventHandler), /*tp_basicsize*/
14408 0, /*tp_itemsize*/
14409 __pyx_tp_dealloc_7pymusic_EventHandler, /*tp_dealloc*/
14410 #if PY_VERSION_HEX < 0x030800b4
14411 0, /*tp_print*/
14412 #endif
14413 #if PY_VERSION_HEX >= 0x030800b4
14414 0, /*tp_vectorcall_offset*/
14415 #endif
14416 0, /*tp_getattr*/
14417 0, /*tp_setattr*/
14418 #if PY_MAJOR_VERSION < 3
14419 0, /*tp_compare*/
14420 #endif
14421 #if PY_MAJOR_VERSION >= 3
14422 0, /*tp_as_async*/
14423 #endif
14424 0, /*tp_repr*/
14425 0, /*tp_as_number*/
14426 0, /*tp_as_sequence*/
14427 0, /*tp_as_mapping*/
14428 0, /*tp_hash*/
14429 0, /*tp_call*/
14430 0, /*tp_str*/
14431 0, /*tp_getattro*/
14432 0, /*tp_setattro*/
14433 0, /*tp_as_buffer*/
14434 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14435 "\n Internal:\n An EventHandler is the python wrapper around a global\n or local EventHandler object for EventInputPort\n ", /*tp_doc*/
14436 __pyx_tp_traverse_7pymusic_EventHandler, /*tp_traverse*/
14437 __pyx_tp_clear_7pymusic_EventHandler, /*tp_clear*/
14438 0, /*tp_richcompare*/
14439 0, /*tp_weaklistoffset*/
14440 0, /*tp_iter*/
14441 0, /*tp_iternext*/
14442 __pyx_methods_7pymusic_EventHandler, /*tp_methods*/
14443 0, /*tp_members*/
14444 0, /*tp_getset*/
14445 0, /*tp_base*/
14446 0, /*tp_dict*/
14447 0, /*tp_descr_get*/
14448 0, /*tp_descr_set*/
14449 0, /*tp_dictoffset*/
14450 0, /*tp_init*/
14451 0, /*tp_alloc*/
14452 __pyx_tp_new_7pymusic_EventHandler, /*tp_new*/
14453 0, /*tp_free*/
14454 0, /*tp_is_gc*/
14455 0, /*tp_bases*/
14456 0, /*tp_mro*/
14457 0, /*tp_cache*/
14458 0, /*tp_subclasses*/
14459 0, /*tp_weaklist*/
14460 0, /*tp_del*/
14461 0, /*tp_version_tag*/
14462 #if PY_VERSION_HEX >= 0x030400a1
14463 0, /*tp_finalize*/
14464 #endif
14465 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
14466 0, /*tp_vectorcall*/
14467 #endif
14468 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
14469 0, /*tp_print*/
14470 #endif
14471 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
14472 0, /*tp_pypy_flags*/
14473 #endif
14474 };
14475
14476 static PyObject *__pyx_tp_new_7pymusic_MessageHandler(PyTypeObject *t, PyObject *a, PyObject *k) {
14477 struct __pyx_obj_7pymusic_MessageHandler *p;
14478 PyObject *o;
14479 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
14480 o = (*t->tp_alloc)(t, 0);
14481 } else {
14482 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
14483 }
14484 if (unlikely(!o)) return 0;
14485 p = ((struct __pyx_obj_7pymusic_MessageHandler *)o);
14486 p->func = Py_None; Py_INCREF(Py_None);
14487 if (unlikely(__pyx_pw_7pymusic_14MessageHandler_1__cinit__(o, a, k) < 0)) goto bad;
14488 return o;
14489 bad:
14490 Py_DECREF(o); o = 0;
14491 return NULL;
14492 }
14493
14494 static void __pyx_tp_dealloc_7pymusic_MessageHandler(PyObject *o) {
14495 struct __pyx_obj_7pymusic_MessageHandler *p = (struct __pyx_obj_7pymusic_MessageHandler *)o;
14496 #if CYTHON_USE_TP_FINALIZE
14497 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
14498 if (PyObject_CallFinalizerFromDealloc(o)) return;
14499 }
14500 #endif
14501 PyObject_GC_UnTrack(o);
14502 {
14503 PyObject *etype, *eval, *etb;
14504 PyErr_Fetch(&etype, &eval, &etb);
14505 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
14506 __pyx_pw_7pymusic_14MessageHandler_3__dealloc__(o);
14507 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
14508 PyErr_Restore(etype, eval, etb);
14509 }
14510 Py_CLEAR(p->func);
14511 (*Py_TYPE(o)->tp_free)(o);
14512 }
14513
14514 static int __pyx_tp_traverse_7pymusic_MessageHandler(PyObject *o, visitproc v, void *a) {
14515 int e;
14516 struct __pyx_obj_7pymusic_MessageHandler *p = (struct __pyx_obj_7pymusic_MessageHandler *)o;
14517 if (p->func) {
14518 e = (*v)(p->func, a); if (e) return e;
14519 }
14520 return 0;
14521 }
14522
14523 static int __pyx_tp_clear_7pymusic_MessageHandler(PyObject *o) {
14524 PyObject* tmp;
14525 struct __pyx_obj_7pymusic_MessageHandler *p = (struct __pyx_obj_7pymusic_MessageHandler *)o;
14526 tmp = ((PyObject*)p->func);
14527 p->func = Py_None; Py_INCREF(Py_None);
14528 Py_XDECREF(tmp);
14529 return 0;
14530 }
14531
14532 static PyMethodDef __pyx_methods_7pymusic_MessageHandler[] = {
14533 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_14MessageHandler_5__reduce_cython__, METH_NOARGS, 0},
14534 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_14MessageHandler_7__setstate_cython__, METH_O, 0},
14535 {0, 0, 0, 0}
14536 };
14537
14538 static PyTypeObject __pyx_type_7pymusic_MessageHandler = {
14539 PyVarObject_HEAD_INIT(0, 0)
14540 "pymusic.MessageHandler", /*tp_name*/
14541 sizeof(struct __pyx_obj_7pymusic_MessageHandler), /*tp_basicsize*/
14542 0, /*tp_itemsize*/
14543 __pyx_tp_dealloc_7pymusic_MessageHandler, /*tp_dealloc*/
14544 #if PY_VERSION_HEX < 0x030800b4
14545 0, /*tp_print*/
14546 #endif
14547 #if PY_VERSION_HEX >= 0x030800b4
14548 0, /*tp_vectorcall_offset*/
14549 #endif
14550 0, /*tp_getattr*/
14551 0, /*tp_setattr*/
14552 #if PY_MAJOR_VERSION < 3
14553 0, /*tp_compare*/
14554 #endif
14555 #if PY_MAJOR_VERSION >= 3
14556 0, /*tp_as_async*/
14557 #endif
14558 0, /*tp_repr*/
14559 0, /*tp_as_number*/
14560 0, /*tp_as_sequence*/
14561 0, /*tp_as_mapping*/
14562 0, /*tp_hash*/
14563 0, /*tp_call*/
14564 0, /*tp_str*/
14565 0, /*tp_getattro*/
14566 0, /*tp_setattro*/
14567 0, /*tp_as_buffer*/
14568 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14569 "\n MessageHandler wraps up Message*Port communications between C & python,\n wrapping n particular the C++ MessageHandler object bound with a function.\n It may (or may not) depickle messages\n ", /*tp_doc*/
14570 __pyx_tp_traverse_7pymusic_MessageHandler, /*tp_traverse*/
14571 __pyx_tp_clear_7pymusic_MessageHandler, /*tp_clear*/
14572 0, /*tp_richcompare*/
14573 0, /*tp_weaklistoffset*/
14574 0, /*tp_iter*/
14575 0, /*tp_iternext*/
14576 __pyx_methods_7pymusic_MessageHandler, /*tp_methods*/
14577 0, /*tp_members*/
14578 0, /*tp_getset*/
14579 0, /*tp_base*/
14580 0, /*tp_dict*/
14581 0, /*tp_descr_get*/
14582 0, /*tp_descr_set*/
14583 0, /*tp_dictoffset*/
14584 0, /*tp_init*/
14585 0, /*tp_alloc*/
14586 __pyx_tp_new_7pymusic_MessageHandler, /*tp_new*/
14587 0, /*tp_free*/
14588 0, /*tp_is_gc*/
14589 0, /*tp_bases*/
14590 0, /*tp_mro*/
14591 0, /*tp_cache*/
14592 0, /*tp_subclasses*/
14593 0, /*tp_weaklist*/
14594 0, /*tp_del*/
14595 0, /*tp_version_tag*/
14596 #if PY_VERSION_HEX >= 0x030400a1
14597 0, /*tp_finalize*/
14598 #endif
14599 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
14600 0, /*tp_vectorcall*/
14601 #endif
14602 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
14603 0, /*tp_print*/
14604 #endif
14605 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
14606 0, /*tp_pypy_flags*/
14607 #endif
14608 };
14609
14610 static PyObject *__pyx_tp_new_7pymusic__Index(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
14611 struct __pyx_obj_7pymusic__Index *p;
14612 PyObject *o;
14613 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
14614 o = (*t->tp_alloc)(t, 0);
14615 } else {
14616 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
14617 }
14618 if (unlikely(!o)) return 0;
14619 p = ((struct __pyx_obj_7pymusic__Index *)o);
14620 p->backmap = ((PyObject*)Py_None); Py_INCREF(Py_None);
14621 if (unlikely(__pyx_pw_7pymusic_6_Index_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
14622 return o;
14623 bad:
14624 Py_DECREF(o); o = 0;
14625 return NULL;
14626 }
14627
14628 static void __pyx_tp_dealloc_7pymusic__Index(PyObject *o) {
14629 struct __pyx_obj_7pymusic__Index *p = (struct __pyx_obj_7pymusic__Index *)o;
14630 #if CYTHON_USE_TP_FINALIZE
14631 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
14632 if (PyObject_CallFinalizerFromDealloc(o)) return;
14633 }
14634 #endif
14635 PyObject_GC_UnTrack(o);
14636 Py_CLEAR(p->backmap);
14637 (*Py_TYPE(o)->tp_free)(o);
14638 }
14639
14640 static int __pyx_tp_traverse_7pymusic__Index(PyObject *o, visitproc v, void *a) {
14641 int e;
14642 struct __pyx_obj_7pymusic__Index *p = (struct __pyx_obj_7pymusic__Index *)o;
14643 if (p->backmap) {
14644 e = (*v)(p->backmap, a); if (e) return e;
14645 }
14646 return 0;
14647 }
14648
14649 static int __pyx_tp_clear_7pymusic__Index(PyObject *o) {
14650 PyObject* tmp;
14651 struct __pyx_obj_7pymusic__Index *p = (struct __pyx_obj_7pymusic__Index *)o;
14652 tmp = ((PyObject*)p->backmap);
14653 p->backmap = ((PyObject*)Py_None); Py_INCREF(Py_None);
14654 Py_XDECREF(tmp);
14655 return 0;
14656 }
14657
14658 static PyObject *__pyx_getprop_7pymusic_6_Index_GLOBAL(PyObject *o, CYTHON_UNUSED void *x) {
14659 return __pyx_pw_7pymusic_6_Index_6GLOBAL_1__get__(o);
14660 }
14661
14662 static PyObject *__pyx_getprop_7pymusic_6_Index_LOCAL(PyObject *o, CYTHON_UNUSED void *x) {
14663 return __pyx_pw_7pymusic_6_Index_5LOCAL_1__get__(o);
14664 }
14665
14666 static PyObject *__pyx_getprop_7pymusic_6_Index_backmap(PyObject *o, CYTHON_UNUSED void *x) {
14667 return __pyx_pw_7pymusic_6_Index_7backmap_1__get__(o);
14668 }
14669
14670 static PyMethodDef __pyx_methods_7pymusic__Index[] = {
14671 {"tostr", (PyCFunction)__pyx_pw_7pymusic_6_Index_3tostr, METH_O, __pyx_doc_7pymusic_6_Index_2tostr},
14672 {"__reduce_cython__", (PyCFunction)__pyx_pw_7pymusic_6_Index_5__reduce_cython__, METH_NOARGS, 0},
14673 {"__setstate_cython__", (PyCFunction)__pyx_pw_7pymusic_6_Index_7__setstate_cython__, METH_O, 0},
14674 {0, 0, 0, 0}
14675 };
14676
14677 static struct PyGetSetDef __pyx_getsets_7pymusic__Index[] = {
14678 {(char *)"GLOBAL", __pyx_getprop_7pymusic_6_Index_GLOBAL, 0, (char *)0, 0},
14679 {(char *)"LOCAL", __pyx_getprop_7pymusic_6_Index_LOCAL, 0, (char *)0, 0},
14680 {(char *)"backmap", __pyx_getprop_7pymusic_6_Index_backmap, 0, (char *)0, 0},
14681 {0, 0, 0, 0, 0}
14682 };
14683
14684 static PyTypeObject __pyx_type_7pymusic__Index = {
14685 PyVarObject_HEAD_INIT(0, 0)
14686 "pymusic._Index", /*tp_name*/
14687 sizeof(struct __pyx_obj_7pymusic__Index), /*tp_basicsize*/
14688 0, /*tp_itemsize*/
14689 __pyx_tp_dealloc_7pymusic__Index, /*tp_dealloc*/
14690 #if PY_VERSION_HEX < 0x030800b4
14691 0, /*tp_print*/
14692 #endif
14693 #if PY_VERSION_HEX >= 0x030800b4
14694 0, /*tp_vectorcall_offset*/
14695 #endif
14696 0, /*tp_getattr*/
14697 0, /*tp_setattr*/
14698 #if PY_MAJOR_VERSION < 3
14699 0, /*tp_compare*/
14700 #endif
14701 #if PY_MAJOR_VERSION >= 3
14702 0, /*tp_as_async*/
14703 #endif
14704 0, /*tp_repr*/
14705 0, /*tp_as_number*/
14706 0, /*tp_as_sequence*/
14707 0, /*tp_as_mapping*/
14708 0, /*tp_hash*/
14709 0, /*tp_call*/
14710 0, /*tp_str*/
14711 0, /*tp_getattro*/
14712 0, /*tp_setattro*/
14713 0, /*tp_as_buffer*/
14714 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14715 "\n Internal: the type of the variable Index\n that encapsulates the enum mapping\n GLOBAL and LOCAL are the ints of the C enums\n backmap maps from the enum to a string for output\n purposes\n ", /*tp_doc*/
14716 __pyx_tp_traverse_7pymusic__Index, /*tp_traverse*/
14717 __pyx_tp_clear_7pymusic__Index, /*tp_clear*/
14718 0, /*tp_richcompare*/
14719 0, /*tp_weaklistoffset*/
14720 0, /*tp_iter*/
14721 0, /*tp_iternext*/
14722 __pyx_methods_7pymusic__Index, /*tp_methods*/
14723 0, /*tp_members*/
14724 __pyx_getsets_7pymusic__Index, /*tp_getset*/
14725 0, /*tp_base*/
14726 0, /*tp_dict*/
14727 0, /*tp_descr_get*/
14728 0, /*tp_descr_set*/
14729 0, /*tp_dictoffset*/
14730 0, /*tp_init*/
14731 0, /*tp_alloc*/
14732 __pyx_tp_new_7pymusic__Index, /*tp_new*/
14733 0, /*tp_free*/
14734 0, /*tp_is_gc*/
14735 0, /*tp_bases*/
14736 0, /*tp_mro*/
14737 0, /*tp_cache*/
14738 0, /*tp_subclasses*/
14739 0, /*tp_weaklist*/
14740 0, /*tp_del*/
14741 0, /*tp_version_tag*/
14742 #if PY_VERSION_HEX >= 0x030400a1
14743 0, /*tp_finalize*/
14744 #endif
14745 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
14746 0, /*tp_vectorcall*/
14747 #endif
14748 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
14749 0, /*tp_print*/
14750 #endif
14751 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
14752 0, /*tp_pypy_flags*/
14753 #endif
14754 };
14755
14756 static struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *__pyx_freelist_7pymusic___pyx_scope_struct____iter__[8];
14757 static int __pyx_freecount_7pymusic___pyx_scope_struct____iter__ = 0;
14758
14759 static PyObject *__pyx_tp_new_7pymusic___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
14760 PyObject *o;
14761 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pymusic___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pymusic___pyx_scope_struct____iter__)))) {
14762 o = (PyObject*)__pyx_freelist_7pymusic___pyx_scope_struct____iter__[--__pyx_freecount_7pymusic___pyx_scope_struct____iter__];
14763 memset(o, 0, sizeof(struct __pyx_obj_7pymusic___pyx_scope_struct____iter__));
14764 (void) PyObject_INIT(o, t);
14765 PyObject_GC_Track(o);
14766 } else {
14767 o = (*t->tp_alloc)(t, 0);
14768 if (unlikely(!o)) return 0;
14769 }
14770 return o;
14771 }
14772
14773 static void __pyx_tp_dealloc_7pymusic___pyx_scope_struct____iter__(PyObject *o) {
14774 struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *)o;
14775 PyObject_GC_UnTrack(o);
14776 Py_CLEAR(p->__pyx_v_self);
14777 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pymusic___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pymusic___pyx_scope_struct____iter__)))) {
14778 __pyx_freelist_7pymusic___pyx_scope_struct____iter__[__pyx_freecount_7pymusic___pyx_scope_struct____iter__++] = ((struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *)o);
14779 } else {
14780 (*Py_TYPE(o)->tp_free)(o);
14781 }
14782 }
14783
14784 static int __pyx_tp_traverse_7pymusic___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
14785 int e;
14786 struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7pymusic___pyx_scope_struct____iter__ *)o;
14787 if (p->__pyx_v_self) {
14788 e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
14789 }
14790 return 0;
14791 }
14792
14793 static PyTypeObject __pyx_type_7pymusic___pyx_scope_struct____iter__ = {
14794 PyVarObject_HEAD_INIT(0, 0)
14795 "pymusic.__pyx_scope_struct____iter__", /*tp_name*/
14796 sizeof(struct __pyx_obj_7pymusic___pyx_scope_struct____iter__), /*tp_basicsize*/
14797 0, /*tp_itemsize*/
14798 __pyx_tp_dealloc_7pymusic___pyx_scope_struct____iter__, /*tp_dealloc*/
14799 #if PY_VERSION_HEX < 0x030800b4
14800 0, /*tp_print*/
14801 #endif
14802 #if PY_VERSION_HEX >= 0x030800b4
14803 0, /*tp_vectorcall_offset*/
14804 #endif
14805 0, /*tp_getattr*/
14806 0, /*tp_setattr*/
14807 #if PY_MAJOR_VERSION < 3
14808 0, /*tp_compare*/
14809 #endif
14810 #if PY_MAJOR_VERSION >= 3
14811 0, /*tp_as_async*/
14812 #endif
14813 0, /*tp_repr*/
14814 0, /*tp_as_number*/
14815 0, /*tp_as_sequence*/
14816 0, /*tp_as_mapping*/
14817 0, /*tp_hash*/
14818 0, /*tp_call*/
14819 0, /*tp_str*/
14820 0, /*tp_getattro*/
14821 0, /*tp_setattro*/
14822 0, /*tp_as_buffer*/
14823 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14824 0, /*tp_doc*/
14825 __pyx_tp_traverse_7pymusic___pyx_scope_struct____iter__, /*tp_traverse*/
14826 0, /*tp_clear*/
14827 0, /*tp_richcompare*/
14828 0, /*tp_weaklistoffset*/
14829 0, /*tp_iter*/
14830 0, /*tp_iternext*/
14831 0, /*tp_methods*/
14832 0, /*tp_members*/
14833 0, /*tp_getset*/
14834 0, /*tp_base*/
14835 0, /*tp_dict*/
14836 0, /*tp_descr_get*/
14837 0, /*tp_descr_set*/
14838 0, /*tp_dictoffset*/
14839 0, /*tp_init*/
14840 0, /*tp_alloc*/
14841 __pyx_tp_new_7pymusic___pyx_scope_struct____iter__, /*tp_new*/
14842 0, /*tp_free*/
14843 0, /*tp_is_gc*/
14844 0, /*tp_bases*/
14845 0, /*tp_mro*/
14846 0, /*tp_cache*/
14847 0, /*tp_subclasses*/
14848 0, /*tp_weaklist*/
14849 0, /*tp_del*/
14850 0, /*tp_version_tag*/
14851 #if PY_VERSION_HEX >= 0x030400a1
14852 0, /*tp_finalize*/
14853 #endif
14854 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
14855 0, /*tp_vectorcall*/
14856 #endif
14857 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
14858 0, /*tp_print*/
14859 #endif
14860 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
14861 0, /*tp_pypy_flags*/
14862 #endif
14863 };
14864
14865 static PyMethodDef __pyx_methods[] = {
14866 {0, 0, 0, 0}
14867 };
14868
14869 #if PY_MAJOR_VERSION >= 3
14870 #if CYTHON_PEP489_MULTI_PHASE_INIT
14871 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
14872 static int __pyx_pymod_exec_pymusic(PyObject* module); /*proto*/
14873 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
14874 {Py_mod_create, (void*)__pyx_pymod_create},
14875 {Py_mod_exec, (void*)__pyx_pymod_exec_pymusic},
14876 {0, NULL}
14877 };
14878 #endif
14879
14880 static struct PyModuleDef __pyx_moduledef = {
14881 PyModuleDef_HEAD_INIT,
14882 "pymusic",
14883 0, /* m_doc */
14884 #if CYTHON_PEP489_MULTI_PHASE_INIT
14885 0, /* m_size */
14886 #else
14887 -1, /* m_size */
14888 #endif
14889 __pyx_methods /* m_methods */,
14890 #if CYTHON_PEP489_MULTI_PHASE_INIT
14891 __pyx_moduledef_slots, /* m_slots */
14892 #else
14893 NULL, /* m_reload */
14894 #endif
14895 NULL, /* m_traverse */
14896 NULL, /* m_clear */
14897 NULL /* m_free */
14898 };
14899 #endif
14900 #ifndef CYTHON_SMALL_CODE
14901 #if defined(__clang__)
14902 #define CYTHON_SMALL_CODE
14903 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
14904 #define CYTHON_SMALL_CODE __attribute__((cold))
14905 #else
14906 #define CYTHON_SMALL_CODE
14907 #endif
14908 #endif
14909
14910 static __Pyx_StringTabEntry __pyx_string_tab[] = {
14911 {&__pyx_kp_s_All_exceptions_in_pymusic_are_M, __pyx_k_All_exceptions_in_pymusic_are_M, sizeof(__pyx_k_All_exceptions_in_pymusic_are_M), 0, 0, 1, 0},
14912 {&__pyx_n_s_Buffer, __pyx_k_Buffer, sizeof(__pyx_k_Buffer), 0, 0, 1, 1},
14913 {&__pyx_n_s_COMM_NULL, __pyx_k_COMM_NULL, sizeof(__pyx_k_COMM_NULL), 0, 0, 1, 1},
14914 {&__pyx_kp_s_Config_variable_is_not_defined, __pyx_k_Config_variable_is_not_defined, sizeof(__pyx_k_Config_variable_is_not_defined), 0, 0, 1, 0},
14915 {&__pyx_n_s_ContInputPort, __pyx_k_ContInputPort, sizeof(__pyx_k_ContInputPort), 0, 0, 1, 1},
14916 {&__pyx_n_s_ContOutputPort, __pyx_k_ContOutputPort, sizeof(__pyx_k_ContOutputPort), 0, 0, 1, 1},
14917 {&__pyx_n_s_DataMap, __pyx_k_DataMap, sizeof(__pyx_k_DataMap), 0, 0, 1, 1},
14918 {&__pyx_n_s_EventHandler, __pyx_k_EventHandler, sizeof(__pyx_k_EventHandler), 0, 0, 1, 1},
14919 {&__pyx_n_s_EventInputPort, __pyx_k_EventInputPort, sizeof(__pyx_k_EventInputPort), 0, 0, 1, 1},
14920 {&__pyx_n_s_EventOutputPort, __pyx_k_EventOutputPort, sizeof(__pyx_k_EventOutputPort), 0, 0, 1, 1},
14921 {&__pyx_n_s_GLOBAL, __pyx_k_GLOBAL, sizeof(__pyx_k_GLOBAL), 0, 0, 1, 1},
14922 {&__pyx_n_s_HIGHEST_PROTOCOL, __pyx_k_HIGHEST_PROTOCOL, sizeof(__pyx_k_HIGHEST_PROTOCOL), 0, 0, 1, 1},
14923 {&__pyx_n_s_Index, __pyx_k_Index, sizeof(__pyx_k_Index), 0, 0, 1, 1},
14924 {&__pyx_n_s_IndexMap, __pyx_k_IndexMap, sizeof(__pyx_k_IndexMap), 0, 0, 1, 1},
14925 {&__pyx_n_s_Index_2, __pyx_k_Index_2, sizeof(__pyx_k_Index_2), 0, 0, 1, 1},
14926 {&__pyx_n_s_LOCAL, __pyx_k_LOCAL, sizeof(__pyx_k_LOCAL), 0, 0, 1, 1},
14927 {&__pyx_n_s_MPI, __pyx_k_MPI, sizeof(__pyx_k_MPI), 0, 0, 1, 1},
14928 {&__pyx_n_s_MUSICError, __pyx_k_MUSICError, sizeof(__pyx_k_MUSICError), 0, 0, 1, 1},
14929 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
14930 {&__pyx_n_s_MessageHandler, __pyx_k_MessageHandler, sizeof(__pyx_k_MessageHandler), 0, 0, 1, 1},
14931 {&__pyx_n_s_MessageInputPort, __pyx_k_MessageInputPort, sizeof(__pyx_k_MessageInputPort), 0, 0, 1, 1},
14932 {&__pyx_n_s_MessageOutputPort, __pyx_k_MessageOutputPort, sizeof(__pyx_k_MessageOutputPort), 0, 0, 1, 1},
14933 {&__pyx_n_s_NoWidth, __pyx_k_NoWidth, sizeof(__pyx_k_NoWidth), 0, 0, 1, 1},
14934 {&__pyx_n_s_NoWidth___init, __pyx_k_NoWidth___init, sizeof(__pyx_k_NoWidth___init), 0, 0, 1, 1},
14935 {&__pyx_kp_s_No_width_defined, __pyx_k_No_width_defined, sizeof(__pyx_k_No_width_defined), 0, 0, 1, 0},
14936 {&__pyx_n_s_Port, __pyx_k_Port, sizeof(__pyx_k_Port), 0, 0, 1, 1},
14937 {&__pyx_n_s_Runtime, __pyx_k_Runtime, sizeof(__pyx_k_Runtime), 0, 0, 1, 1},
14938 {&__pyx_n_s_Runtime___iter, __pyx_k_Runtime___iter, sizeof(__pyx_k_Runtime___iter), 0, 0, 1, 1},
14939 {&__pyx_n_s_Setup, __pyx_k_Setup, sizeof(__pyx_k_Setup), 0, 0, 1, 1},
14940 {&__pyx_kp_s_Thrown_if_Port_width_is_called, __pyx_k_Thrown_if_Port_width_is_called, sizeof(__pyx_k_Thrown_if_Port_width_is_called), 0, 0, 1, 0},
14941 {&__pyx_kp_s_Thrown_if_a_configuration_value, __pyx_k_Thrown_if_a_configuration_value, sizeof(__pyx_k_Thrown_if_a_configuration_value), 0, 0, 1, 0},
14942 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
14943 {&__pyx_n_s_UndefinedConfig, __pyx_k_UndefinedConfig, sizeof(__pyx_k_UndefinedConfig), 0, 0, 1, 1},
14944 {&__pyx_n_s_UndefinedConfig___init, __pyx_k_UndefinedConfig___init, sizeof(__pyx_k_UndefinedConfig___init), 0, 0, 1, 1},
14945 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
14946 {&__pyx_n_s__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 1, 1},
14947 {&__pyx_n_s_accLatency, __pyx_k_accLatency, sizeof(__pyx_k_accLatency), 0, 0, 1, 1},
14948 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
14949 {&__pyx_n_s_argv, __pyx_k_argv, sizeof(__pyx_k_argv), 0, 0, 1, 1},
14950 {&__pyx_kp_s_argv_can_t_be_empty, __pyx_k_argv_can_t_be_empty, sizeof(__pyx_k_argv_can_t_be_empty), 0, 0, 1, 0},
14951 {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
14952 {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
14953 {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
14954 {&__pyx_n_s_cPickle, __pyx_k_cPickle, sizeof(__pyx_k_cPickle), 0, 0, 1, 1},
14955 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
14956 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
14957 {&__pyx_kp_s_couldn_t_allocate_argv, __pyx_k_couldn_t_allocate_argv, sizeof(__pyx_k_couldn_t_allocate_argv), 0, 0, 1, 0},
14958 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
14959 {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1},
14960 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
14961 {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
14962 {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
14963 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
14964 {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
14965 {&__pyx_n_s_getcomm, __pyx_k_getcomm, sizeof(__pyx_k_getcomm), 0, 0, 1, 1},
14966 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
14967 {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
14968 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
14969 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
14970 {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
14971 {&__pyx_n_s_index_map, __pyx_k_index_map, sizeof(__pyx_k_index_map), 0, 0, 1, 1},
14972 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
14973 {&__pyx_n_s_interpolate, __pyx_k_interpolate, sizeof(__pyx_k_interpolate), 0, 0, 1, 1},
14974 {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
14975 {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
14976 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
14977 {&__pyx_n_s_maxBuffered, __pyx_k_maxBuffered, sizeof(__pyx_k_maxBuffered), 0, 0, 1, 1},
14978 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
14979 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
14980 {&__pyx_n_s_mpi4py_MPI, __pyx_k_mpi4py_MPI, sizeof(__pyx_k_mpi4py_MPI), 0, 0, 1, 1},
14981 {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
14982 {&__pyx_n_s_music_pybuffer, __pyx_k_music_pybuffer, sizeof(__pyx_k_music_pybuffer), 0, 0, 1, 1},
14983 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
14984 {&__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},
14985 {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1},
14986 {&__pyx_n_s_perm, __pyx_k_perm, sizeof(__pyx_k_perm), 0, 0, 1, 1},
14987 {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
14988 {&__pyx_n_s_pickled, __pyx_k_pickled, sizeof(__pyx_k_pickled), 0, 0, 1, 1},
14989 {&__pyx_n_s_predictRank, __pyx_k_predictRank, sizeof(__pyx_k_predictRank), 0, 0, 1, 1},
14990 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
14991 {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1},
14992 {&__pyx_n_s_pymusic, __pyx_k_pymusic, sizeof(__pyx_k_pymusic), 0, 0, 1, 1},
14993 {&__pyx_kp_s_pymusic_pyx, __pyx_k_pymusic_pyx, sizeof(__pyx_k_pymusic_pyx), 0, 0, 1, 0},
14994 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
14995 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
14996 {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
14997 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
14998 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
14999 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
15000 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
15001 {&__pyx_n_s_required, __pyx_k_required, sizeof(__pyx_k_required), 0, 0, 1, 1},
15002 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
15003 {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
15004 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
15005 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
15006 {&__pyx_n_s_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 0, 0, 1, 1},
15007 {&__pyx_n_s_six_moves, __pyx_k_six_moves, sizeof(__pyx_k_six_moves), 0, 0, 1, 1},
15008 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
15009 {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
15010 {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
15011 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
15012 {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
15013 {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
15014 {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1},
15015 {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
15016 {0, 0, 0, 0, 0, 0, 0}
15017 };
15018 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
15019 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 69, __pyx_L1_error)
15020 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
15021 #if PY_MAJOR_VERSION >= 3
15022 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 381, __pyx_L1_error)
15023 #else
15024 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 381, __pyx_L1_error)
15025 #endif
15026 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 439, __pyx_L1_error)
15027 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 109, __pyx_L1_error)
15028 return 0;
15029 __pyx_L1_error:;
15030 return -1;
15031 }
15032
15033 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
15034 __Pyx_RefNannyDeclarations
15035 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
15036
15037 /* "(tree fragment)":2
15038 * def __reduce_cython__(self):
15039 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15040 * def __setstate_cython__(self, __pyx_state):
15041 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15042 */
15043 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
15044 __Pyx_GOTREF(__pyx_tuple_);
15045 __Pyx_GIVEREF(__pyx_tuple_);
15046
15047 /* "(tree fragment)":4
15048 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15049 * def __setstate_cython__(self, __pyx_state):
15050 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15051 */
15052 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
15053 __Pyx_GOTREF(__pyx_tuple__2);
15054 __Pyx_GIVEREF(__pyx_tuple__2);
15055
15056 /* "(tree fragment)":2
15057 * def __reduce_cython__(self):
15058 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15059 * def __setstate_cython__(self, __pyx_state):
15060 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15061 */
15062 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
15063 __Pyx_GOTREF(__pyx_tuple__3);
15064 __Pyx_GIVEREF(__pyx_tuple__3);
15065
15066 /* "(tree fragment)":4
15067 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15068 * def __setstate_cython__(self, __pyx_state):
15069 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15070 */
15071 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
15072 __Pyx_GOTREF(__pyx_tuple__4);
15073 __Pyx_GIVEREF(__pyx_tuple__4);
15074
15075 /* "(tree fragment)":2
15076 * def __reduce_cython__(self):
15077 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15078 * def __setstate_cython__(self, __pyx_state):
15079 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15080 */
15081 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 2, __pyx_L1_error)
15082 __Pyx_GOTREF(__pyx_tuple__5);
15083 __Pyx_GIVEREF(__pyx_tuple__5);
15084
15085 /* "(tree fragment)":4
15086 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15087 * def __setstate_cython__(self, __pyx_state):
15088 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15089 */
15090 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 4, __pyx_L1_error)
15091 __Pyx_GOTREF(__pyx_tuple__6);
15092 __Pyx_GIVEREF(__pyx_tuple__6);
15093
15094 /* "(tree fragment)":2
15095 * def __reduce_cython__(self):
15096 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15097 * def __setstate_cython__(self, __pyx_state):
15098 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15099 */
15100 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error)
15101 __Pyx_GOTREF(__pyx_tuple__7);
15102 __Pyx_GIVEREF(__pyx_tuple__7);
15103
15104 /* "(tree fragment)":4
15105 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15106 * def __setstate_cython__(self, __pyx_state):
15107 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15108 */
15109 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
15110 __Pyx_GOTREF(__pyx_tuple__8);
15111 __Pyx_GIVEREF(__pyx_tuple__8);
15112
15113 /* "(tree fragment)":2
15114 * def __reduce_cython__(self):
15115 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15116 * def __setstate_cython__(self, __pyx_state):
15117 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15118 */
15119 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error)
15120 __Pyx_GOTREF(__pyx_tuple__9);
15121 __Pyx_GIVEREF(__pyx_tuple__9);
15122
15123 /* "(tree fragment)":4
15124 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15125 * def __setstate_cython__(self, __pyx_state):
15126 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15127 */
15128 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error)
15129 __Pyx_GOTREF(__pyx_tuple__10);
15130 __Pyx_GIVEREF(__pyx_tuple__10);
15131
15132 /* "(tree fragment)":2
15133 * def __reduce_cython__(self):
15134 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15135 * def __setstate_cython__(self, __pyx_state):
15136 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15137 */
15138 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
15139 __Pyx_GOTREF(__pyx_tuple__11);
15140 __Pyx_GIVEREF(__pyx_tuple__11);
15141
15142 /* "(tree fragment)":4
15143 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15144 * def __setstate_cython__(self, __pyx_state):
15145 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15146 */
15147 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error)
15148 __Pyx_GOTREF(__pyx_tuple__12);
15149 __Pyx_GIVEREF(__pyx_tuple__12);
15150
15151 /* "(tree fragment)":2
15152 * def __reduce_cython__(self):
15153 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15154 * def __setstate_cython__(self, __pyx_state):
15155 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15156 */
15157 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error)
15158 __Pyx_GOTREF(__pyx_tuple__13);
15159 __Pyx_GIVEREF(__pyx_tuple__13);
15160
15161 /* "(tree fragment)":4
15162 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15163 * def __setstate_cython__(self, __pyx_state):
15164 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15165 */
15166 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error)
15167 __Pyx_GOTREF(__pyx_tuple__14);
15168 __Pyx_GIVEREF(__pyx_tuple__14);
15169
15170 /* "(tree fragment)":2
15171 * def __reduce_cython__(self):
15172 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15173 * def __setstate_cython__(self, __pyx_state):
15174 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15175 */
15176 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
15177 __Pyx_GOTREF(__pyx_tuple__15);
15178 __Pyx_GIVEREF(__pyx_tuple__15);
15179
15180 /* "(tree fragment)":4
15181 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15182 * def __setstate_cython__(self, __pyx_state):
15183 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15184 */
15185 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 4, __pyx_L1_error)
15186 __Pyx_GOTREF(__pyx_tuple__16);
15187 __Pyx_GIVEREF(__pyx_tuple__16);
15188
15189 /* "(tree fragment)":2
15190 * def __reduce_cython__(self):
15191 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15192 * def __setstate_cython__(self, __pyx_state):
15193 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15194 */
15195 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error)
15196 __Pyx_GOTREF(__pyx_tuple__17);
15197 __Pyx_GIVEREF(__pyx_tuple__17);
15198
15199 /* "(tree fragment)":4
15200 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15201 * def __setstate_cython__(self, __pyx_state):
15202 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15203 */
15204 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error)
15205 __Pyx_GOTREF(__pyx_tuple__18);
15206 __Pyx_GIVEREF(__pyx_tuple__18);
15207
15208 /* "(tree fragment)":2
15209 * def __reduce_cython__(self):
15210 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15211 * def __setstate_cython__(self, __pyx_state):
15212 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15213 */
15214 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
15215 __Pyx_GOTREF(__pyx_tuple__19);
15216 __Pyx_GIVEREF(__pyx_tuple__19);
15217
15218 /* "(tree fragment)":4
15219 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15220 * def __setstate_cython__(self, __pyx_state):
15221 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15222 */
15223 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error)
15224 __Pyx_GOTREF(__pyx_tuple__20);
15225 __Pyx_GIVEREF(__pyx_tuple__20);
15226
15227 /* "(tree fragment)":2
15228 * def __reduce_cython__(self):
15229 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15230 * def __setstate_cython__(self, __pyx_state):
15231 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15232 */
15233 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 2, __pyx_L1_error)
15234 __Pyx_GOTREF(__pyx_tuple__21);
15235 __Pyx_GIVEREF(__pyx_tuple__21);
15236
15237 /* "(tree fragment)":4
15238 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15239 * def __setstate_cython__(self, __pyx_state):
15240 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15241 */
15242 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 4, __pyx_L1_error)
15243 __Pyx_GOTREF(__pyx_tuple__22);
15244 __Pyx_GIVEREF(__pyx_tuple__22);
15245
15246 /* "(tree fragment)":2
15247 * def __reduce_cython__(self):
15248 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15249 * def __setstate_cython__(self, __pyx_state):
15250 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15251 */
15252 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
15253 __Pyx_GOTREF(__pyx_tuple__23);
15254 __Pyx_GIVEREF(__pyx_tuple__23);
15255
15256 /* "(tree fragment)":4
15257 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15258 * def __setstate_cython__(self, __pyx_state):
15259 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15260 */
15261 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
15262 __Pyx_GOTREF(__pyx_tuple__24);
15263 __Pyx_GIVEREF(__pyx_tuple__24);
15264
15265 /* "(tree fragment)":2
15266 * def __reduce_cython__(self):
15267 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15268 * def __setstate_cython__(self, __pyx_state):
15269 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15270 */
15271 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error)
15272 __Pyx_GOTREF(__pyx_tuple__25);
15273 __Pyx_GIVEREF(__pyx_tuple__25);
15274
15275 /* "(tree fragment)":4
15276 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15277 * def __setstate_cython__(self, __pyx_state):
15278 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15279 */
15280 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
15281 __Pyx_GOTREF(__pyx_tuple__26);
15282 __Pyx_GIVEREF(__pyx_tuple__26);
15283
15284 /* "(tree fragment)":2
15285 * def __reduce_cython__(self):
15286 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15287 * def __setstate_cython__(self, __pyx_state):
15288 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15289 */
15290 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
15291 __Pyx_GOTREF(__pyx_tuple__27);
15292 __Pyx_GIVEREF(__pyx_tuple__27);
15293
15294 /* "(tree fragment)":4
15295 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15296 * def __setstate_cython__(self, __pyx_state):
15297 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15298 */
15299 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
15300 __Pyx_GOTREF(__pyx_tuple__28);
15301 __Pyx_GIVEREF(__pyx_tuple__28);
15302
15303 /* "pymusic.pyx":23
15304 * have a width defined.
15305 * """
15306 * def __init__(self): # <<<<<<<<<<<<<<
15307 * MUSICError.__init__(self, "No width defined")
15308 *
15309 */
15310 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 23, __pyx_L1_error)
15311 __Pyx_GOTREF(__pyx_tuple__30);
15312 __Pyx_GIVEREF(__pyx_tuple__30);
15313 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pymusic_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 23, __pyx_L1_error)
15314
15315 /* "pymusic.pyx":32
15316 * that has not been defined within the configuration.
15317 * """
15318 * def __init__(self, var): # <<<<<<<<<<<<<<
15319 * MUSICError.__init__(
15320 * self,
15321 */
15322 __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_var); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 32, __pyx_L1_error)
15323 __Pyx_GOTREF(__pyx_tuple__32);
15324 __Pyx_GIVEREF(__pyx_tuple__32);
15325 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pymusic_pyx, __pyx_n_s_init, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 32, __pyx_L1_error)
15326
15327 /* "pymusic.pyx":79
15328 * ###########################################################
15329 *
15330 * def predictRank(list argv=None): # <<<<<<<<<<<<<<
15331 * """
15332 * Map into mpidep/predict_rank for config methods.
15333 */
15334 __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_argv, __pyx_n_s_r); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 79, __pyx_L1_error)
15335 __Pyx_GOTREF(__pyx_tuple__34);
15336 __Pyx_GIVEREF(__pyx_tuple__34);
15337 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pymusic_pyx, __pyx_n_s_predictRank, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 79, __pyx_L1_error)
15338 __Pyx_RefNannyFinishContext();
15339 return 0;
15340 __pyx_L1_error:;
15341 __Pyx_RefNannyFinishContext();
15342 return -1;
15343 }
15344
15345 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
15346 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
15347 return 0;
15348 __pyx_L1_error:;
15349 return -1;
15350 }
15351
15352 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
15353 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
15354 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
15355 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
15356 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
15357 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
15358 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
15359
15360 static int __Pyx_modinit_global_init_code(void) {
15361 __Pyx_RefNannyDeclarations
15362 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
15363 /*--- Global init code ---*/
15364 __Pyx_RefNannyFinishContext();
15365 return 0;
15366 }
15367
15368 static int __Pyx_modinit_variable_export_code(void) {
15369 __Pyx_RefNannyDeclarations
15370 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
15371 /*--- Variable export code ---*/
15372 __Pyx_RefNannyFinishContext();
15373 return 0;
15374 }
15375
15376 static int __Pyx_modinit_function_export_code(void) {
15377 __Pyx_RefNannyDeclarations
15378 int __pyx_lineno = 0;
15379 const char *__pyx_filename = NULL;
15380 int __pyx_clineno = 0;
15381 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
15382 /*--- Function export code ---*/
15383 if (__Pyx_ExportFunction("EventCallback", (void (*)(void))MUSIC::EventCallback, "bool (PyObject *, double, MUSIC::Index::Type, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15384 if (__Pyx_ExportFunction("MessageCallback", (void (*)(void))MUSIC::MessageCallback, "bool (PyObject *, double, void *, size_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15385 __Pyx_RefNannyFinishContext();
15386 return 0;
15387 __pyx_L1_error:;
15388 __Pyx_RefNannyFinishContext();
15389 return -1;
15390 }
15391
15392 static int __Pyx_modinit_type_init_code(void) {
15393 __Pyx_RefNannyDeclarations
15394 int __pyx_lineno = 0;
15395 const char *__pyx_filename = NULL;
15396 int __pyx_clineno = 0;
15397 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
15398 /*--- Type init code ---*/
15399 __pyx_vtabptr_7pymusic_Setup = &__pyx_vtable_7pymusic_Setup;
15400 __pyx_vtable_7pymusic_Setup.null = (PyObject *(*)(struct __pyx_obj_7pymusic_Setup *))__pyx_f_7pymusic_5Setup_null;
15401 __pyx_vtable_7pymusic_Setup.getcomm = (struct PyMPIIntracommObject *(*)(struct __pyx_obj_7pymusic_Setup *, int __pyx_skip_dispatch))__pyx_f_7pymusic_5Setup_getcomm;
15402 if (PyType_Ready(&__pyx_type_7pymusic_Setup) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
15403 #if PY_VERSION_HEX < 0x030800B1
15404 __pyx_type_7pymusic_Setup.tp_print = 0;
15405 #endif
15406 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_Setup.tp_dictoffset && __pyx_type_7pymusic_Setup.tp_getattro == PyObject_GenericGetAttr)) {
15407 __pyx_type_7pymusic_Setup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15408 }
15409 if (__Pyx_SetVtable(__pyx_type_7pymusic_Setup.tp_dict, __pyx_vtabptr_7pymusic_Setup) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
15410 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Setup, (PyObject *)&__pyx_type_7pymusic_Setup) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
15411 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_Setup) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
15412 __pyx_ptype_7pymusic_Setup = &__pyx_type_7pymusic_Setup;
15413 if (PyType_Ready(&__pyx_type_7pymusic_Runtime) < 0) __PYX_ERR(0, 517, __pyx_L1_error)
15414 #if PY_VERSION_HEX < 0x030800B1
15415 __pyx_type_7pymusic_Runtime.tp_print = 0;
15416 #endif
15417 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_Runtime.tp_dictoffset && __pyx_type_7pymusic_Runtime.tp_getattro == PyObject_GenericGetAttr)) {
15418 __pyx_type_7pymusic_Runtime.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15419 }
15420 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Runtime, (PyObject *)&__pyx_type_7pymusic_Runtime) < 0) __PYX_ERR(0, 517, __pyx_L1_error)
15421 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_Runtime) < 0) __PYX_ERR(0, 517, __pyx_L1_error)
15422 __pyx_ptype_7pymusic_Runtime = &__pyx_type_7pymusic_Runtime;
15423 __pyx_vtabptr_7pymusic_Port = &__pyx_vtable_7pymusic_Port;
15424 __pyx_vtable_7pymusic_Port.null = (PyObject *(*)(struct __pyx_obj_7pymusic_Port *, int __pyx_skip_dispatch))__pyx_f_7pymusic_4Port_null;
15425 if (PyType_Ready(&__pyx_type_7pymusic_Port) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
15426 #if PY_VERSION_HEX < 0x030800B1
15427 __pyx_type_7pymusic_Port.tp_print = 0;
15428 #endif
15429 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_Port.tp_dictoffset && __pyx_type_7pymusic_Port.tp_getattro == PyObject_GenericGetAttr)) {
15430 __pyx_type_7pymusic_Port.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15431 }
15432 #if CYTHON_UPDATE_DESCRIPTOR_DOC
15433 {
15434 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pymusic_Port, "__hash__"); if (unlikely(!wrapper)) __PYX_ERR(0, 90, __pyx_L1_error)
15435 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
15436 __pyx_wrapperbase_7pymusic_4Port_2__hash__ = *((PyWrapperDescrObject *)wrapper)->d_base;
15437 __pyx_wrapperbase_7pymusic_4Port_2__hash__.doc = __pyx_doc_7pymusic_4Port_2__hash__;
15438 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pymusic_4Port_2__hash__;
15439 }
15440 }
15441 #endif
15442 if (__Pyx_SetVtable(__pyx_type_7pymusic_Port.tp_dict, __pyx_vtabptr_7pymusic_Port) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
15443 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Port, (PyObject *)&__pyx_type_7pymusic_Port) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
15444 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_Port) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
15445 __pyx_ptype_7pymusic_Port = &__pyx_type_7pymusic_Port;
15446 __pyx_vtabptr_7pymusic_ContInputPort = &__pyx_vtable_7pymusic_ContInputPort;
15447 __pyx_vtable_7pymusic_ContInputPort.__pyx_base = *__pyx_vtabptr_7pymusic_Port;
15448 __pyx_type_7pymusic_ContInputPort.tp_base = __pyx_ptype_7pymusic_Port;
15449 if (PyType_Ready(&__pyx_type_7pymusic_ContInputPort) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
15450 #if PY_VERSION_HEX < 0x030800B1
15451 __pyx_type_7pymusic_ContInputPort.tp_print = 0;
15452 #endif
15453 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_ContInputPort.tp_dictoffset && __pyx_type_7pymusic_ContInputPort.tp_getattro == PyObject_GenericGetAttr)) {
15454 __pyx_type_7pymusic_ContInputPort.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15455 }
15456 if (__Pyx_SetVtable(__pyx_type_7pymusic_ContInputPort.tp_dict, __pyx_vtabptr_7pymusic_ContInputPort) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
15457 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ContInputPort, (PyObject *)&__pyx_type_7pymusic_ContInputPort) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
15458 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_ContInputPort) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
15459 __pyx_ptype_7pymusic_ContInputPort = &__pyx_type_7pymusic_ContInputPort;
15460 __pyx_vtabptr_7pymusic_ContOutputPort = &__pyx_vtable_7pymusic_ContOutputPort;
15461 __pyx_vtable_7pymusic_ContOutputPort.__pyx_base = *__pyx_vtabptr_7pymusic_Port;
15462 __pyx_type_7pymusic_ContOutputPort.tp_base = __pyx_ptype_7pymusic_Port;
15463 if (PyType_Ready(&__pyx_type_7pymusic_ContOutputPort) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
15464 #if PY_VERSION_HEX < 0x030800B1
15465 __pyx_type_7pymusic_ContOutputPort.tp_print = 0;
15466 #endif
15467 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_ContOutputPort.tp_dictoffset && __pyx_type_7pymusic_ContOutputPort.tp_getattro == PyObject_GenericGetAttr)) {
15468 __pyx_type_7pymusic_ContOutputPort.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15469 }
15470 if (__Pyx_SetVtable(__pyx_type_7pymusic_ContOutputPort.tp_dict, __pyx_vtabptr_7pymusic_ContOutputPort) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
15471 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ContOutputPort, (PyObject *)&__pyx_type_7pymusic_ContOutputPort) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
15472 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_ContOutputPort) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
15473 __pyx_ptype_7pymusic_ContOutputPort = &__pyx_type_7pymusic_ContOutputPort;
15474 __pyx_vtabptr_7pymusic_EventInputPort = &__pyx_vtable_7pymusic_EventInputPort;
15475 __pyx_vtable_7pymusic_EventInputPort.__pyx_base = *__pyx_vtabptr_7pymusic_Port;
15476 __pyx_vtable_7pymusic_EventInputPort.__pyx_base.null = (PyObject *(*)(struct __pyx_obj_7pymusic_Port *, int __pyx_skip_dispatch))__pyx_f_7pymusic_14EventInputPort_null;
15477 __pyx_type_7pymusic_EventInputPort.tp_base = __pyx_ptype_7pymusic_Port;
15478 if (PyType_Ready(&__pyx_type_7pymusic_EventInputPort) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
15479 #if PY_VERSION_HEX < 0x030800B1
15480 __pyx_type_7pymusic_EventInputPort.tp_print = 0;
15481 #endif
15482 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_EventInputPort.tp_dictoffset && __pyx_type_7pymusic_EventInputPort.tp_getattro == PyObject_GenericGetAttr)) {
15483 __pyx_type_7pymusic_EventInputPort.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15484 }
15485 if (__Pyx_SetVtable(__pyx_type_7pymusic_EventInputPort.tp_dict, __pyx_vtabptr_7pymusic_EventInputPort) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
15486 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EventInputPort, (PyObject *)&__pyx_type_7pymusic_EventInputPort) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
15487 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_EventInputPort) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
15488 __pyx_ptype_7pymusic_EventInputPort = &__pyx_type_7pymusic_EventInputPort;
15489 __pyx_vtabptr_7pymusic_EventOutputPort = &__pyx_vtable_7pymusic_EventOutputPort;
15490 __pyx_vtable_7pymusic_EventOutputPort.__pyx_base = *__pyx_vtabptr_7pymusic_Port;
15491 __pyx_type_7pymusic_EventOutputPort.tp_base = __pyx_ptype_7pymusic_Port;
15492 if (PyType_Ready(&__pyx_type_7pymusic_EventOutputPort) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
15493 #if PY_VERSION_HEX < 0x030800B1
15494 __pyx_type_7pymusic_EventOutputPort.tp_print = 0;
15495 #endif
15496 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_EventOutputPort.tp_dictoffset && __pyx_type_7pymusic_EventOutputPort.tp_getattro == PyObject_GenericGetAttr)) {
15497 __pyx_type_7pymusic_EventOutputPort.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15498 }
15499 if (__Pyx_SetVtable(__pyx_type_7pymusic_EventOutputPort.tp_dict, __pyx_vtabptr_7pymusic_EventOutputPort) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
15500 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EventOutputPort, (PyObject *)&__pyx_type_7pymusic_EventOutputPort) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
15501 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_EventOutputPort) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
15502 __pyx_ptype_7pymusic_EventOutputPort = &__pyx_type_7pymusic_EventOutputPort;
15503 __pyx_vtabptr_7pymusic_MessageInputPort = &__pyx_vtable_7pymusic_MessageInputPort;
15504 __pyx_vtable_7pymusic_MessageInputPort.__pyx_base = *__pyx_vtabptr_7pymusic_Port;
15505 __pyx_vtable_7pymusic_MessageInputPort.__pyx_base.null = (PyObject *(*)(struct __pyx_obj_7pymusic_Port *, int __pyx_skip_dispatch))__pyx_f_7pymusic_16MessageInputPort_null;
15506 __pyx_type_7pymusic_MessageInputPort.tp_base = __pyx_ptype_7pymusic_Port;
15507 if (PyType_Ready(&__pyx_type_7pymusic_MessageInputPort) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
15508 #if PY_VERSION_HEX < 0x030800B1
15509 __pyx_type_7pymusic_MessageInputPort.tp_print = 0;
15510 #endif
15511 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_MessageInputPort.tp_dictoffset && __pyx_type_7pymusic_MessageInputPort.tp_getattro == PyObject_GenericGetAttr)) {
15512 __pyx_type_7pymusic_MessageInputPort.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15513 }
15514 if (__Pyx_SetVtable(__pyx_type_7pymusic_MessageInputPort.tp_dict, __pyx_vtabptr_7pymusic_MessageInputPort) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
15515 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MessageInputPort, (PyObject *)&__pyx_type_7pymusic_MessageInputPort) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
15516 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_MessageInputPort) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
15517 __pyx_ptype_7pymusic_MessageInputPort = &__pyx_type_7pymusic_MessageInputPort;
15518 __pyx_vtabptr_7pymusic_MessageOutputPort = &__pyx_vtable_7pymusic_MessageOutputPort;
15519 __pyx_vtable_7pymusic_MessageOutputPort.__pyx_base = *__pyx_vtabptr_7pymusic_Port;
15520 __pyx_type_7pymusic_MessageOutputPort.tp_base = __pyx_ptype_7pymusic_Port;
15521 if (PyType_Ready(&__pyx_type_7pymusic_MessageOutputPort) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
15522 #if PY_VERSION_HEX < 0x030800B1
15523 __pyx_type_7pymusic_MessageOutputPort.tp_print = 0;
15524 #endif
15525 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_MessageOutputPort.tp_dictoffset && __pyx_type_7pymusic_MessageOutputPort.tp_getattro == PyObject_GenericGetAttr)) {
15526 __pyx_type_7pymusic_MessageOutputPort.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15527 }
15528 if (__Pyx_SetVtable(__pyx_type_7pymusic_MessageOutputPort.tp_dict, __pyx_vtabptr_7pymusic_MessageOutputPort) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
15529 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MessageOutputPort, (PyObject *)&__pyx_type_7pymusic_MessageOutputPort) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
15530 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_MessageOutputPort) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
15531 __pyx_ptype_7pymusic_MessageOutputPort = &__pyx_type_7pymusic_MessageOutputPort;
15532 if (PyType_Ready(&__pyx_type_7pymusic_DataMap) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
15533 #if PY_VERSION_HEX < 0x030800B1
15534 __pyx_type_7pymusic_DataMap.tp_print = 0;
15535 #endif
15536 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_DataMap.tp_dictoffset && __pyx_type_7pymusic_DataMap.tp_getattro == PyObject_GenericGetAttr)) {
15537 __pyx_type_7pymusic_DataMap.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15538 }
15539 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DataMap, (PyObject *)&__pyx_type_7pymusic_DataMap) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
15540 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_DataMap) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
15541 __pyx_ptype_7pymusic_DataMap = &__pyx_type_7pymusic_DataMap;
15542 if (PyType_Ready(&__pyx_type_7pymusic_IndexMap) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
15543 #if PY_VERSION_HEX < 0x030800B1
15544 __pyx_type_7pymusic_IndexMap.tp_print = 0;
15545 #endif
15546 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_IndexMap.tp_dictoffset && __pyx_type_7pymusic_IndexMap.tp_getattro == PyObject_GenericGetAttr)) {
15547 __pyx_type_7pymusic_IndexMap.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15548 }
15549 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IndexMap, (PyObject *)&__pyx_type_7pymusic_IndexMap) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
15550 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_IndexMap) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
15551 __pyx_ptype_7pymusic_IndexMap = &__pyx_type_7pymusic_IndexMap;
15552 if (PyType_Ready(&__pyx_type_7pymusic_EventHandler) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
15553 #if PY_VERSION_HEX < 0x030800B1
15554 __pyx_type_7pymusic_EventHandler.tp_print = 0;
15555 #endif
15556 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_EventHandler.tp_dictoffset && __pyx_type_7pymusic_EventHandler.tp_getattro == PyObject_GenericGetAttr)) {
15557 __pyx_type_7pymusic_EventHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15558 }
15559 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EventHandler, (PyObject *)&__pyx_type_7pymusic_EventHandler) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
15560 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_EventHandler) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
15561 __pyx_ptype_7pymusic_EventHandler = &__pyx_type_7pymusic_EventHandler;
15562 if (PyType_Ready(&__pyx_type_7pymusic_MessageHandler) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
15563 #if PY_VERSION_HEX < 0x030800B1
15564 __pyx_type_7pymusic_MessageHandler.tp_print = 0;
15565 #endif
15566 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic_MessageHandler.tp_dictoffset && __pyx_type_7pymusic_MessageHandler.tp_getattro == PyObject_GenericGetAttr)) {
15567 __pyx_type_7pymusic_MessageHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15568 }
15569 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MessageHandler, (PyObject *)&__pyx_type_7pymusic_MessageHandler) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
15570 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic_MessageHandler) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
15571 __pyx_ptype_7pymusic_MessageHandler = &__pyx_type_7pymusic_MessageHandler;
15572 if (PyType_Ready(&__pyx_type_7pymusic__Index) < 0) __PYX_ERR(0, 643, __pyx_L1_error)
15573 #if PY_VERSION_HEX < 0x030800B1
15574 __pyx_type_7pymusic__Index.tp_print = 0;
15575 #endif
15576 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic__Index.tp_dictoffset && __pyx_type_7pymusic__Index.tp_getattro == PyObject_GenericGetAttr)) {
15577 __pyx_type_7pymusic__Index.tp_getattro = __Pyx_PyObject_GenericGetAttr;
15578 }
15579 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Index, (PyObject *)&__pyx_type_7pymusic__Index) < 0) __PYX_ERR(0, 643, __pyx_L1_error)
15580 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pymusic__Index) < 0) __PYX_ERR(0, 643, __pyx_L1_error)
15581 __pyx_ptype_7pymusic__Index = &__pyx_type_7pymusic__Index;
15582 if (PyType_Ready(&__pyx_type_7pymusic___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
15583 #if PY_VERSION_HEX < 0x030800B1
15584 __pyx_type_7pymusic___pyx_scope_struct____iter__.tp_print = 0;
15585 #endif
15586 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pymusic___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_7pymusic___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
15587 __pyx_type_7pymusic___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
15588 }
15589 __pyx_ptype_7pymusic___pyx_scope_struct____iter__ = &__pyx_type_7pymusic___pyx_scope_struct____iter__;
15590 __Pyx_RefNannyFinishContext();
15591 return 0;
15592 __pyx_L1_error:;
15593 __Pyx_RefNannyFinishContext();
15594 return -1;
15595 }
15596
15597 static int __Pyx_modinit_type_import_code(void) {
15598 __Pyx_RefNannyDeclarations
15599 PyObject *__pyx_t_1 = NULL;
15600 int __pyx_lineno = 0;
15601 const char *__pyx_filename = NULL;
15602 int __pyx_clineno = 0;
15603 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
15604 /*--- Type import code ---*/
15605 __pyx_t_1 = PyImport_ImportModule("mpi4py.MPI"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 28, __pyx_L1_error)
15606 __Pyx_GOTREF(__pyx_t_1);
15607 __pyx_ptype_6mpi4py_3MPI_Datatype = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Datatype", sizeof(struct PyMPIDatatypeObject), __Pyx_ImportType_CheckSize_Warn);
15608 if (!__pyx_ptype_6mpi4py_3MPI_Datatype) __PYX_ERR(3, 28, __pyx_L1_error)
15609 __pyx_ptype_6mpi4py_3MPI_Status = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Status", sizeof(struct PyMPIStatusObject), __Pyx_ImportType_CheckSize_Warn);
15610 if (!__pyx_ptype_6mpi4py_3MPI_Status) __PYX_ERR(3, 36, __pyx_L1_error)
15611 __pyx_ptype_6mpi4py_3MPI_Request = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Request", sizeof(struct PyMPIRequestObject), __Pyx_ImportType_CheckSize_Warn);
15612 if (!__pyx_ptype_6mpi4py_3MPI_Request) __PYX_ERR(3, 44, __pyx_L1_error)
15613 __pyx_ptype_6mpi4py_3MPI_Prequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Prequest", sizeof(struct PyMPIPrequestObject), __Pyx_ImportType_CheckSize_Warn);
15614 if (!__pyx_ptype_6mpi4py_3MPI_Prequest) __PYX_ERR(3, 53, __pyx_L1_error)
15615 __pyx_ptype_6mpi4py_3MPI_Grequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Grequest", sizeof(struct PyMPIGrequestObject), __Pyx_ImportType_CheckSize_Warn);
15616 if (!__pyx_ptype_6mpi4py_3MPI_Grequest) __PYX_ERR(3, 59, __pyx_L1_error)
15617 __pyx_ptype_6mpi4py_3MPI_Message = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Message", sizeof(struct PyMPIMessageObject), __Pyx_ImportType_CheckSize_Warn);
15618 if (!__pyx_ptype_6mpi4py_3MPI_Message) __PYX_ERR(3, 65, __pyx_L1_error)
15619 __pyx_ptype_6mpi4py_3MPI_Op = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Op", sizeof(struct PyMPIOpObject), __Pyx_ImportType_CheckSize_Warn);
15620 if (!__pyx_ptype_6mpi4py_3MPI_Op) __PYX_ERR(3, 74, __pyx_L1_error)
15621 __pyx_ptype_6mpi4py_3MPI_Group = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Group", sizeof(struct PyMPIGroupObject), __Pyx_ImportType_CheckSize_Warn);
15622 if (!__pyx_ptype_6mpi4py_3MPI_Group) __PYX_ERR(3, 84, __pyx_L1_error)
15623 __pyx_ptype_6mpi4py_3MPI_Info = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Info", sizeof(struct PyMPIInfoObject), __Pyx_ImportType_CheckSize_Warn);
15624 if (!__pyx_ptype_6mpi4py_3MPI_Info) __PYX_ERR(3, 92, __pyx_L1_error)
15625 __pyx_ptype_6mpi4py_3MPI_Errhandler = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Errhandler", sizeof(struct PyMPIErrhandlerObject), __Pyx_ImportType_CheckSize_Warn);
15626 if (!__pyx_ptype_6mpi4py_3MPI_Errhandler) __PYX_ERR(3, 100, __pyx_L1_error)
15627 __pyx_ptype_6mpi4py_3MPI_Comm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Comm", sizeof(struct PyMPICommObject), __Pyx_ImportType_CheckSize_Warn);
15628 if (!__pyx_ptype_6mpi4py_3MPI_Comm) __PYX_ERR(3, 108, __pyx_L1_error)
15629 __pyx_ptype_6mpi4py_3MPI_Intracomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intracomm", sizeof(struct PyMPIIntracommObject), __Pyx_ImportType_CheckSize_Warn);
15630 if (!__pyx_ptype_6mpi4py_3MPI_Intracomm) __PYX_ERR(3, 116, __pyx_L1_error)
15631 __pyx_ptype_6mpi4py_3MPI_Topocomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Topocomm", sizeof(struct PyMPITopocommObject), __Pyx_ImportType_CheckSize_Warn);
15632 if (!__pyx_ptype_6mpi4py_3MPI_Topocomm) __PYX_ERR(3, 122, __pyx_L1_error)
15633 __pyx_ptype_6mpi4py_3MPI_Cartcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Cartcomm", sizeof(struct PyMPICartcommObject), __Pyx_ImportType_CheckSize_Warn);
15634 if (!__pyx_ptype_6mpi4py_3MPI_Cartcomm) __PYX_ERR(3, 128, __pyx_L1_error)
15635 __pyx_ptype_6mpi4py_3MPI_Graphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Graphcomm", sizeof(struct PyMPIGraphcommObject), __Pyx_ImportType_CheckSize_Warn);
15636 if (!__pyx_ptype_6mpi4py_3MPI_Graphcomm) __PYX_ERR(3, 134, __pyx_L1_error)
15637 __pyx_ptype_6mpi4py_3MPI_Distgraphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Distgraphcomm", sizeof(struct PyMPIDistgraphcommObject), __Pyx_ImportType_CheckSize_Warn);
15638 if (!__pyx_ptype_6mpi4py_3MPI_Distgraphcomm) __PYX_ERR(3, 140, __pyx_L1_error)
15639 __pyx_ptype_6mpi4py_3MPI_Intercomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intercomm", sizeof(struct PyMPIIntercommObject), __Pyx_ImportType_CheckSize_Warn);
15640 if (!__pyx_ptype_6mpi4py_3MPI_Intercomm) __PYX_ERR(3, 146, __pyx_L1_error)
15641 __pyx_ptype_6mpi4py_3MPI_Win = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Win", sizeof(struct PyMPIWinObject), __Pyx_ImportType_CheckSize_Warn);
15642 if (!__pyx_ptype_6mpi4py_3MPI_Win) __PYX_ERR(3, 152, __pyx_L1_error)
15643 __pyx_ptype_6mpi4py_3MPI_File = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "File", sizeof(struct PyMPIFileObject), __Pyx_ImportType_CheckSize_Warn);
15644 if (!__pyx_ptype_6mpi4py_3MPI_File) __PYX_ERR(3, 161, __pyx_L1_error)
15645 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15646 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
15647 __Pyx_GOTREF(__pyx_t_1);
15648 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
15649 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
15650 sizeof(PyTypeObject),
15651 #else
15652 sizeof(PyHeapTypeObject),
15653 #endif
15654 __Pyx_ImportType_CheckSize_Warn);
15655 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
15656 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15657 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
15658 __Pyx_GOTREF(__pyx_t_1);
15659 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
15660 if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(5, 8, __pyx_L1_error)
15661 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15662 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
15663 __Pyx_GOTREF(__pyx_t_1);
15664 __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
15665 if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(6, 15, __pyx_L1_error)
15666 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15667 __pyx_t_1 = PyImport_ImportModule("music.pybuffer"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 49, __pyx_L1_error)
15668 __Pyx_GOTREF(__pyx_t_1);
15669 __pyx_ptype_5music_8pybuffer_Buffer = __Pyx_ImportType(__pyx_t_1, "music.pybuffer", "Buffer", sizeof(struct __pyx_obj_5music_8pybuffer_Buffer), __Pyx_ImportType_CheckSize_Warn);
15670 if (!__pyx_ptype_5music_8pybuffer_Buffer) __PYX_ERR(7, 49, __pyx_L1_error)
15671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15672 __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 58, __pyx_L1_error)
15673 __Pyx_GOTREF(__pyx_t_1);
15674 __pyx_ptype_7cpython_5array_array = __Pyx_ImportType(__pyx_t_1, "array", "array", sizeof(arrayobject), __Pyx_ImportType_CheckSize_Warn);
15675 if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(2, 58, __pyx_L1_error)
15676 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15677 __Pyx_RefNannyFinishContext();
15678 return 0;
15679 __pyx_L1_error:;
15680 __Pyx_XDECREF(__pyx_t_1);
15681 __Pyx_RefNannyFinishContext();
15682 return -1;
15683 }
15684
15685 static int __Pyx_modinit_variable_import_code(void) {
15686 __Pyx_RefNannyDeclarations
15687 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
15688 /*--- Variable import code ---*/
15689 __Pyx_RefNannyFinishContext();
15690 return 0;
15691 }
15692
15693 static int __Pyx_modinit_function_import_code(void) {
15694 __Pyx_RefNannyDeclarations
15695 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
15696 /*--- Function import code ---*/
15697 __Pyx_RefNannyFinishContext();
15698 return 0;
15699 }
15700
15701
15702 #ifndef CYTHON_NO_PYINIT_EXPORT
15703 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
15704 #elif PY_MAJOR_VERSION < 3
15705 #ifdef __cplusplus
15706 #define __Pyx_PyMODINIT_FUNC extern "C" void
15707 #else
15708 #define __Pyx_PyMODINIT_FUNC void
15709 #endif
15710 #else
15711 #ifdef __cplusplus
15712 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
15713 #else
15714 #define __Pyx_PyMODINIT_FUNC PyObject *
15715 #endif
15716 #endif
15717
15718
15719 #if PY_MAJOR_VERSION < 3
15720 __Pyx_PyMODINIT_FUNC initpymusic(void) CYTHON_SMALL_CODE; /*proto*/
15721 __Pyx_PyMODINIT_FUNC initpymusic(void)
15722 #else
15723 __Pyx_PyMODINIT_FUNC PyInit_pymusic(void) CYTHON_SMALL_CODE; /*proto*/
15724 __Pyx_PyMODINIT_FUNC PyInit_pymusic(void)
15725 #if CYTHON_PEP489_MULTI_PHASE_INIT
15726 {
15727 return PyModuleDef_Init(&__pyx_moduledef);
15728 }
15729 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
15730 #if PY_VERSION_HEX >= 0x030700A1
15731 static PY_INT64_T main_interpreter_id = -1;
15732 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
15733 if (main_interpreter_id == -1) {
15734 main_interpreter_id = current_id;
15735 return (unlikely(current_id == -1)) ? -1 : 0;
15736 } else if (unlikely(main_interpreter_id != current_id))
15737 #else
15738 static PyInterpreterState *main_interpreter = NULL;
15739 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
15740 if (!main_interpreter) {
15741 main_interpreter = current_interpreter;
15742 } else if (unlikely(main_interpreter != current_interpreter))
15743 #endif
15744 {
15745 PyErr_SetString(
15746 PyExc_ImportError,
15747 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
15748 return -1;
15749 }
15750 return 0;
15751 }
15752 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) {
15753 PyObject *value = PyObject_GetAttrString(spec, from_name);
15754 int result = 0;
15755 if (likely(value)) {
15756 if (allow_none || value != Py_None) {
15757 result = PyDict_SetItemString(moddict, to_name, value);
15758 }
15759 Py_DECREF(value);
15760 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
15761 PyErr_Clear();
15762 } else {
15763 result = -1;
15764 }
15765 return result;
15766 }
15767 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
15768 PyObject *module = NULL, *moddict, *modname;
15769 if (__Pyx_check_single_interpreter())
15770 return NULL;
15771 if (__pyx_m)
15772 return __Pyx_NewRef(__pyx_m);
15773 modname = PyObject_GetAttrString(spec, "name");
15774 if (unlikely(!modname)) goto bad;
15775 module = PyModule_NewObject(modname);
15776 Py_DECREF(modname);
15777 if (unlikely(!module)) goto bad;
15778 moddict = PyModule_GetDict(module);
15779 if (unlikely(!moddict)) goto bad;
15780 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
15781 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
15782 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
15783 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
15784 return module;
15785 bad:
15786 Py_XDECREF(module);
15787 return NULL;
15788 }
15789
15790
15791 static CYTHON_SMALL_CODE int __pyx_pymod_exec_pymusic(PyObject *__pyx_pyinit_module)
15792 #endif
15793 #endif
15794 {
15795 PyObject *__pyx_t_1 = NULL;
15796 PyObject *__pyx_t_2 = NULL;
15797 PyObject *__pyx_t_3 = NULL;
15798 PyObject *__pyx_t_4 = NULL;
15799 int __pyx_lineno = 0;
15800 const char *__pyx_filename = NULL;
15801 int __pyx_clineno = 0;
15802 __Pyx_RefNannyDeclarations
15803 #if CYTHON_PEP489_MULTI_PHASE_INIT
15804 if (__pyx_m) {
15805 if (__pyx_m == __pyx_pyinit_module) return 0;
15806 PyErr_SetString(PyExc_RuntimeError, "Module 'pymusic' has already been imported. Re-initialisation is not supported.");
15807 return -1;
15808 }
15809 #elif PY_MAJOR_VERSION >= 3
15810 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
15811 #endif
15812 #if CYTHON_REFNANNY
15813 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
15814 if (!__Pyx_RefNanny) {
15815 PyErr_Clear();
15816 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
15817 if (!__Pyx_RefNanny)
15818 Py_FatalError("failed to import 'refnanny' module");
15819 }
15820 #endif
15821 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_pymusic(void)", 0);
15822 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15823 #ifdef __Pxy_PyFrame_Initialize_Offsets
15824 __Pxy_PyFrame_Initialize_Offsets();
15825 #endif
15826 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
15827 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
15828 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
15829 #ifdef __Pyx_CyFunction_USED
15830 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15831 #endif
15832 #ifdef __Pyx_FusedFunction_USED
15833 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15834 #endif
15835 #ifdef __Pyx_Coroutine_USED
15836 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15837 #endif
15838 #ifdef __Pyx_Generator_USED
15839 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15840 #endif
15841 #ifdef __Pyx_AsyncGen_USED
15842 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15843 #endif
15844 #ifdef __Pyx_StopAsyncIteration_USED
15845 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15846 #endif
15847 /*--- Library function declarations ---*/
15848 /*--- Threads initialization code ---*/
15849 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
15850 PyEval_InitThreads();
15851 #endif
15852 /*--- Module creation code ---*/
15853 #if CYTHON_PEP489_MULTI_PHASE_INIT
15854 __pyx_m = __pyx_pyinit_module;
15855 Py_INCREF(__pyx_m);
15856 #else
15857 #if PY_MAJOR_VERSION < 3
15858 __pyx_m = Py_InitModule4("pymusic", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
15859 #else
15860 __pyx_m = PyModule_Create(&__pyx_moduledef);
15861 #endif
15862 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
15863 #endif
15864 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
15865 Py_INCREF(__pyx_d);
15866 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
15867 Py_INCREF(__pyx_b);
15868 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
15869 Py_INCREF(__pyx_cython_runtime);
15870 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
15871 /*--- Initialize various global constants etc. ---*/
15872 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15873 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
15874 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15875 #endif
15876 if (__pyx_module_is_main_pymusic) {
15877 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15878 }
15879 #if PY_MAJOR_VERSION >= 3
15880 {
15881 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
15882 if (!PyDict_GetItemString(modules, "pymusic")) {
15883 if (unlikely(PyDict_SetItemString(modules, "pymusic", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
15884 }
15885 }
15886 #endif
15887 /*--- Builtin init code ---*/
15888 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15889 /*--- Constants init code ---*/
15890 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15891 /*--- Global type/function init code ---*/
15892 (void)__Pyx_modinit_global_init_code();
15893 (void)__Pyx_modinit_variable_export_code();
15894 if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
15895 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
15896 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
15897 (void)__Pyx_modinit_variable_import_code();
15898 (void)__Pyx_modinit_function_import_code();
15899 /*--- Execution code ---*/
15900 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
15901 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15902 #endif
15903
15904 /* "pymusic.pyx":7
15905 * from libc.stdlib cimport malloc, free
15906 *
15907 * import mpi4py.MPI as MPI # <<<<<<<<<<<<<<
15908 * from six.moves import cPickle as pickle
15909 *
15910 */
15911 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
15912 __Pyx_GOTREF(__pyx_t_1);
15913 __Pyx_INCREF(__pyx_n_s__29);
15914 __Pyx_GIVEREF(__pyx_n_s__29);
15915 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__29);
15916 __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py_MPI, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
15917 __Pyx_GOTREF(__pyx_t_2);
15918 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15919 if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPI, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
15920 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15921
15922 /* "pymusic.pyx":8
15923 *
15924 * import mpi4py.MPI as MPI
15925 * from six.moves import cPickle as pickle # <<<<<<<<<<<<<<
15926 *
15927 * ###########################################################
15928 */
15929 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
15930 __Pyx_GOTREF(__pyx_t_2);
15931 __Pyx_INCREF(__pyx_n_s_cPickle);
15932 __Pyx_GIVEREF(__pyx_n_s_cPickle);
15933 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_cPickle);
15934 __pyx_t_1 = __Pyx_Import(__pyx_n_s_six_moves, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
15935 __Pyx_GOTREF(__pyx_t_1);
15936 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15937 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_cPickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
15938 __Pyx_GOTREF(__pyx_t_2);
15939 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
15940 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15941 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15942
15943 /* "pymusic.pyx":12
15944 * ###########################################################
15945 *
15946 * class MUSICError(Exception): # <<<<<<<<<<<<<<
15947 * """
15948 * All exceptions in pymusic are MUSICError's
15949 */
15950 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
15951 __Pyx_GOTREF(__pyx_t_1);
15952 __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15953 __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15954 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15955 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
15956 __Pyx_GOTREF(__pyx_t_2);
15957 __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_MUSICError, __pyx_n_s_MUSICError, (PyObject *) NULL, __pyx_n_s_pymusic, __pyx_kp_s_All_exceptions_in_pymusic_are_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error)
15958 __Pyx_GOTREF(__pyx_t_3);
15959 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MUSICError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error)
15960 __Pyx_GOTREF(__pyx_t_4);
15961 if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUSICError, __pyx_t_4) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
15962 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15963 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15964 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15965 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15966
15967 /* "pymusic.pyx":18
15968 * pass
15969 *
15970 * class NoWidth(MUSICError): # <<<<<<<<<<<<<<
15971 * """
15972 * Thrown if Port.width() is called, and port doesn't
15973 */
15974 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MUSICError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
15975 __Pyx_GOTREF(__pyx_t_1);
15976 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
15977 __Pyx_GOTREF(__pyx_t_2);
15978 __Pyx_GIVEREF(__pyx_t_1);
15979 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
15980 __pyx_t_1 = 0;
15981 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
15982 __Pyx_GOTREF(__pyx_t_1);
15983 __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_NoWidth, __pyx_n_s_NoWidth, (PyObject *) NULL, __pyx_n_s_pymusic, __pyx_kp_s_Thrown_if_Port_width_is_called); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error)
15984 __Pyx_GOTREF(__pyx_t_3);
15985
15986 /* "pymusic.pyx":23
15987 * have a width defined.
15988 * """
15989 * def __init__(self): # <<<<<<<<<<<<<<
15990 * MUSICError.__init__(self, "No width defined")
15991 *
15992 */
15993 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pymusic_7NoWidth_1__init__, 0, __pyx_n_s_NoWidth___init, NULL, __pyx_n_s_pymusic, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
15994 __Pyx_GOTREF(__pyx_t_4);
15995 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
15996 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15997
15998 /* "pymusic.pyx":18
15999 * pass
16000 *
16001 * class NoWidth(MUSICError): # <<<<<<<<<<<<<<
16002 * """
16003 * Thrown if Port.width() is called, and port doesn't
16004 */
16005 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_NoWidth, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error)
16006 __Pyx_GOTREF(__pyx_t_4);
16007 if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoWidth, __pyx_t_4) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
16008 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16009 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16011 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16012
16013 /* "pymusic.pyx":26
16014 * MUSICError.__init__(self, "No width defined")
16015 *
16016 * class UndefinedConfig(MUSICError): # <<<<<<<<<<<<<<
16017 * """
16018 * Thrown if a configuration value is requested
16019 */
16020 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MUSICError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
16021 __Pyx_GOTREF(__pyx_t_2);
16022 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
16023 __Pyx_GOTREF(__pyx_t_1);
16024 __Pyx_GIVEREF(__pyx_t_2);
16025 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
16026 __pyx_t_2 = 0;
16027 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
16028 __Pyx_GOTREF(__pyx_t_2);
16029 __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UndefinedConfig, __pyx_n_s_UndefinedConfig, (PyObject *) NULL, __pyx_n_s_pymusic, __pyx_kp_s_Thrown_if_a_configuration_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
16030 __Pyx_GOTREF(__pyx_t_3);
16031
16032 /* "pymusic.pyx":32
16033 * that has not been defined within the configuration.
16034 * """
16035 * def __init__(self, var): # <<<<<<<<<<<<<<
16036 * MUSICError.__init__(
16037 * self,
16038 */
16039 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pymusic_15UndefinedConfig_1__init__, 0, __pyx_n_s_UndefinedConfig___init, NULL, __pyx_n_s_pymusic, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error)
16040 __Pyx_GOTREF(__pyx_t_4);
16041 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
16042 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16043
16044 /* "pymusic.pyx":26
16045 * MUSICError.__init__(self, "No width defined")
16046 *
16047 * class UndefinedConfig(MUSICError): # <<<<<<<<<<<<<<
16048 * """
16049 * Thrown if a configuration value is requested
16050 */
16051 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UndefinedConfig, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
16052 __Pyx_GOTREF(__pyx_t_4);
16053 if (PyDict_SetItem(__pyx_d, __pyx_n_s_UndefinedConfig, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
16054 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16055 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16056 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16057 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16058
16059 /* "pymusic.pyx":79
16060 * ###########################################################
16061 *
16062 * def predictRank(list argv=None): # <<<<<<<<<<<<<<
16063 * """
16064 * Map into mpidep/predict_rank for config methods.
16065 */
16066 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pymusic_1predictRank, NULL, __pyx_n_s_pymusic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
16067 __Pyx_GOTREF(__pyx_t_1);
16068 if (PyDict_SetItem(__pyx_d, __pyx_n_s_predictRank, __pyx_t_1) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
16069 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16070
16071 /* "pymusic.pyx":347
16072 * ###########################################################
16073 *
16074 * import sys # <<<<<<<<<<<<<<
16075 * cdef class Setup(object):
16076 * """
16077 */
16078 __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
16079 __Pyx_GOTREF(__pyx_t_1);
16080 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 347, __pyx_L1_error)
16081 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16082
16083 /* "pymusic.pyx":553
16084 * ###########################################################
16085 *
16086 * from music.pybuffer import Buffer # <<<<<<<<<<<<<<
16087 *
16088 * from cpython cimport array
16089 */
16090 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
16091 __Pyx_GOTREF(__pyx_t_1);
16092 __Pyx_INCREF(__pyx_n_s_Buffer);
16093 __Pyx_GIVEREF(__pyx_n_s_Buffer);
16094 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Buffer);
16095 __pyx_t_2 = __Pyx_Import(__pyx_n_s_music_pybuffer, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
16096 __Pyx_GOTREF(__pyx_t_2);
16097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16098 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16099
16100 /* "pymusic.pyx":556
16101 *
16102 * from cpython cimport array
16103 * from array import array # <<<<<<<<<<<<<<
16104 *
16105 * cdef class IndexMap:
16106 */
16107 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
16108 __Pyx_GOTREF(__pyx_t_2);
16109 __Pyx_INCREF(__pyx_n_s_array);
16110 __Pyx_GIVEREF(__pyx_n_s_array);
16111 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_array);
16112 __pyx_t_1 = __Pyx_Import(__pyx_n_s_array, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
16113 __Pyx_GOTREF(__pyx_t_1);
16114 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16115 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
16116 __Pyx_GOTREF(__pyx_t_2);
16117 if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_2) < 0) __PYX_ERR(0, 556, __pyx_L1_error)
16118 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16119 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16120
16121 /* "pymusic.pyx":669
16122 *
16123 * # And here is the singleton def
16124 * Index = _Index() # <<<<<<<<<<<<<<
16125 *
16126 * cdef cbool EventCallback(PyObject* func,
16127 */
16128 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pymusic__Index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
16129 __Pyx_GOTREF(__pyx_t_1);
16130 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Index_2, __pyx_t_1) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
16131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16132
16133 /* "pymusic.pyx":733
16134 * # so that it can be thrown
16135 * #
16136 * pythonError = False # <<<<<<<<<<<<<<
16137 * etype = NULL
16138 * evalue = NULL
16139 */
16140 MUSIC::pythonError = 0;
16141
16142 /* "pymusic.pyx":734
16143 * #
16144 * pythonError = False
16145 * etype = NULL # <<<<<<<<<<<<<<
16146 * evalue = NULL
16147 * etraceback = NULL
16148 */
16149 MUSIC::etype = NULL;
16150
16151 /* "pymusic.pyx":735
16152 * pythonError = False
16153 * etype = NULL
16154 * evalue = NULL # <<<<<<<<<<<<<<
16155 * etraceback = NULL
16156 */
16157 MUSIC::evalue = NULL;
16158
16159 /* "pymusic.pyx":736
16160 * etype = NULL
16161 * evalue = NULL
16162 * etraceback = NULL # <<<<<<<<<<<<<<
16163 */
16164 MUSIC::etraceback = NULL;
16165
16166 /* "pymusic.pyx":1
16167 * # # <<<<<<<<<<<<<<
16168 * # distutils: language = c++
16169 * # cython: c_string_encoding = default
16170 */
16171 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
16172 __Pyx_GOTREF(__pyx_t_1);
16173 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
16174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16175
16176 /* "string.to_py":55
16177 *
16178 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
16179 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
16180 * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
16181 *
16182 */
16183
16184 /*--- Wrapped vars code ---*/
16185
16186 goto __pyx_L0;
16187 __pyx_L1_error:;
16188 __Pyx_XDECREF(__pyx_t_1);
16189 __Pyx_XDECREF(__pyx_t_2);
16190 __Pyx_XDECREF(__pyx_t_3);
16191 __Pyx_XDECREF(__pyx_t_4);
16192 if (__pyx_m) {
16193 if (__pyx_d) {
16194 __Pyx_AddTraceback("init pymusic", __pyx_clineno, __pyx_lineno, __pyx_filename);
16195 }
16196 Py_CLEAR(__pyx_m);
16197 } else if (!PyErr_Occurred()) {
16198 PyErr_SetString(PyExc_ImportError, "init pymusic");
16199 }
16200 __pyx_L0:;
16201 __Pyx_RefNannyFinishContext();
16202 #if CYTHON_PEP489_MULTI_PHASE_INIT
16203 return (__pyx_m != NULL) ? 0 : -1;
16204 #elif PY_MAJOR_VERSION >= 3
16205 return __pyx_m;
16206 #else
16207 return;
16208 #endif
16209 }
16210
16211 /* --- Runtime support code --- */
16212 /* Refnanny */
16213 #if CYTHON_REFNANNY
16214 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
16215 PyObject *m = NULL, *p = NULL;
16216 void *r = NULL;
16217 m = PyImport_ImportModule(modname);
16218 if (!m) goto end;
16219 p = PyObject_GetAttrString(m, "RefNannyAPI");
16220 if (!p) goto end;
16221 r = PyLong_AsVoidPtr(p);
16222 end:
16223 Py_XDECREF(p);
16224 Py_XDECREF(m);
16225 return (__Pyx_RefNannyAPIStruct *)r;
16226 }
16227 #endif
16228
16229 /* PyObjectGetAttrStr */
16230 #if CYTHON_USE_TYPE_SLOTS
16231 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
16232 PyTypeObject* tp = Py_TYPE(obj);
16233 if (likely(tp->tp_getattro))
16234 return tp->tp_getattro(obj, attr_name);
16235 #if PY_MAJOR_VERSION < 3
16236 if (likely(tp->tp_getattr))
16237 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
16238 #endif
16239 return PyObject_GetAttr(obj, attr_name);
16240 }
16241 #endif
16242
16243 /* GetBuiltinName */
16244 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
16245 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
16246 if (unlikely(!result)) {
16247 PyErr_Format(PyExc_NameError,
16248 #if PY_MAJOR_VERSION >= 3
16249 "name '%U' is not defined", name);
16250 #else
16251 "name '%.200s' is not defined", PyString_AS_STRING(name));
16252 #endif
16253 }
16254 return result;
16255 }
16256
16257 /* PyDictVersioning */
16258 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
16259 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
16260 PyObject *dict = Py_TYPE(obj)->tp_dict;
16261 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
16262 }
16263 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
16264 PyObject **dictptr = NULL;
16265 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
16266 if (offset) {
16267 #if CYTHON_COMPILING_IN_CPYTHON
16268 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
16269 #else
16270 dictptr = _PyObject_GetDictPtr(obj);
16271 #endif
16272 }
16273 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
16274 }
16275 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
16276 PyObject *dict = Py_TYPE(obj)->tp_dict;
16277 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
16278 return 0;
16279 return obj_dict_version == __Pyx_get_object_dict_version(obj);
16280 }
16281 #endif
16282
16283 /* GetModuleGlobalName */
16284 #if CYTHON_USE_DICT_VERSIONS
16285 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
16286 #else
16287 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
16288 #endif
16289 {
16290 PyObject *result;
16291 #if !CYTHON_AVOID_BORROWED_REFS
16292 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
16293 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
16294 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
16295 if (likely(result)) {
16296 return __Pyx_NewRef(result);
16297 } else if (unlikely(PyErr_Occurred())) {
16298 return NULL;
16299 }
16300 #else
16301 result = PyDict_GetItem(__pyx_d, name);
16302 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
16303 if (likely(result)) {
16304 return __Pyx_NewRef(result);
16305 }
16306 #endif
16307 #else
16308 result = PyObject_GetItem(__pyx_d, name);
16309 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
16310 if (likely(result)) {
16311 return __Pyx_NewRef(result);
16312 }
16313 PyErr_Clear();
16314 #endif
16315 return __Pyx_GetBuiltinName(name);
16316 }
16317
16318 /* PyFunctionFastCall */
16319 #if CYTHON_FAST_PYCALL
16320 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
16321 PyObject *globals) {
16322 PyFrameObject *f;
16323 PyThreadState *tstate = __Pyx_PyThreadState_Current;
16324 PyObject **fastlocals;
16325 Py_ssize_t i;
16326 PyObject *result;
16327 assert(globals != NULL);
16328 /* XXX Perhaps we should create a specialized
16329 PyFrame_New() that doesn't take locals, but does
16330 take builtins without sanity checking them.
16331 */
16332 assert(tstate != NULL);
16333 f = PyFrame_New(tstate, co, globals, NULL);
16334 if (f == NULL) {
16335 return NULL;
16336 }
16337 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
16338 for (i = 0; i < na; i++) {
16339 Py_INCREF(*args);
16340 fastlocals[i] = *args++;
16341 }
16342 result = PyEval_EvalFrameEx(f,0);
16343 ++tstate->recursion_depth;
16344 Py_DECREF(f);
16345 --tstate->recursion_depth;
16346 return result;
16347 }
16348 #if 1 || PY_VERSION_HEX < 0x030600B1
16349 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
16350 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
16351 PyObject *globals = PyFunction_GET_GLOBALS(func);
16352 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
16353 PyObject *closure;
16354 #if PY_MAJOR_VERSION >= 3
16355 PyObject *kwdefs;
16356 #endif
16357 PyObject *kwtuple, **k;
16358 PyObject **d;
16359 Py_ssize_t nd;
16360 Py_ssize_t nk;
16361 PyObject *result;
16362 assert(kwargs == NULL || PyDict_Check(kwargs));
16363 nk = kwargs ? PyDict_Size(kwargs) : 0;
16364 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
16365 return NULL;
16366 }
16367 if (
16368 #if PY_MAJOR_VERSION >= 3
16369 co->co_kwonlyargcount == 0 &&
16370 #endif
16371 likely(kwargs == NULL || nk == 0) &&
16372 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
16373 if (argdefs == NULL && co->co_argcount == nargs) {
16374 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
16375 goto done;
16376 }
16377 else if (nargs == 0 && argdefs != NULL
16378 && co->co_argcount == Py_SIZE(argdefs)) {
16379 /* function called with no arguments, but all parameters have
16380 a default value: use default values as arguments .*/
16381 args = &PyTuple_GET_ITEM(argdefs, 0);
16382 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
16383 goto done;
16384 }
16385 }
16386 if (kwargs != NULL) {
16387 Py_ssize_t pos, i;
16388 kwtuple = PyTuple_New(2 * nk);
16389 if (kwtuple == NULL) {
16390 result = NULL;
16391 goto done;
16392 }
16393 k = &PyTuple_GET_ITEM(kwtuple, 0);
16394 pos = i = 0;
16395 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
16396 Py_INCREF(k[i]);
16397 Py_INCREF(k[i+1]);
16398 i += 2;
16399 }
16400 nk = i / 2;
16401 }
16402 else {
16403 kwtuple = NULL;
16404 k = NULL;
16405 }
16406 closure = PyFunction_GET_CLOSURE(func);
16407 #if PY_MAJOR_VERSION >= 3
16408 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
16409 #endif
16410 if (argdefs != NULL) {
16411 d = &PyTuple_GET_ITEM(argdefs, 0);
16412 nd = Py_SIZE(argdefs);
16413 }
16414 else {
16415 d = NULL;
16416 nd = 0;
16417 }
16418 #if PY_MAJOR_VERSION >= 3
16419 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
16420 args, (int)nargs,
16421 k, (int)nk,
16422 d, (int)nd, kwdefs, closure);
16423 #else
16424 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
16425 args, (int)nargs,
16426 k, (int)nk,
16427 d, (int)nd, closure);
16428 #endif
16429 Py_XDECREF(kwtuple);
16430 done:
16431 Py_LeaveRecursiveCall();
16432 return result;
16433 }
16434 #endif
16435 #endif
16436
16437 /* PyCFunctionFastCall */
16438 #if CYTHON_FAST_PYCCALL
16439 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
16440 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
16441 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
16442 PyObject *self = PyCFunction_GET_SELF(func);
16443 int flags = PyCFunction_GET_FLAGS(func);
16444 assert(PyCFunction_Check(func));
16445 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
16446 assert(nargs >= 0);
16447 assert(nargs == 0 || args != NULL);
16448 /* _PyCFunction_FastCallDict() must not be called with an exception set,
16449 because it may clear it (directly or indirectly) and so the
16450 caller loses its exception */
16451 assert(!PyErr_Occurred());
16452 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
16453 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
16454 } else {
16455 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
16456 }
16457 }
16458 #endif
16459
16460 /* PyObjectCall */
16461 #if CYTHON_COMPILING_IN_CPYTHON
16462 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
16463 PyObject *result;
16464 ternaryfunc call = Py_TYPE(func)->tp_call;
16465 if (unlikely(!call))
16466 return PyObject_Call(func, arg, kw);
16467 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
16468 return NULL;
16469 result = (*call)(func, arg, kw);
16470 Py_LeaveRecursiveCall();
16471 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
16472 PyErr_SetString(
16473 PyExc_SystemError,
16474 "NULL result without error in PyObject_Call");
16475 }
16476 return result;
16477 }
16478 #endif
16479
16480 /* RaiseArgTupleInvalid */
16481 static void __Pyx_RaiseArgtupleInvalid(
16482 const char* func_name,
16483 int exact,
16484 Py_ssize_t num_min,
16485 Py_ssize_t num_max,
16486 Py_ssize_t num_found)
16487 {
16488 Py_ssize_t num_expected;
16489 const char *more_or_less;
16490 if (num_found < num_min) {
16491 num_expected = num_min;
16492 more_or_less = "at least";
16493 } else {
16494 num_expected = num_max;
16495 more_or_less = "at most";
16496 }
16497 if (exact) {
16498 more_or_less = "exactly";
16499 }
16500 PyErr_Format(PyExc_TypeError,
16501 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
16502 func_name, more_or_less, num_expected,
16503 (num_expected == 1) ? "" : "s", num_found);
16504 }
16505
16506 /* RaiseDoubleKeywords */
16507 static void __Pyx_RaiseDoubleKeywordsError(
16508 const char* func_name,
16509 PyObject* kw_name)
16510 {
16511 PyErr_Format(PyExc_TypeError,
16512 #if PY_MAJOR_VERSION >= 3
16513 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
16514 #else
16515 "%s() got multiple values for keyword argument '%s'", func_name,
16516 PyString_AsString(kw_name));
16517 #endif
16518 }
16519
16520 /* ParseKeywords */
16521 static int __Pyx_ParseOptionalKeywords(
16522 PyObject *kwds,
16523 PyObject **argnames[],
16524 PyObject *kwds2,
16525 PyObject *values[],
16526 Py_ssize_t num_pos_args,
16527 const char* function_name)
16528 {
16529 PyObject *key = 0, *value = 0;
16530 Py_ssize_t pos = 0;
16531 PyObject*** name;
16532 PyObject*** first_kw_arg = argnames + num_pos_args;
16533 while (PyDict_Next(kwds, &pos, &key, &value)) {
16534 name = first_kw_arg;
16535 while (*name && (**name != key)) name++;
16536 if (*name) {
16537 values[name-argnames] = value;
16538 continue;
16539 }
16540 name = first_kw_arg;
16541 #if PY_MAJOR_VERSION < 3
16542 if (likely(PyString_Check(key))) {
16543 while (*name) {
16544 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
16545 && _PyString_Eq(**name, key)) {
16546 values[name-argnames] = value;
16547 break;
16548 }
16549 name++;
16550 }
16551 if (*name) continue;
16552 else {
16553 PyObject*** argname = argnames;
16554 while (argname != first_kw_arg) {
16555 if ((**argname == key) || (
16556 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
16557 && _PyString_Eq(**argname, key))) {
16558 goto arg_passed_twice;
16559 }
16560 argname++;
16561 }
16562 }
16563 } else
16564 #endif
16565 if (likely(PyUnicode_Check(key))) {
16566 while (*name) {
16567 int cmp = (**name == key) ? 0 :
16568 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
16569 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
16570 #endif
16571 PyUnicode_Compare(**name, key);
16572 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
16573 if (cmp == 0) {
16574 values[name-argnames] = value;
16575 break;
16576 }
16577 name++;
16578 }
16579 if (*name) continue;
16580 else {
16581 PyObject*** argname = argnames;
16582 while (argname != first_kw_arg) {
16583 int cmp = (**argname == key) ? 0 :
16584 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
16585 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
16586 #endif
16587 PyUnicode_Compare(**argname, key);
16588 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
16589 if (cmp == 0) goto arg_passed_twice;
16590 argname++;
16591 }
16592 }
16593 } else
16594 goto invalid_keyword_type;
16595 if (kwds2) {
16596 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
16597 } else {
16598 goto invalid_keyword;
16599 }
16600 }
16601 return 0;
16602 arg_passed_twice:
16603 __Pyx_RaiseDoubleKeywordsError(function_name, key);
16604 goto bad;
16605 invalid_keyword_type:
16606 PyErr_Format(PyExc_TypeError,
16607 "%.200s() keywords must be strings", function_name);
16608 goto bad;
16609 invalid_keyword:
16610 PyErr_Format(PyExc_TypeError,
16611 #if PY_MAJOR_VERSION < 3
16612 "%.200s() got an unexpected keyword argument '%.200s'",
16613 function_name, PyString_AsString(key));
16614 #else
16615 "%s() got an unexpected keyword argument '%U'",
16616 function_name, key);
16617 #endif
16618 bad:
16619 return -1;
16620 }
16621
16622 /* PyObjectCall2Args */
16623 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
16624 PyObject *args, *result = NULL;
16625 #if CYTHON_FAST_PYCALL
16626 if (PyFunction_Check(function)) {
16627 PyObject *args[2] = {arg1, arg2};
16628 return __Pyx_PyFunction_FastCall(function, args, 2);
16629 }
16630 #endif
16631 #if CYTHON_FAST_PYCCALL
16632 if (__Pyx_PyFastCFunction_Check(function)) {
16633 PyObject *args[2] = {arg1, arg2};
16634 return __Pyx_PyCFunction_FastCall(function, args, 2);
16635 }
16636 #endif
16637 args = PyTuple_New(2);
16638 if (unlikely(!args)) goto done;
16639 Py_INCREF(arg1);
16640 PyTuple_SET_ITEM(args, 0, arg1);
16641 Py_INCREF(arg2);
16642 PyTuple_SET_ITEM(args, 1, arg2);
16643 Py_INCREF(function);
16644 result = __Pyx_PyObject_Call(function, args, NULL);
16645 Py_DECREF(args);
16646 Py_DECREF(function);
16647 done:
16648 return result;
16649 }
16650
16651 /* PyObjectCallMethO */
16652 #if CYTHON_COMPILING_IN_CPYTHON
16653 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
16654 PyObject *self, *result;
16655 PyCFunction cfunc;
16656 cfunc = PyCFunction_GET_FUNCTION(func);
16657 self = PyCFunction_GET_SELF(func);
16658 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
16659 return NULL;
16660 result = cfunc(self, arg);
16661 Py_LeaveRecursiveCall();
16662 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
16663 PyErr_SetString(
16664 PyExc_SystemError,
16665 "NULL result without error in PyObject_Call");
16666 }
16667 return result;
16668 }
16669 #endif
16670
16671 /* PyObjectCallOneArg */
16672 #if CYTHON_COMPILING_IN_CPYTHON
16673 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
16674 PyObject *result;
16675 PyObject *args = PyTuple_New(1);
16676 if (unlikely(!args)) return NULL;
16677 Py_INCREF(arg);
16678 PyTuple_SET_ITEM(args, 0, arg);
16679 result = __Pyx_PyObject_Call(func, args, NULL);
16680 Py_DECREF(args);
16681 return result;
16682 }
16683 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
16684 #if CYTHON_FAST_PYCALL
16685 if (PyFunction_Check(func)) {
16686 return __Pyx_PyFunction_FastCall(func, &arg, 1);
16687 }
16688 #endif
16689 if (likely(PyCFunction_Check(func))) {
16690 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
16691 return __Pyx_PyObject_CallMethO(func, arg);
16692 #if CYTHON_FAST_PYCCALL
16693 } else if (__Pyx_PyFastCFunction_Check(func)) {
16694 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
16695 #endif
16696 }
16697 }
16698 return __Pyx__PyObject_CallOneArg(func, arg);
16699 }
16700 #else
16701 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
16702 PyObject *result;
16703 PyObject *args = PyTuple_Pack(1, arg);
16704 if (unlikely(!args)) return NULL;
16705 result = __Pyx_PyObject_Call(func, args, NULL);
16706 Py_DECREF(args);
16707 return result;
16708 }
16709 #endif
16710
16711 /* PyErrFetchRestore */
16712 #if CYTHON_FAST_THREAD_STATE
16713 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
16714 PyObject *tmp_type, *tmp_value, *tmp_tb;
16715 tmp_type = tstate->curexc_type;
16716 tmp_value = tstate->curexc_value;
16717 tmp_tb = tstate->curexc_traceback;
16718 tstate->curexc_type = type;
16719 tstate->curexc_value = value;
16720 tstate->curexc_traceback = tb;
16721 Py_XDECREF(tmp_type);
16722 Py_XDECREF(tmp_value);
16723 Py_XDECREF(tmp_tb);
16724 }
16725 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
16726 *type = tstate->curexc_type;
16727 *value = tstate->curexc_value;
16728 *tb = tstate->curexc_traceback;
16729 tstate->curexc_type = 0;
16730 tstate->curexc_value = 0;
16731 tstate->curexc_traceback = 0;
16732 }
16733 #endif
16734
16735 /* RaiseException */
16736 #if PY_MAJOR_VERSION < 3
16737 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
16738 CYTHON_UNUSED PyObject *cause) {
16739 __Pyx_PyThreadState_declare
16740 Py_XINCREF(type);
16741 if (!value || value == Py_None)
16742 value = NULL;
16743 else
16744 Py_INCREF(value);
16745 if (!tb || tb == Py_None)
16746 tb = NULL;
16747 else {
16748 Py_INCREF(tb);
16749 if (!PyTraceBack_Check(tb)) {
16750 PyErr_SetString(PyExc_TypeError,
16751 "raise: arg 3 must be a traceback or None");
16752 goto raise_error;
16753 }
16754 }
16755 if (PyType_Check(type)) {
16756 #if CYTHON_COMPILING_IN_PYPY
16757 if (!value) {
16758 Py_INCREF(Py_None);
16759 value = Py_None;
16760 }
16761 #endif
16762 PyErr_NormalizeException(&type, &value, &tb);
16763 } else {
16764 if (value) {
16765 PyErr_SetString(PyExc_TypeError,
16766 "instance exception may not have a separate value");
16767 goto raise_error;
16768 }
16769 value = type;
16770 type = (PyObject*) Py_TYPE(type);
16771 Py_INCREF(type);
16772 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
16773 PyErr_SetString(PyExc_TypeError,
16774 "raise: exception class must be a subclass of BaseException");
16775 goto raise_error;
16776 }
16777 }
16778 __Pyx_PyThreadState_assign
16779 __Pyx_ErrRestore(type, value, tb);
16780 return;
16781 raise_error:
16782 Py_XDECREF(value);
16783 Py_XDECREF(type);
16784 Py_XDECREF(tb);
16785 return;
16786 }
16787 #else
16788 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
16789 PyObject* owned_instance = NULL;
16790 if (tb == Py_None) {
16791 tb = 0;
16792 } else if (tb && !PyTraceBack_Check(tb)) {
16793 PyErr_SetString(PyExc_TypeError,
16794 "raise: arg 3 must be a traceback or None");
16795 goto bad;
16796 }
16797 if (value == Py_None)
16798 value = 0;
16799 if (PyExceptionInstance_Check(type)) {
16800 if (value) {
16801 PyErr_SetString(PyExc_TypeError,
16802 "instance exception may not have a separate value");
16803 goto bad;
16804 }
16805 value = type;
16806 type = (PyObject*) Py_TYPE(value);
16807 } else if (PyExceptionClass_Check(type)) {
16808 PyObject *instance_class = NULL;
16809 if (value && PyExceptionInstance_Check(value)) {
16810 instance_class = (PyObject*) Py_TYPE(value);
16811 if (instance_class != type) {
16812 int is_subclass = PyObject_IsSubclass(instance_class, type);
16813 if (!is_subclass) {
16814 instance_class = NULL;
16815 } else if (unlikely(is_subclass == -1)) {
16816 goto bad;
16817 } else {
16818 type = instance_class;
16819 }
16820 }
16821 }
16822 if (!instance_class) {
16823 PyObject *args;
16824 if (!value)
16825 args = PyTuple_New(0);
16826 else if (PyTuple_Check(value)) {
16827 Py_INCREF(value);
16828 args = value;
16829 } else
16830 args = PyTuple_Pack(1, value);
16831 if (!args)
16832 goto bad;
16833 owned_instance = PyObject_Call(type, args, NULL);
16834 Py_DECREF(args);
16835 if (!owned_instance)
16836 goto bad;
16837 value = owned_instance;
16838 if (!PyExceptionInstance_Check(value)) {
16839 PyErr_Format(PyExc_TypeError,
16840 "calling %R should have returned an instance of "
16841 "BaseException, not %R",
16842 type, Py_TYPE(value));
16843 goto bad;
16844 }
16845 }
16846 } else {
16847 PyErr_SetString(PyExc_TypeError,
16848 "raise: exception class must be a subclass of BaseException");
16849 goto bad;
16850 }
16851 if (cause) {
16852 PyObject *fixed_cause;
16853 if (cause == Py_None) {
16854 fixed_cause = NULL;
16855 } else if (PyExceptionClass_Check(cause)) {
16856 fixed_cause = PyObject_CallObject(cause, NULL);
16857 if (fixed_cause == NULL)
16858 goto bad;
16859 } else if (PyExceptionInstance_Check(cause)) {
16860 fixed_cause = cause;
16861 Py_INCREF(fixed_cause);
16862 } else {
16863 PyErr_SetString(PyExc_TypeError,
16864 "exception causes must derive from "
16865 "BaseException");
16866 goto bad;
16867 }
16868 PyException_SetCause(value, fixed_cause);
16869 }
16870 PyErr_SetObject(type, value);
16871 if (tb) {
16872 #if CYTHON_COMPILING_IN_PYPY
16873 PyObject *tmp_type, *tmp_value, *tmp_tb;
16874 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
16875 Py_INCREF(tb);
16876 PyErr_Restore(tmp_type, tmp_value, tb);
16877 Py_XDECREF(tmp_tb);
16878 #else
16879 PyThreadState *tstate = __Pyx_PyThreadState_Current;
16880 PyObject* tmp_tb = tstate->curexc_traceback;
16881 if (tb != tmp_tb) {
16882 Py_INCREF(tb);
16883 tstate->curexc_traceback = tb;
16884 Py_XDECREF(tmp_tb);
16885 }
16886 #endif
16887 }
16888 bad:
16889 Py_XDECREF(owned_instance);
16890 return;
16891 }
16892 #endif
16893
16894 /* GetItemInt */
16895 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
16896 PyObject *r;
16897 if (!j) return NULL;
16898 r = PyObject_GetItem(o, j);
16899 Py_DECREF(j);
16900 return r;
16901 }
16902 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
16903 CYTHON_NCP_UNUSED int wraparound,
16904 CYTHON_NCP_UNUSED int boundscheck) {
16905 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16906 Py_ssize_t wrapped_i = i;
16907 if (wraparound & unlikely(i < 0)) {
16908 wrapped_i += PyList_GET_SIZE(o);
16909 }
16910 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
16911 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
16912 Py_INCREF(r);
16913 return r;
16914 }
16915 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
16916 #else
16917 return PySequence_GetItem(o, i);
16918 #endif
16919 }
16920 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
16921 CYTHON_NCP_UNUSED int wraparound,
16922 CYTHON_NCP_UNUSED int boundscheck) {
16923 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16924 Py_ssize_t wrapped_i = i;
16925 if (wraparound & unlikely(i < 0)) {
16926 wrapped_i += PyTuple_GET_SIZE(o);
16927 }
16928 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
16929 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
16930 Py_INCREF(r);
16931 return r;
16932 }
16933 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
16934 #else
16935 return PySequence_GetItem(o, i);
16936 #endif
16937 }
16938 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
16939 CYTHON_NCP_UNUSED int wraparound,
16940 CYTHON_NCP_UNUSED int boundscheck) {
16941 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
16942 if (is_list || PyList_CheckExact(o)) {
16943 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
16944 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
16945 PyObject *r = PyList_GET_ITEM(o, n);
16946 Py_INCREF(r);
16947 return r;
16948 }
16949 }
16950 else if (PyTuple_CheckExact(o)) {
16951 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
16952 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
16953 PyObject *r = PyTuple_GET_ITEM(o, n);
16954 Py_INCREF(r);
16955 return r;
16956 }
16957 } else {
16958 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
16959 if (likely(m && m->sq_item)) {
16960 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
16961 Py_ssize_t l = m->sq_length(o);
16962 if (likely(l >= 0)) {
16963 i += l;
16964 } else {
16965 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
16966 return NULL;
16967 PyErr_Clear();
16968 }
16969 }
16970 return m->sq_item(o, i);
16971 }
16972 }
16973 #else
16974 if (is_list || PySequence_Check(o)) {
16975 return PySequence_GetItem(o, i);
16976 }
16977 #endif
16978 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
16979 }
16980
16981 /* PyObjectCallNoArg */
16982 #if CYTHON_COMPILING_IN_CPYTHON
16983 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
16984 #if CYTHON_FAST_PYCALL
16985 if (PyFunction_Check(func)) {
16986 return __Pyx_PyFunction_FastCall(func, NULL, 0);
16987 }
16988 #endif
16989 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
16990 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
16991 #else
16992 if (likely(PyCFunction_Check(func)))
16993 #endif
16994 {
16995 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
16996 return __Pyx_PyObject_CallMethO(func, NULL);
16997 }
16998 }
16999 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
17000 }
17001 #endif
17002
17003 /* GetTopmostException */
17004 #if CYTHON_USE_EXC_INFO_STACK
17005 static _PyErr_StackItem *
17006 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
17007 {
17008 _PyErr_StackItem *exc_info = tstate->exc_info;
17009 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
17010 exc_info->previous_item != NULL)
17011 {
17012 exc_info = exc_info->previous_item;
17013 }
17014 return exc_info;
17015 }
17016 #endif
17017
17018 /* SaveResetException */
17019 #if CYTHON_FAST_THREAD_STATE
17020 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
17021 #if CYTHON_USE_EXC_INFO_STACK
17022 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
17023 *type = exc_info->exc_type;
17024 *value = exc_info->exc_value;
17025 *tb = exc_info->exc_traceback;
17026 #else
17027 *type = tstate->exc_type;
17028 *value = tstate->exc_value;
17029 *tb = tstate->exc_traceback;
17030 #endif
17031 Py_XINCREF(*type);
17032 Py_XINCREF(*value);
17033 Py_XINCREF(*tb);
17034 }
17035 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
17036 PyObject *tmp_type, *tmp_value, *tmp_tb;
17037 #if CYTHON_USE_EXC_INFO_STACK
17038 _PyErr_StackItem *exc_info = tstate->exc_info;
17039 tmp_type = exc_info->exc_type;
17040 tmp_value = exc_info->exc_value;
17041 tmp_tb = exc_info->exc_traceback;
17042 exc_info->exc_type = type;
17043 exc_info->exc_value = value;
17044 exc_info->exc_traceback = tb;
17045 #else
17046 tmp_type = tstate->exc_type;
17047 tmp_value = tstate->exc_value;
17048 tmp_tb = tstate->exc_traceback;
17049 tstate->exc_type = type;
17050 tstate->exc_value = value;
17051 tstate->exc_traceback = tb;
17052 #endif
17053 Py_XDECREF(tmp_type);
17054 Py_XDECREF(tmp_value);
17055 Py_XDECREF(tmp_tb);
17056 }
17057 #endif
17058
17059 /* GetException */
17060 #if CYTHON_FAST_THREAD_STATE
17061 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
17062 #else
17063 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
17064 #endif
17065 {
17066 PyObject *local_type, *local_value, *local_tb;
17067 #if CYTHON_FAST_THREAD_STATE
17068 PyObject *tmp_type, *tmp_value, *tmp_tb;
17069 local_type = tstate->curexc_type;
17070 local_value = tstate->curexc_value;
17071 local_tb = tstate->curexc_traceback;
17072 tstate->curexc_type = 0;
17073 tstate->curexc_value = 0;
17074 tstate->curexc_traceback = 0;
17075 #else
17076 PyErr_Fetch(&local_type, &local_value, &local_tb);
17077 #endif
17078 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
17079 #if CYTHON_FAST_THREAD_STATE
17080 if (unlikely(tstate->curexc_type))
17081 #else
17082 if (unlikely(PyErr_Occurred()))
17083 #endif
17084 goto bad;
17085 #if PY_MAJOR_VERSION >= 3
17086 if (local_tb) {
17087 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
17088 goto bad;
17089 }
17090 #endif
17091 Py_XINCREF(local_tb);
17092 Py_XINCREF(local_type);
17093 Py_XINCREF(local_value);
17094 *type = local_type;
17095 *value = local_value;
17096 *tb = local_tb;
17097 #if CYTHON_FAST_THREAD_STATE
17098 #if CYTHON_USE_EXC_INFO_STACK
17099 {
17100 _PyErr_StackItem *exc_info = tstate->exc_info;
17101 tmp_type = exc_info->exc_type;
17102 tmp_value = exc_info->exc_value;
17103 tmp_tb = exc_info->exc_traceback;
17104 exc_info->exc_type = local_type;
17105 exc_info->exc_value = local_value;
17106 exc_info->exc_traceback = local_tb;
17107 }
17108 #else
17109 tmp_type = tstate->exc_type;
17110 tmp_value = tstate->exc_value;
17111 tmp_tb = tstate->exc_traceback;
17112 tstate->exc_type = local_type;
17113 tstate->exc_value = local_value;
17114 tstate->exc_traceback = local_tb;
17115 #endif
17116 Py_XDECREF(tmp_type);
17117 Py_XDECREF(tmp_value);
17118 Py_XDECREF(tmp_tb);
17119 #else
17120 PyErr_SetExcInfo(local_type, local_value, local_tb);
17121 #endif
17122 return 0;
17123 bad:
17124 *type = 0;
17125 *value = 0;
17126 *tb = 0;
17127 Py_XDECREF(local_type);
17128 Py_XDECREF(local_value);
17129 Py_XDECREF(local_tb);
17130 return -1;
17131 }
17132
17133 /* WriteUnraisableException */
17134 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
17135 CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
17136 int full_traceback, CYTHON_UNUSED int nogil) {
17137 PyObject *old_exc, *old_val, *old_tb;
17138 PyObject *ctx;
17139 __Pyx_PyThreadState_declare
17140 #ifdef WITH_THREAD
17141 PyGILState_STATE state;
17142 if (nogil)
17143 state = PyGILState_Ensure();
17144 #ifdef _MSC_VER
17145 else state = (PyGILState_STATE)-1;
17146 #endif
17147 #endif
17148 __Pyx_PyThreadState_assign
17149 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
17150 if (full_traceback) {
17151 Py_XINCREF(old_exc);
17152 Py_XINCREF(old_val);
17153 Py_XINCREF(old_tb);
17154 __Pyx_ErrRestore(old_exc, old_val, old_tb);
17155 PyErr_PrintEx(1);
17156 }
17157 #if PY_MAJOR_VERSION < 3
17158 ctx = PyString_FromString(name);
17159 #else
17160 ctx = PyUnicode_FromString(name);
17161 #endif
17162 __Pyx_ErrRestore(old_exc, old_val, old_tb);
17163 if (!ctx) {
17164 PyErr_WriteUnraisable(Py_None);
17165 } else {
17166 PyErr_WriteUnraisable(ctx);
17167 Py_DECREF(ctx);
17168 }
17169 #ifdef WITH_THREAD
17170 if (nogil)
17171 PyGILState_Release(state);
17172 #endif
17173 }
17174
17175 /* ArgTypeTest */
17176 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
17177 {
17178 if (unlikely(!type)) {
17179 PyErr_SetString(PyExc_SystemError, "Missing type object");
17180 return 0;
17181 }
17182 else if (exact) {
17183 #if PY_MAJOR_VERSION == 2
17184 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
17185 #endif
17186 }
17187 else {
17188 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
17189 }
17190 PyErr_Format(PyExc_TypeError,
17191 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
17192 name, type->tp_name, Py_TYPE(obj)->tp_name);
17193 return 0;
17194 }
17195
17196 /* KeywordStringCheck */
17197 static int __Pyx_CheckKeywordStrings(
17198 PyObject *kwdict,
17199 const char* function_name,
17200 int kw_allowed)
17201 {
17202 PyObject* key = 0;
17203 Py_ssize_t pos = 0;
17204 #if CYTHON_COMPILING_IN_PYPY
17205 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
17206 goto invalid_keyword;
17207 return 1;
17208 #else
17209 while (PyDict_Next(kwdict, &pos, &key, 0)) {
17210 #if PY_MAJOR_VERSION < 3
17211 if (unlikely(!PyString_Check(key)))
17212 #endif
17213 if (unlikely(!PyUnicode_Check(key)))
17214 goto invalid_keyword_type;
17215 }
17216 if ((!kw_allowed) && unlikely(key))
17217 goto invalid_keyword;
17218 return 1;
17219 invalid_keyword_type:
17220 PyErr_Format(PyExc_TypeError,
17221 "%.200s() keywords must be strings", function_name);
17222 return 0;
17223 #endif
17224 invalid_keyword:
17225 PyErr_Format(PyExc_TypeError,
17226 #if PY_MAJOR_VERSION < 3
17227 "%.200s() got an unexpected keyword argument '%.200s'",
17228 function_name, PyString_AsString(key));
17229 #else
17230 "%s() got an unexpected keyword argument '%U'",
17231 function_name, key);
17232 #endif
17233 return 0;
17234 }
17235
17236 /* SwapException */
17237 #if CYTHON_FAST_THREAD_STATE
17238 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
17239 PyObject *tmp_type, *tmp_value, *tmp_tb;
17240 #if CYTHON_USE_EXC_INFO_STACK
17241 _PyErr_StackItem *exc_info = tstate->exc_info;
17242 tmp_type = exc_info->exc_type;
17243 tmp_value = exc_info->exc_value;
17244 tmp_tb = exc_info->exc_traceback;
17245 exc_info->exc_type = *type;
17246 exc_info->exc_value = *value;
17247 exc_info->exc_traceback = *tb;
17248 #else
17249 tmp_type = tstate->exc_type;
17250 tmp_value = tstate->exc_value;
17251 tmp_tb = tstate->exc_traceback;
17252 tstate->exc_type = *type;
17253 tstate->exc_value = *value;
17254 tstate->exc_traceback = *tb;
17255 #endif
17256 *type = tmp_type;
17257 *value = tmp_value;
17258 *tb = tmp_tb;
17259 }
17260 #else
17261 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
17262 PyObject *tmp_type, *tmp_value, *tmp_tb;
17263 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
17264 PyErr_SetExcInfo(*type, *value, *tb);
17265 *type = tmp_type;
17266 *value = tmp_value;
17267 *tb = tmp_tb;
17268 }
17269 #endif
17270
17271 /* IterFinish */
17272 static CYTHON_INLINE int __Pyx_IterFinish(void) {
17273 #if CYTHON_FAST_THREAD_STATE
17274 PyThreadState *tstate = __Pyx_PyThreadState_Current;
17275 PyObject* exc_type = tstate->curexc_type;
17276 if (unlikely(exc_type)) {
17277 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
17278 PyObject *exc_value, *exc_tb;
17279 exc_value = tstate->curexc_value;
17280 exc_tb = tstate->curexc_traceback;
17281 tstate->curexc_type = 0;
17282 tstate->curexc_value = 0;
17283 tstate->curexc_traceback = 0;
17284 Py_DECREF(exc_type);
17285 Py_XDECREF(exc_value);
17286 Py_XDECREF(exc_tb);
17287 return 0;
17288 } else {
17289 return -1;
17290 }
17291 }
17292 return 0;
17293 #else
17294 if (unlikely(PyErr_Occurred())) {
17295 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
17296 PyErr_Clear();
17297 return 0;
17298 } else {
17299 return -1;
17300 }
17301 }
17302 return 0;
17303 #endif
17304 }
17305
17306 /* set_iter */
17307 static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
17308 Py_ssize_t* p_orig_length, int* p_source_is_set) {
17309 #if CYTHON_COMPILING_IN_CPYTHON
17310 is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable));
17311 *p_source_is_set = is_set;
17312 if (likely(is_set)) {
17313 *p_orig_length = PySet_Size(iterable);
17314 Py_INCREF(iterable);
17315 return iterable;
17316 }
17317 #else
17318 (void)is_set;
17319 *p_source_is_set = 0;
17320 #endif
17321 *p_orig_length = 0;
17322 return PyObject_GetIter(iterable);
17323 }
17324 static CYTHON_INLINE int __Pyx_set_iter_next(
17325 PyObject* iter_obj, Py_ssize_t orig_length,
17326 Py_ssize_t* ppos, PyObject **value,
17327 int source_is_set) {
17328 if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) {
17329 *value = PyIter_Next(iter_obj);
17330 if (unlikely(!*value)) {
17331 return __Pyx_IterFinish();
17332 }
17333 (void)orig_length;
17334 (void)ppos;
17335 return 1;
17336 }
17337 #if CYTHON_COMPILING_IN_CPYTHON
17338 if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) {
17339 PyErr_SetString(
17340 PyExc_RuntimeError,
17341 "set changed size during iteration");
17342 return -1;
17343 }
17344 {
17345 Py_hash_t hash;
17346 int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
17347 assert (ret != -1);
17348 if (likely(ret)) {
17349 Py_INCREF(*value);
17350 return 1;
17351 }
17352 }
17353 #endif
17354 return 0;
17355 }
17356
17357 /* PyObjectSetAttrStr */
17358 #if CYTHON_USE_TYPE_SLOTS
17359 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
17360 PyTypeObject* tp = Py_TYPE(obj);
17361 if (likely(tp->tp_setattro))
17362 return tp->tp_setattro(obj, attr_name, value);
17363 #if PY_MAJOR_VERSION < 3
17364 if (likely(tp->tp_setattr))
17365 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
17366 #endif
17367 return PyObject_SetAttr(obj, attr_name, value);
17368 }
17369 #endif
17370
17371 /* ExtTypeTest */
17372 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
17373 if (unlikely(!type)) {
17374 PyErr_SetString(PyExc_SystemError, "Missing type object");
17375 return 0;
17376 }
17377 if (likely(__Pyx_TypeCheck(obj, type)))
17378 return 1;
17379 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
17380 Py_TYPE(obj)->tp_name, type->tp_name);
17381 return 0;
17382 }
17383
17384 /* PyErrExceptionMatches */
17385 #if CYTHON_FAST_THREAD_STATE
17386 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
17387 Py_ssize_t i, n;
17388 n = PyTuple_GET_SIZE(tuple);
17389 #if PY_MAJOR_VERSION >= 3
17390 for (i=0; i<n; i++) {
17391 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
17392 }
17393 #endif
17394 for (i=0; i<n; i++) {
17395 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
17396 }
17397 return 0;
17398 }
17399 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
17400 PyObject *exc_type = tstate->curexc_type;
17401 if (exc_type == err) return 1;
17402 if (unlikely(!exc_type)) return 0;
17403 if (unlikely(PyTuple_Check(err)))
17404 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
17405 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
17406 }
17407 #endif
17408
17409 /* DictGetItem */
17410 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
17411 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
17412 PyObject *value;
17413 value = PyDict_GetItemWithError(d, key);
17414 if (unlikely(!value)) {
17415 if (!PyErr_Occurred()) {
17416 if (unlikely(PyTuple_Check(key))) {
17417 PyObject* args = PyTuple_Pack(1, key);
17418 if (likely(args)) {
17419 PyErr_SetObject(PyExc_KeyError, args);
17420 Py_DECREF(args);
17421 }
17422 } else {
17423 PyErr_SetObject(PyExc_KeyError, key);
17424 }
17425 }
17426 return NULL;
17427 }
17428 Py_INCREF(value);
17429 return value;
17430 }
17431 #endif
17432
17433 /* CallNextTpTraverse */
17434 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
17435 PyTypeObject* type = Py_TYPE(obj);
17436 while (type && type->tp_traverse != current_tp_traverse)
17437 type = type->tp_base;
17438 while (type && type->tp_traverse == current_tp_traverse)
17439 type = type->tp_base;
17440 if (type && type->tp_traverse)
17441 return type->tp_traverse(obj, v, a);
17442 return 0;
17443 }
17444
17445 /* CallNextTpClear */
17446 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
17447 PyTypeObject* type = Py_TYPE(obj);
17448 while (type && type->tp_clear != current_tp_clear)
17449 type = type->tp_base;
17450 while (type && type->tp_clear == current_tp_clear)
17451 type = type->tp_base;
17452 if (type && type->tp_clear)
17453 type->tp_clear(obj);
17454 }
17455
17456 /* PyObject_GenericGetAttrNoDict */
17457 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
17458 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
17459 PyErr_Format(PyExc_AttributeError,
17460 #if PY_MAJOR_VERSION >= 3
17461 "'%.50s' object has no attribute '%U'",
17462 tp->tp_name, attr_name);
17463 #else
17464 "'%.50s' object has no attribute '%.400s'",
17465 tp->tp_name, PyString_AS_STRING(attr_name));
17466 #endif
17467 return NULL;
17468 }
17469 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
17470 PyObject *descr;
17471 PyTypeObject *tp = Py_TYPE(obj);
17472 if (unlikely(!PyString_Check(attr_name))) {
17473 return PyObject_GenericGetAttr(obj, attr_name);
17474 }
17475 assert(!tp->tp_dictoffset);
17476 descr = _PyType_Lookup(tp, attr_name);
17477 if (unlikely(!descr)) {
17478 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
17479 }
17480 Py_INCREF(descr);
17481 #if PY_MAJOR_VERSION < 3
17482 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
17483 #endif
17484 {
17485 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
17486 if (unlikely(f)) {
17487 PyObject *res = f(descr, obj, (PyObject *)tp);
17488 Py_DECREF(descr);
17489 return res;
17490 }
17491 }
17492 return descr;
17493 }
17494 #endif
17495
17496 /* PyObject_GenericGetAttr */
17497 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
17498 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
17499 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
17500 return PyObject_GenericGetAttr(obj, attr_name);
17501 }
17502 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
17503 }
17504 #endif
17505
17506 /* SetVTable */
17507 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
17508 #if PY_VERSION_HEX >= 0x02070000
17509 PyObject *ob = PyCapsule_New(vtable, 0, 0);
17510 #else
17511 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
17512 #endif
17513 if (!ob)
17514 goto bad;
17515 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
17516 goto bad;
17517 Py_DECREF(ob);
17518 return 0;
17519 bad:
17520 Py_XDECREF(ob);
17521 return -1;
17522 }
17523
17524 /* PyObjectGetAttrStrNoError */
17525 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
17526 __Pyx_PyThreadState_declare
17527 __Pyx_PyThreadState_assign
17528 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
17529 __Pyx_PyErr_Clear();
17530 }
17531 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
17532 PyObject *result;
17533 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
17534 PyTypeObject* tp = Py_TYPE(obj);
17535 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
17536 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
17537 }
17538 #endif
17539 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
17540 if (unlikely(!result)) {
17541 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
17542 }
17543 return result;
17544 }
17545
17546 /* SetupReduce */
17547 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
17548 int ret;
17549 PyObject *name_attr;
17550 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
17551 if (likely(name_attr)) {
17552 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
17553 } else {
17554 ret = -1;
17555 }
17556 if (unlikely(ret < 0)) {
17557 PyErr_Clear();
17558 ret = 0;
17559 }
17560 Py_XDECREF(name_attr);
17561 return ret;
17562 }
17563 static int __Pyx_setup_reduce(PyObject* type_obj) {
17564 int ret = 0;
17565 PyObject *object_reduce = NULL;
17566 PyObject *object_getstate = NULL;
17567 PyObject *object_reduce_ex = NULL;
17568 PyObject *reduce = NULL;
17569 PyObject *reduce_ex = NULL;
17570 PyObject *reduce_cython = NULL;
17571 PyObject *setstate = NULL;
17572 PyObject *setstate_cython = NULL;
17573 PyObject *getstate = NULL;
17574 #if CYTHON_USE_PYTYPE_LOOKUP
17575 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
17576 #else
17577 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
17578 if (!getstate && PyErr_Occurred()) {
17579 goto __PYX_BAD;
17580 }
17581 #endif
17582 if (getstate) {
17583 #if CYTHON_USE_PYTYPE_LOOKUP
17584 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
17585 #else
17586 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
17587 if (!object_getstate && PyErr_Occurred()) {
17588 goto __PYX_BAD;
17589 }
17590 #endif
17591 if (object_getstate != getstate) {
17592 goto __PYX_GOOD;
17593 }
17594 }
17595 #if CYTHON_USE_PYTYPE_LOOKUP
17596 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
17597 #else
17598 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
17599 #endif
17600 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
17601 if (reduce_ex == object_reduce_ex) {
17602 #if CYTHON_USE_PYTYPE_LOOKUP
17603 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
17604 #else
17605 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
17606 #endif
17607 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
17608 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
17609 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
17610 if (likely(reduce_cython)) {
17611 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
17612 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
17613 } else if (reduce == object_reduce || PyErr_Occurred()) {
17614 goto __PYX_BAD;
17615 }
17616 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
17617 if (!setstate) PyErr_Clear();
17618 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
17619 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
17620 if (likely(setstate_cython)) {
17621 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
17622 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
17623 } else if (!setstate || PyErr_Occurred()) {
17624 goto __PYX_BAD;
17625 }
17626 }
17627 PyType_Modified((PyTypeObject*)type_obj);
17628 }
17629 }
17630 goto __PYX_GOOD;
17631 __PYX_BAD:
17632 if (!PyErr_Occurred())
17633 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
17634 ret = -1;
17635 __PYX_GOOD:
17636 #if !CYTHON_USE_PYTYPE_LOOKUP
17637 Py_XDECREF(object_reduce);
17638 Py_XDECREF(object_reduce_ex);
17639 Py_XDECREF(object_getstate);
17640 Py_XDECREF(getstate);
17641 #endif
17642 Py_XDECREF(reduce);
17643 Py_XDECREF(reduce_ex);
17644 Py_XDECREF(reduce_cython);
17645 Py_XDECREF(setstate);
17646 Py_XDECREF(setstate_cython);
17647 return ret;
17648 }
17649
17650 /* TypeImport */
17651 #ifndef __PYX_HAVE_RT_ImportType
17652 #define __PYX_HAVE_RT_ImportType
17653 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
17654 size_t size, enum __Pyx_ImportType_CheckSize check_size)
17655 {
17656 PyObject *result = 0;
17657 char warning[200];
17658 Py_ssize_t basicsize;
17659 #ifdef Py_LIMITED_API
17660 PyObject *py_basicsize;
17661 #endif
17662 result = PyObject_GetAttrString(module, class_name);
17663 if (!result)
17664 goto bad;
17665 if (!PyType_Check(result)) {
17666 PyErr_Format(PyExc_TypeError,
17667 "%.200s.%.200s is not a type object",
17668 module_name, class_name);
17669 goto bad;
17670 }
17671 #ifndef Py_LIMITED_API
17672 basicsize = ((PyTypeObject *)result)->tp_basicsize;
17673 #else
17674 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
17675 if (!py_basicsize)
17676 goto bad;
17677 basicsize = PyLong_AsSsize_t(py_basicsize);
17678 Py_DECREF(py_basicsize);
17679 py_basicsize = 0;
17680 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
17681 goto bad;
17682 #endif
17683 if ((size_t)basicsize < size) {
17684 PyErr_Format(PyExc_ValueError,
17685 "%.200s.%.200s size changed, may indicate binary incompatibility. "
17686 "Expected %zd from C header, got %zd from PyObject",
17687 module_name, class_name, size, basicsize);
17688 goto bad;
17689 }
17690 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
17691 PyErr_Format(PyExc_ValueError,
17692 "%.200s.%.200s size changed, may indicate binary incompatibility. "
17693 "Expected %zd from C header, got %zd from PyObject",
17694 module_name, class_name, size, basicsize);
17695 goto bad;
17696 }
17697 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
17698 PyOS_snprintf(warning, sizeof(warning),
17699 "%s.%s size changed, may indicate binary incompatibility. "
17700 "Expected %zd from C header, got %zd from PyObject",
17701 module_name, class_name, size, basicsize);
17702 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
17703 }
17704 return (PyTypeObject *)result;
17705 bad:
17706 Py_XDECREF(result);
17707 return NULL;
17708 }
17709 #endif
17710
17711 /* Import */
17712 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
17713 PyObject *empty_list = 0;
17714 PyObject *module = 0;
17715 PyObject *global_dict = 0;
17716 PyObject *empty_dict = 0;
17717 PyObject *list;
17718 #if PY_MAJOR_VERSION < 3
17719 PyObject *py_import;
17720 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
17721 if (!py_import)
17722 goto bad;
17723 #endif
17724 if (from_list)
17725 list = from_list;
17726 else {
17727 empty_list = PyList_New(0);
17728 if (!empty_list)
17729 goto bad;
17730 list = empty_list;
17731 }
17732 global_dict = PyModule_GetDict(__pyx_m);
17733 if (!global_dict)
17734 goto bad;
17735 empty_dict = PyDict_New();
17736 if (!empty_dict)
17737 goto bad;
17738 {
17739 #if PY_MAJOR_VERSION >= 3
17740 if (level == -1) {
17741 if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
17742 module = PyImport_ImportModuleLevelObject(
17743 name, global_dict, empty_dict, list, 1);
17744 if (!module) {
17745 if (!PyErr_ExceptionMatches(PyExc_ImportError))
17746 goto bad;
17747 PyErr_Clear();
17748 }
17749 }
17750 level = 0;
17751 }
17752 #endif
17753 if (!module) {
17754 #if PY_MAJOR_VERSION < 3
17755 PyObject *py_level = PyInt_FromLong(level);
17756 if (!py_level)
17757 goto bad;
17758 module = PyObject_CallFunctionObjArgs(py_import,
17759 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
17760 Py_DECREF(py_level);
17761 #else
17762 module = PyImport_ImportModuleLevelObject(
17763 name, global_dict, empty_dict, list, level);
17764 #endif
17765 }
17766 }
17767 bad:
17768 #if PY_MAJOR_VERSION < 3
17769 Py_XDECREF(py_import);
17770 #endif
17771 Py_XDECREF(empty_list);
17772 Py_XDECREF(empty_dict);
17773 return module;
17774 }
17775
17776 /* ImportFrom */
17777 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
17778 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
17779 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
17780 PyErr_Format(PyExc_ImportError,
17781 #if PY_MAJOR_VERSION < 3
17782 "cannot import name %.230s", PyString_AS_STRING(name));
17783 #else
17784 "cannot import name %S", name);
17785 #endif
17786 }
17787 return value;
17788 }
17789
17790 /* CalculateMetaclass */
17791 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
17792 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
17793 for (i=0; i < nbases; i++) {
17794 PyTypeObject *tmptype;
17795 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
17796 tmptype = Py_TYPE(tmp);
17797 #if PY_MAJOR_VERSION < 3
17798 if (tmptype == &PyClass_Type)
17799 continue;
17800 #endif
17801 if (!metaclass) {
17802 metaclass = tmptype;
17803 continue;
17804 }
17805 if (PyType_IsSubtype(metaclass, tmptype))
17806 continue;
17807 if (PyType_IsSubtype(tmptype, metaclass)) {
17808 metaclass = tmptype;
17809 continue;
17810 }
17811 PyErr_SetString(PyExc_TypeError,
17812 "metaclass conflict: "
17813 "the metaclass of a derived class "
17814 "must be a (non-strict) subclass "
17815 "of the metaclasses of all its bases");
17816 return NULL;
17817 }
17818 if (!metaclass) {
17819 #if PY_MAJOR_VERSION < 3
17820 metaclass = &PyClass_Type;
17821 #else
17822 metaclass = &PyType_Type;
17823 #endif
17824 }
17825 Py_INCREF((PyObject*) metaclass);
17826 return (PyObject*) metaclass;
17827 }
17828
17829 /* Py3ClassCreate */
17830 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
17831 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
17832 PyObject *ns;
17833 if (metaclass) {
17834 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
17835 if (prep) {
17836 PyObject *pargs = PyTuple_Pack(2, name, bases);
17837 if (unlikely(!pargs)) {
17838 Py_DECREF(prep);
17839 return NULL;
17840 }
17841 ns = PyObject_Call(prep, pargs, mkw);
17842 Py_DECREF(prep);
17843 Py_DECREF(pargs);
17844 } else {
17845 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
17846 return NULL;
17847 PyErr_Clear();
17848 ns = PyDict_New();
17849 }
17850 } else {
17851 ns = PyDict_New();
17852 }
17853 if (unlikely(!ns))
17854 return NULL;
17855 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
17856 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
17857 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
17858 return ns;
17859 bad:
17860 Py_DECREF(ns);
17861 return NULL;
17862 }
17863 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
17864 PyObject *dict, PyObject *mkw,
17865 int calculate_metaclass, int allow_py2_metaclass) {
17866 PyObject *result, *margs;
17867 PyObject *owned_metaclass = NULL;
17868 if (allow_py2_metaclass) {
17869 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
17870 if (owned_metaclass) {
17871 metaclass = owned_metaclass;
17872 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
17873 PyErr_Clear();
17874 } else {
17875 return NULL;
17876 }
17877 }
17878 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
17879 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
17880 Py_XDECREF(owned_metaclass);
17881 if (unlikely(!metaclass))
17882 return NULL;
17883 owned_metaclass = metaclass;
17884 }
17885 margs = PyTuple_Pack(3, name, bases, dict);
17886 if (unlikely(!margs)) {
17887 result = NULL;
17888 } else {
17889 result = PyObject_Call(metaclass, margs, mkw);
17890 Py_DECREF(margs);
17891 }
17892 Py_XDECREF(owned_metaclass);
17893 return result;
17894 }
17895
17896 /* FetchCommonType */
17897 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
17898 PyObject* fake_module;
17899 PyTypeObject* cached_type = NULL;
17900 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
17901 if (!fake_module) return NULL;
17902 Py_INCREF(fake_module);
17903 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
17904 if (cached_type) {
17905 if (!PyType_Check((PyObject*)cached_type)) {
17906 PyErr_Format(PyExc_TypeError,
17907 "Shared Cython type %.200s is not a type object",
17908 type->tp_name);
17909 goto bad;
17910 }
17911 if (cached_type->tp_basicsize != type->tp_basicsize) {
17912 PyErr_Format(PyExc_TypeError,
17913 "Shared Cython type %.200s has the wrong size, try recompiling",
17914 type->tp_name);
17915 goto bad;
17916 }
17917 } else {
17918 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
17919 PyErr_Clear();
17920 if (PyType_Ready(type) < 0) goto bad;
17921 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
17922 goto bad;
17923 Py_INCREF(type);
17924 cached_type = type;
17925 }
17926 done:
17927 Py_DECREF(fake_module);
17928 return cached_type;
17929 bad:
17930 Py_XDECREF(cached_type);
17931 cached_type = NULL;
17932 goto done;
17933 }
17934
17935 /* CythonFunctionShared */
17936 #include <structmember.h>
17937 static PyObject *
17938 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
17939 {
17940 if (unlikely(op->func_doc == NULL)) {
17941 if (op->func.m_ml->ml_doc) {
17942 #if PY_MAJOR_VERSION >= 3
17943 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
17944 #else
17945 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
17946 #endif
17947 if (unlikely(op->func_doc == NULL))
17948 return NULL;
17949 } else {
17950 Py_INCREF(Py_None);
17951 return Py_None;
17952 }
17953 }
17954 Py_INCREF(op->func_doc);
17955 return op->func_doc;
17956 }
17957 static int
17958 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
17959 {
17960 PyObject *tmp = op->func_doc;
17961 if (value == NULL) {
17962 value = Py_None;
17963 }
17964 Py_INCREF(value);
17965 op->func_doc = value;
17966 Py_XDECREF(tmp);
17967 return 0;
17968 }
17969 static PyObject *
17970 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
17971 {
17972 if (unlikely(op->func_name == NULL)) {
17973 #if PY_MAJOR_VERSION >= 3
17974 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
17975 #else
17976 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
17977 #endif
17978 if (unlikely(op->func_name == NULL))
17979 return NULL;
17980 }
17981 Py_INCREF(op->func_name);
17982 return op->func_name;
17983 }
17984 static int
17985 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
17986 {
17987 PyObject *tmp;
17988 #if PY_MAJOR_VERSION >= 3
17989 if (unlikely(value == NULL || !PyUnicode_Check(value)))
17990 #else
17991 if (unlikely(value == NULL || !PyString_Check(value)))
17992 #endif
17993 {
17994 PyErr_SetString(PyExc_TypeError,
17995 "__name__ must be set to a string object");
17996 return -1;
17997 }
17998 tmp = op->func_name;
17999 Py_INCREF(value);
18000 op->func_name = value;
18001 Py_XDECREF(tmp);
18002 return 0;
18003 }
18004 static PyObject *
18005 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
18006 {
18007 Py_INCREF(op->func_qualname);
18008 return op->func_qualname;
18009 }
18010 static int
18011 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
18012 {
18013 PyObject *tmp;
18014 #if PY_MAJOR_VERSION >= 3
18015 if (unlikely(value == NULL || !PyUnicode_Check(value)))
18016 #else
18017 if (unlikely(value == NULL || !PyString_Check(value)))
18018 #endif
18019 {
18020 PyErr_SetString(PyExc_TypeError,
18021 "__qualname__ must be set to a string object");
18022 return -1;
18023 }
18024 tmp = op->func_qualname;
18025 Py_INCREF(value);
18026 op->func_qualname = value;
18027 Py_XDECREF(tmp);
18028 return 0;
18029 }
18030 static PyObject *
18031 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
18032 {
18033 PyObject *self;
18034 self = m->func_closure;
18035 if (self == NULL)
18036 self = Py_None;
18037 Py_INCREF(self);
18038 return self;
18039 }
18040 static PyObject *
18041 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
18042 {
18043 if (unlikely(op->func_dict == NULL)) {
18044 op->func_dict = PyDict_New();
18045 if (unlikely(op->func_dict == NULL))
18046 return NULL;
18047 }
18048 Py_INCREF(op->func_dict);
18049 return op->func_dict;
18050 }
18051 static int
18052 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
18053 {
18054 PyObject *tmp;
18055 if (unlikely(value == NULL)) {
18056 PyErr_SetString(PyExc_TypeError,
18057 "function's dictionary may not be deleted");
18058 return -1;
18059 }
18060 if (unlikely(!PyDict_Check(value))) {
18061 PyErr_SetString(PyExc_TypeError,
18062 "setting function's dictionary to a non-dict");
18063 return -1;
18064 }
18065 tmp = op->func_dict;
18066 Py_INCREF(value);
18067 op->func_dict = value;
18068 Py_XDECREF(tmp);
18069 return 0;
18070 }
18071 static PyObject *
18072 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
18073 {
18074 Py_INCREF(op->func_globals);
18075 return op->func_globals;
18076 }
18077 static PyObject *
18078 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
18079 {
18080 Py_INCREF(Py_None);
18081 return Py_None;
18082 }
18083 static PyObject *
18084 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
18085 {
18086 PyObject* result = (op->func_code) ? op->func_code : Py_None;
18087 Py_INCREF(result);
18088 return result;
18089 }
18090 static int
18091 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
18092 int result = 0;
18093 PyObject *res = op->defaults_getter((PyObject *) op);
18094 if (unlikely(!res))
18095 return -1;
18096 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18097 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
18098 Py_INCREF(op->defaults_tuple);
18099 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
18100 Py_INCREF(op->defaults_kwdict);
18101 #else
18102 op->defaults_tuple = PySequence_ITEM(res, 0);
18103 if (unlikely(!op->defaults_tuple)) result = -1;
18104 else {
18105 op->defaults_kwdict = PySequence_ITEM(res, 1);
18106 if (unlikely(!op->defaults_kwdict)) result = -1;
18107 }
18108 #endif
18109 Py_DECREF(res);
18110 return result;
18111 }
18112 static int
18113 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
18114 PyObject* tmp;
18115 if (!value) {
18116 value = Py_None;
18117 } else if (value != Py_None && !PyTuple_Check(value)) {
18118 PyErr_SetString(PyExc_TypeError,
18119 "__defaults__ must be set to a tuple object");
18120 return -1;
18121 }
18122 Py_INCREF(value);
18123 tmp = op->defaults_tuple;
18124 op->defaults_tuple = value;
18125 Py_XDECREF(tmp);
18126 return 0;
18127 }
18128 static PyObject *
18129 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
18130 PyObject* result = op->defaults_tuple;
18131 if (unlikely(!result)) {
18132 if (op->defaults_getter) {
18133 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
18134 result = op->defaults_tuple;
18135 } else {
18136 result = Py_None;
18137 }
18138 }
18139 Py_INCREF(result);
18140 return result;
18141 }
18142 static int
18143 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
18144 PyObject* tmp;
18145 if (!value) {
18146 value = Py_None;
18147 } else if (value != Py_None && !PyDict_Check(value)) {
18148 PyErr_SetString(PyExc_TypeError,
18149 "__kwdefaults__ must be set to a dict object");
18150 return -1;
18151 }
18152 Py_INCREF(value);
18153 tmp = op->defaults_kwdict;
18154 op->defaults_kwdict = value;
18155 Py_XDECREF(tmp);
18156 return 0;
18157 }
18158 static PyObject *
18159 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
18160 PyObject* result = op->defaults_kwdict;
18161 if (unlikely(!result)) {
18162 if (op->defaults_getter) {
18163 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
18164 result = op->defaults_kwdict;
18165 } else {
18166 result = Py_None;
18167 }
18168 }
18169 Py_INCREF(result);
18170 return result;
18171 }
18172 static int
18173 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
18174 PyObject* tmp;
18175 if (!value || value == Py_None) {
18176 value = NULL;
18177 } else if (!PyDict_Check(value)) {
18178 PyErr_SetString(PyExc_TypeError,
18179 "__annotations__ must be set to a dict object");
18180 return -1;
18181 }
18182 Py_XINCREF(value);
18183 tmp = op->func_annotations;
18184 op->func_annotations = value;
18185 Py_XDECREF(tmp);
18186 return 0;
18187 }
18188 static PyObject *
18189 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
18190 PyObject* result = op->func_annotations;
18191 if (unlikely(!result)) {
18192 result = PyDict_New();
18193 if (unlikely(!result)) return NULL;
18194 op->func_annotations = result;
18195 }
18196 Py_INCREF(result);
18197 return result;
18198 }
18199 static PyGetSetDef __pyx_CyFunction_getsets[] = {
18200 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
18201 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
18202 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
18203 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
18204 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
18205 {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
18206 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
18207 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
18208 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
18209 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
18210 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
18211 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
18212 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
18213 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
18214 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
18215 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
18216 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
18217 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
18218 {0, 0, 0, 0, 0}
18219 };
18220 static PyMemberDef __pyx_CyFunction_members[] = {
18221 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
18222 {0, 0, 0, 0, 0}
18223 };
18224 static PyObject *
18225 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
18226 {
18227 #if PY_MAJOR_VERSION >= 3
18228 Py_INCREF(m->func_qualname);
18229 return m->func_qualname;
18230 #else
18231 return PyString_FromString(m->func.m_ml->ml_name);
18232 #endif
18233 }
18234 static PyMethodDef __pyx_CyFunction_methods[] = {
18235 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
18236 {0, 0, 0, 0}
18237 };
18238 #if PY_VERSION_HEX < 0x030500A0
18239 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
18240 #else
18241 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
18242 #endif
18243 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
18244 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
18245 if (unlikely(op == NULL))
18246 return NULL;
18247 op->flags = flags;
18248 __Pyx_CyFunction_weakreflist(op) = NULL;
18249 op->func.m_ml = ml;
18250 op->func.m_self = (PyObject *) op;
18251 Py_XINCREF(closure);
18252 op->func_closure = closure;
18253 Py_XINCREF(module);
18254 op->func.m_module = module;
18255 op->func_dict = NULL;
18256 op->func_name = NULL;
18257 Py_INCREF(qualname);
18258 op->func_qualname = qualname;
18259 op->func_doc = NULL;
18260 op->func_classobj = NULL;
18261 op->func_globals = globals;
18262 Py_INCREF(op->func_globals);
18263 Py_XINCREF(code);
18264 op->func_code = code;
18265 op->defaults_pyobjects = 0;
18266 op->defaults_size = 0;
18267 op->defaults = NULL;
18268 op->defaults_tuple = NULL;
18269 op->defaults_kwdict = NULL;
18270 op->defaults_getter = NULL;
18271 op->func_annotations = NULL;
18272 return (PyObject *) op;
18273 }
18274 static int
18275 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
18276 {
18277 Py_CLEAR(m->func_closure);
18278 Py_CLEAR(m->func.m_module);
18279 Py_CLEAR(m->func_dict);
18280 Py_CLEAR(m->func_name);
18281 Py_CLEAR(m->func_qualname);
18282 Py_CLEAR(m->func_doc);
18283 Py_CLEAR(m->func_globals);
18284 Py_CLEAR(m->func_code);
18285 Py_CLEAR(m->func_classobj);
18286 Py_CLEAR(m->defaults_tuple);
18287 Py_CLEAR(m->defaults_kwdict);
18288 Py_CLEAR(m->func_annotations);
18289 if (m->defaults) {
18290 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
18291 int i;
18292 for (i = 0; i < m->defaults_pyobjects; i++)
18293 Py_XDECREF(pydefaults[i]);
18294 PyObject_Free(m->defaults);
18295 m->defaults = NULL;
18296 }
18297 return 0;
18298 }
18299 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
18300 {
18301 if (__Pyx_CyFunction_weakreflist(m) != NULL)
18302 PyObject_ClearWeakRefs((PyObject *) m);
18303 __Pyx_CyFunction_clear(m);
18304 PyObject_GC_Del(m);
18305 }
18306 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
18307 {
18308 PyObject_GC_UnTrack(m);
18309 __Pyx__CyFunction_dealloc(m);
18310 }
18311 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
18312 {
18313 Py_VISIT(m->func_closure);
18314 Py_VISIT(m->func.m_module);
18315 Py_VISIT(m->func_dict);
18316 Py_VISIT(m->func_name);
18317 Py_VISIT(m->func_qualname);
18318 Py_VISIT(m->func_doc);
18319 Py_VISIT(m->func_globals);
18320 Py_VISIT(m->func_code);
18321 Py_VISIT(m->func_classobj);
18322 Py_VISIT(m->defaults_tuple);
18323 Py_VISIT(m->defaults_kwdict);
18324 if (m->defaults) {
18325 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
18326 int i;
18327 for (i = 0; i < m->defaults_pyobjects; i++)
18328 Py_VISIT(pydefaults[i]);
18329 }
18330 return 0;
18331 }
18332 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
18333 {
18334 #if PY_MAJOR_VERSION < 3
18335 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
18336 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
18337 Py_INCREF(func);
18338 return func;
18339 }
18340 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
18341 if (type == NULL)
18342 type = (PyObject *)(Py_TYPE(obj));
18343 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
18344 }
18345 if (obj == Py_None)
18346 obj = NULL;
18347 #endif
18348 return __Pyx_PyMethod_New(func, obj, type);
18349 }
18350 static PyObject*
18351 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
18352 {
18353 #if PY_MAJOR_VERSION >= 3
18354 return PyUnicode_FromFormat("<cyfunction %U at %p>",
18355 op->func_qualname, (void *)op);
18356 #else
18357 return PyString_FromFormat("<cyfunction %s at %p>",
18358 PyString_AsString(op->func_qualname), (void *)op);
18359 #endif
18360 }
18361 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
18362 PyCFunctionObject* f = (PyCFunctionObject*)func;
18363 PyCFunction meth = f->m_ml->ml_meth;
18364 Py_ssize_t size;
18365 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
18366 case METH_VARARGS:
18367 if (likely(kw == NULL || PyDict_Size(kw) == 0))
18368 return (*meth)(self, arg);
18369 break;
18370 case METH_VARARGS | METH_KEYWORDS:
18371 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
18372 case METH_NOARGS:
18373 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
18374 size = PyTuple_GET_SIZE(arg);
18375 if (likely(size == 0))
18376 return (*meth)(self, NULL);
18377 PyErr_Format(PyExc_TypeError,
18378 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
18379 f->m_ml->ml_name, size);
18380 return NULL;
18381 }
18382 break;
18383 case METH_O:
18384 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
18385 size = PyTuple_GET_SIZE(arg);
18386 if (likely(size == 1)) {
18387 PyObject *result, *arg0;
18388 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18389 arg0 = PyTuple_GET_ITEM(arg, 0);
18390 #else
18391 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
18392 #endif
18393 result = (*meth)(self, arg0);
18394 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
18395 Py_DECREF(arg0);
18396 #endif
18397 return result;
18398 }
18399 PyErr_Format(PyExc_TypeError,
18400 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
18401 f->m_ml->ml_name, size);
18402 return NULL;
18403 }
18404 break;
18405 default:
18406 PyErr_SetString(PyExc_SystemError, "Bad call flags in "
18407 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
18408 "longer supported!");
18409 return NULL;
18410 }
18411 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
18412 f->m_ml->ml_name);
18413 return NULL;
18414 }
18415 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
18416 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
18417 }
18418 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
18419 PyObject *result;
18420 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
18421 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
18422 Py_ssize_t argc;
18423 PyObject *new_args;
18424 PyObject *self;
18425 argc = PyTuple_GET_SIZE(args);
18426 new_args = PyTuple_GetSlice(args, 1, argc);
18427 if (unlikely(!new_args))
18428 return NULL;
18429 self = PyTuple_GetItem(args, 0);
18430 if (unlikely(!self)) {
18431 Py_DECREF(new_args);
18432 PyErr_Format(PyExc_TypeError,
18433 "unbound method %.200S() needs an argument",
18434 cyfunc->func_qualname);
18435 return NULL;
18436 }
18437 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
18438 Py_DECREF(new_args);
18439 } else {
18440 result = __Pyx_CyFunction_Call(func, args, kw);
18441 }
18442 return result;
18443 }
18444 static PyTypeObject __pyx_CyFunctionType_type = {
18445 PyVarObject_HEAD_INIT(0, 0)
18446 "cython_function_or_method",
18447 sizeof(__pyx_CyFunctionObject),
18448 0,
18449 (destructor) __Pyx_CyFunction_dealloc,
18450 0,
18451 0,
18452 0,
18453 #if PY_MAJOR_VERSION < 3
18454 0,
18455 #else
18456 0,
18457 #endif
18458 (reprfunc) __Pyx_CyFunction_repr,
18459 0,
18460 0,
18461 0,
18462 0,
18463 __Pyx_CyFunction_CallAsMethod,
18464 0,
18465 0,
18466 0,
18467 0,
18468 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
18469 0,
18470 (traverseproc) __Pyx_CyFunction_traverse,
18471 (inquiry) __Pyx_CyFunction_clear,
18472 0,
18473 #if PY_VERSION_HEX < 0x030500A0
18474 offsetof(__pyx_CyFunctionObject, func_weakreflist),
18475 #else
18476 offsetof(PyCFunctionObject, m_weakreflist),
18477 #endif
18478 0,
18479 0,
18480 __pyx_CyFunction_methods,
18481 __pyx_CyFunction_members,
18482 __pyx_CyFunction_getsets,
18483 0,
18484 0,
18485 __Pyx_CyFunction_descr_get,
18486 0,
18487 offsetof(__pyx_CyFunctionObject, func_dict),
18488 0,
18489 0,
18490 0,
18491 0,
18492 0,
18493 0,
18494 0,
18495 0,
18496 0,
18497 0,
18498 0,
18499 0,
18500 #if PY_VERSION_HEX >= 0x030400a1
18501 0,
18502 #endif
18503 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
18504 0,
18505 #endif
18506 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
18507 0,
18508 #endif
18509 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
18510 0,
18511 #endif
18512 };
18513 static int __pyx_CyFunction_init(void) {
18514 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
18515 if (unlikely(__pyx_CyFunctionType == NULL)) {
18516 return -1;
18517 }
18518 return 0;
18519 }
18520 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
18521 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
18522 m->defaults = PyObject_Malloc(size);
18523 if (unlikely(!m->defaults))
18524 return PyErr_NoMemory();
18525 memset(m->defaults, 0, size);
18526 m->defaults_pyobjects = pyobjects;
18527 m->defaults_size = size;
18528 return m->defaults;
18529 }
18530 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
18531 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
18532 m->defaults_tuple = tuple;
18533 Py_INCREF(tuple);
18534 }
18535 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
18536 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
18537 m->defaults_kwdict = dict;
18538 Py_INCREF(dict);
18539 }
18540 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
18541 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
18542 m->func_annotations = dict;
18543 Py_INCREF(dict);
18544 }
18545
18546 /* CythonFunction */
18547 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
18548 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
18549 PyObject *op = __Pyx_CyFunction_Init(
18550 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
18551 ml, flags, qualname, closure, module, globals, code
18552 );
18553 if (likely(op)) {
18554 PyObject_GC_Track(op);
18555 }
18556 return op;
18557 }
18558
18559 /* CLineInTraceback */
18560 #ifndef CYTHON_CLINE_IN_TRACEBACK
18561 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
18562 PyObject *use_cline;
18563 PyObject *ptype, *pvalue, *ptraceback;
18564 #if CYTHON_COMPILING_IN_CPYTHON
18565 PyObject **cython_runtime_dict;
18566 #endif
18567 if (unlikely(!__pyx_cython_runtime)) {
18568 return c_line;
18569 }
18570 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
18571 #if CYTHON_COMPILING_IN_CPYTHON
18572 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
18573 if (likely(cython_runtime_dict)) {
18574 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
18575 use_cline, *cython_runtime_dict,
18576 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
18577 } else
18578 #endif
18579 {
18580 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
18581 if (use_cline_obj) {
18582 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
18583 Py_DECREF(use_cline_obj);
18584 } else {
18585 PyErr_Clear();
18586 use_cline = NULL;
18587 }
18588 }
18589 if (!use_cline) {
18590 c_line = 0;
18591 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
18592 }
18593 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
18594 c_line = 0;
18595 }
18596 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
18597 return c_line;
18598 }
18599 #endif
18600
18601 /* CodeObjectCache */
18602 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
18603 int start = 0, mid = 0, end = count - 1;
18604 if (end >= 0 && code_line > entries[end].code_line) {
18605 return count;
18606 }
18607 while (start < end) {
18608 mid = start + (end - start) / 2;
18609 if (code_line < entries[mid].code_line) {
18610 end = mid;
18611 } else if (code_line > entries[mid].code_line) {
18612 start = mid + 1;
18613 } else {
18614 return mid;
18615 }
18616 }
18617 if (code_line <= entries[mid].code_line) {
18618 return mid;
18619 } else {
18620 return mid + 1;
18621 }
18622 }
18623 static PyCodeObject *__pyx_find_code_object(int code_line) {
18624 PyCodeObject* code_object;
18625 int pos;
18626 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
18627 return NULL;
18628 }
18629 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
18630 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
18631 return NULL;
18632 }
18633 code_object = __pyx_code_cache.entries[pos].code_object;
18634 Py_INCREF(code_object);
18635 return code_object;
18636 }
18637 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
18638 int pos, i;
18639 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
18640 if (unlikely(!code_line)) {
18641 return;
18642 }
18643 if (unlikely(!entries)) {
18644 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
18645 if (likely(entries)) {
18646 __pyx_code_cache.entries = entries;
18647 __pyx_code_cache.max_count = 64;
18648 __pyx_code_cache.count = 1;
18649 entries[0].code_line = code_line;
18650 entries[0].code_object = code_object;
18651 Py_INCREF(code_object);
18652 }
18653 return;
18654 }
18655 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
18656 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
18657 PyCodeObject* tmp = entries[pos].code_object;
18658 entries[pos].code_object = code_object;
18659 Py_DECREF(tmp);
18660 return;
18661 }
18662 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
18663 int new_max = __pyx_code_cache.max_count + 64;
18664 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
18665 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
18666 if (unlikely(!entries)) {
18667 return;
18668 }
18669 __pyx_code_cache.entries = entries;
18670 __pyx_code_cache.max_count = new_max;
18671 }
18672 for (i=__pyx_code_cache.count; i>pos; i--) {
18673 entries[i] = entries[i-1];
18674 }
18675 entries[pos].code_line = code_line;
18676 entries[pos].code_object = code_object;
18677 __pyx_code_cache.count++;
18678 Py_INCREF(code_object);
18679 }
18680
18681 /* AddTraceback */
18682 #include "compile.h"
18683 #include "frameobject.h"
18684 #include "traceback.h"
18685 #if PY_VERSION_HEX >= 0x030b00a6
18686 #ifndef Py_BUILD_CORE
18687 #define Py_BUILD_CORE 1
18688 #endif
18689 #include "internal/pycore_frame.h"
18690 #endif
18691 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
18692 const char *funcname, int c_line,
18693 int py_line, const char *filename) {
18694 PyCodeObject *py_code = NULL;
18695 PyObject *py_funcname = NULL;
18696 #if PY_MAJOR_VERSION < 3
18697 PyObject *py_srcfile = NULL;
18698 py_srcfile = PyString_FromString(filename);
18699 if (!py_srcfile) goto bad;
18700 #endif
18701 if (c_line) {
18702 #if PY_MAJOR_VERSION < 3
18703 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
18704 if (!py_funcname) goto bad;
18705 #else
18706 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
18707 if (!py_funcname) goto bad;
18708 funcname = PyUnicode_AsUTF8(py_funcname);
18709 if (!funcname) goto bad;
18710 #endif
18711 }
18712 else {
18713 #if PY_MAJOR_VERSION < 3
18714 py_funcname = PyString_FromString(funcname);
18715 if (!py_funcname) goto bad;
18716 #endif
18717 }
18718 #if PY_MAJOR_VERSION < 3
18719 py_code = __Pyx_PyCode_New(
18720 0,
18721 0,
18722 0,
18723 0,
18724 0,
18725 __pyx_empty_bytes, /*PyObject *code,*/
18726 __pyx_empty_tuple, /*PyObject *consts,*/
18727 __pyx_empty_tuple, /*PyObject *names,*/
18728 __pyx_empty_tuple, /*PyObject *varnames,*/
18729 __pyx_empty_tuple, /*PyObject *freevars,*/
18730 __pyx_empty_tuple, /*PyObject *cellvars,*/
18731 py_srcfile, /*PyObject *filename,*/
18732 py_funcname, /*PyObject *name,*/
18733 py_line,
18734 __pyx_empty_bytes /*PyObject *lnotab*/
18735 );
18736 Py_DECREF(py_srcfile);
18737 #else
18738 py_code = PyCode_NewEmpty(filename, funcname, py_line);
18739 #endif
18740 Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
18741 return py_code;
18742 bad:
18743 Py_XDECREF(py_funcname);
18744 #if PY_MAJOR_VERSION < 3
18745 Py_XDECREF(py_srcfile);
18746 #endif
18747 return NULL;
18748 }
18749 static void __Pyx_AddTraceback(const char *funcname, int c_line,
18750 int py_line, const char *filename) {
18751 PyCodeObject *py_code = 0;
18752 PyFrameObject *py_frame = 0;
18753 PyThreadState *tstate = __Pyx_PyThreadState_Current;
18754 PyObject *ptype, *pvalue, *ptraceback;
18755 if (c_line) {
18756 c_line = __Pyx_CLineForTraceback(tstate, c_line);
18757 }
18758 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
18759 if (!py_code) {
18760 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
18761 py_code = __Pyx_CreateCodeObjectForTraceback(
18762 funcname, c_line, py_line, filename);
18763 if (!py_code) {
18764 /* If the code object creation fails, then we should clear the
18765 fetched exception references and propagate the new exception */
18766 Py_XDECREF(ptype);
18767 Py_XDECREF(pvalue);
18768 Py_XDECREF(ptraceback);
18769 goto bad;
18770 }
18771 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
18772 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
18773 }
18774 py_frame = PyFrame_New(
18775 tstate, /*PyThreadState *tstate,*/
18776 py_code, /*PyCodeObject *code,*/
18777 __pyx_d, /*PyObject *globals,*/
18778 0 /*PyObject *locals*/
18779 );
18780 if (!py_frame) goto bad;
18781 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
18782 PyTraceBack_Here(py_frame);
18783 bad:
18784 Py_XDECREF(py_code);
18785 Py_XDECREF(py_frame);
18786 }
18787
18788 /* CIntFromPyVerify */
18789 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
18790 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
18791 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
18792 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
18793 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
18794 {\
18795 func_type value = func_value;\
18796 if (sizeof(target_type) < sizeof(func_type)) {\
18797 if (unlikely(value != (func_type) (target_type) value)) {\
18798 func_type zero = 0;\
18799 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
18800 return (target_type) -1;\
18801 if (is_unsigned && unlikely(value < zero))\
18802 goto raise_neg_overflow;\
18803 else\
18804 goto raise_overflow;\
18805 }\
18806 }\
18807 return (target_type) value;\
18808 }
18809
18810 /* CIntFromPy */
18811 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
18812 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
18813 #pragma GCC diagnostic push
18814 #pragma GCC diagnostic ignored "-Wconversion"
18815 #endif
18816 const int neg_one = (int) -1, const_zero = (int) 0;
18817 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
18818 #pragma GCC diagnostic pop
18819 #endif
18820 const int is_unsigned = neg_one > const_zero;
18821 #if PY_MAJOR_VERSION < 3
18822 if (likely(PyInt_Check(x))) {
18823 if (sizeof(int) < sizeof(long)) {
18824 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
18825 } else {
18826 long val = PyInt_AS_LONG(x);
18827 if (is_unsigned && unlikely(val < 0)) {
18828 goto raise_neg_overflow;
18829 }
18830 return (int) val;
18831 }
18832 } else
18833 #endif
18834 if (likely(PyLong_Check(x))) {
18835 if (is_unsigned) {
18836 #if CYTHON_USE_PYLONG_INTERNALS
18837 const digit* digits = ((PyLongObject*)x)->ob_digit;
18838 switch (Py_SIZE(x)) {
18839 case 0: return (int) 0;
18840 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
18841 case 2:
18842 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
18843 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18844 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18845 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
18846 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
18847 }
18848 }
18849 break;
18850 case 3:
18851 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
18852 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18853 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18854 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
18855 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
18856 }
18857 }
18858 break;
18859 case 4:
18860 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
18861 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18862 __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])))
18863 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
18864 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
18865 }
18866 }
18867 break;
18868 }
18869 #endif
18870 #if CYTHON_COMPILING_IN_CPYTHON
18871 if (unlikely(Py_SIZE(x) < 0)) {
18872 goto raise_neg_overflow;
18873 }
18874 #else
18875 {
18876 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
18877 if (unlikely(result < 0))
18878 return (int) -1;
18879 if (unlikely(result == 1))
18880 goto raise_neg_overflow;
18881 }
18882 #endif
18883 if (sizeof(int) <= sizeof(unsigned long)) {
18884 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
18885 #ifdef HAVE_LONG_LONG
18886 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
18887 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
18888 #endif
18889 }
18890 } else {
18891 #if CYTHON_USE_PYLONG_INTERNALS
18892 const digit* digits = ((PyLongObject*)x)->ob_digit;
18893 switch (Py_SIZE(x)) {
18894 case 0: return (int) 0;
18895 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
18896 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
18897 case -2:
18898 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
18899 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18900 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18901 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
18902 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18903 }
18904 }
18905 break;
18906 case 2:
18907 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
18908 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18909 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18910 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
18911 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18912 }
18913 }
18914 break;
18915 case -3:
18916 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
18917 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18918 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18919 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
18920 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18921 }
18922 }
18923 break;
18924 case 3:
18925 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
18926 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18927 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18928 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
18929 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18930 }
18931 }
18932 break;
18933 case -4:
18934 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
18935 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18936 __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])))
18937 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
18938 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18939 }
18940 }
18941 break;
18942 case 4:
18943 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
18944 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18945 __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])))
18946 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
18947 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18948 }
18949 }
18950 break;
18951 }
18952 #endif
18953 if (sizeof(int) <= sizeof(long)) {
18954 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
18955 #ifdef HAVE_LONG_LONG
18956 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
18957 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
18958 #endif
18959 }
18960 }
18961 {
18962 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
18963 PyErr_SetString(PyExc_RuntimeError,
18964 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
18965 #else
18966 int val;
18967 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
18968 #if PY_MAJOR_VERSION < 3
18969 if (likely(v) && !PyLong_Check(v)) {
18970 PyObject *tmp = v;
18971 v = PyNumber_Long(tmp);
18972 Py_DECREF(tmp);
18973 }
18974 #endif
18975 if (likely(v)) {
18976 int one = 1; int is_little = (int)*(unsigned char *)&one;
18977 unsigned char *bytes = (unsigned char *)&val;
18978 int ret = _PyLong_AsByteArray((PyLongObject *)v,
18979 bytes, sizeof(val),
18980 is_little, !is_unsigned);
18981 Py_DECREF(v);
18982 if (likely(!ret))
18983 return val;
18984 }
18985 #endif
18986 return (int) -1;
18987 }
18988 } else {
18989 int val;
18990 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
18991 if (!tmp) return (int) -1;
18992 val = __Pyx_PyInt_As_int(tmp);
18993 Py_DECREF(tmp);
18994 return val;
18995 }
18996 raise_overflow:
18997 PyErr_SetString(PyExc_OverflowError,
18998 "value too large to convert to int");
18999 return (int) -1;
19000 raise_neg_overflow:
19001 PyErr_SetString(PyExc_OverflowError,
19002 "can't convert negative value to int");
19003 return (int) -1;
19004 }
19005
19006 /* CIntFromPy */
19007 static CYTHON_INLINE MUSIC::Index::Type __Pyx_PyInt_As_MUSIC_3a__3a_Index_3a__3a_Type(PyObject *x) {
19008 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19009 #pragma GCC diagnostic push
19010 #pragma GCC diagnostic ignored "-Wconversion"
19011 #endif
19012 const MUSIC::Index::Type neg_one = (MUSIC::Index::Type) -1, const_zero = (MUSIC::Index::Type) 0;
19013 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19014 #pragma GCC diagnostic pop
19015 #endif
19016 const int is_unsigned = neg_one > const_zero;
19017 #if PY_MAJOR_VERSION < 3
19018 if (likely(PyInt_Check(x))) {
19019 if (sizeof(MUSIC::Index::Type) < sizeof(long)) {
19020 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, long, PyInt_AS_LONG(x))
19021 } else {
19022 long val = PyInt_AS_LONG(x);
19023 if (is_unsigned && unlikely(val < 0)) {
19024 goto raise_neg_overflow;
19025 }
19026 return (MUSIC::Index::Type) val;
19027 }
19028 } else
19029 #endif
19030 if (likely(PyLong_Check(x))) {
19031 if (is_unsigned) {
19032 #if CYTHON_USE_PYLONG_INTERNALS
19033 const digit* digits = ((PyLongObject*)x)->ob_digit;
19034 switch (Py_SIZE(x)) {
19035 case 0: return (MUSIC::Index::Type) 0;
19036 case 1: __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, digit, digits[0])
19037 case 2:
19038 if (8 * sizeof(MUSIC::Index::Type) > 1 * PyLong_SHIFT) {
19039 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
19040 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19041 } else if (8 * sizeof(MUSIC::Index::Type) >= 2 * PyLong_SHIFT) {
19042 return (MUSIC::Index::Type) (((((MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0]));
19043 }
19044 }
19045 break;
19046 case 3:
19047 if (8 * sizeof(MUSIC::Index::Type) > 2 * PyLong_SHIFT) {
19048 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
19049 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19050 } else if (8 * sizeof(MUSIC::Index::Type) >= 3 * PyLong_SHIFT) {
19051 return (MUSIC::Index::Type) (((((((MUSIC::Index::Type)digits[2]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0]));
19052 }
19053 }
19054 break;
19055 case 4:
19056 if (8 * sizeof(MUSIC::Index::Type) > 3 * PyLong_SHIFT) {
19057 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
19058 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19059 } else if (8 * sizeof(MUSIC::Index::Type) >= 4 * PyLong_SHIFT) {
19060 return (MUSIC::Index::Type) (((((((((MUSIC::Index::Type)digits[3]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[2]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0]));
19061 }
19062 }
19063 break;
19064 }
19065 #endif
19066 #if CYTHON_COMPILING_IN_CPYTHON
19067 if (unlikely(Py_SIZE(x) < 0)) {
19068 goto raise_neg_overflow;
19069 }
19070 #else
19071 {
19072 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
19073 if (unlikely(result < 0))
19074 return (MUSIC::Index::Type) -1;
19075 if (unlikely(result == 1))
19076 goto raise_neg_overflow;
19077 }
19078 #endif
19079 if (sizeof(MUSIC::Index::Type) <= sizeof(unsigned long)) {
19080 __PYX_VERIFY_RETURN_INT_EXC(MUSIC::Index::Type, unsigned long, PyLong_AsUnsignedLong(x))
19081 #ifdef HAVE_LONG_LONG
19082 } else if (sizeof(MUSIC::Index::Type) <= sizeof(unsigned PY_LONG_LONG)) {
19083 __PYX_VERIFY_RETURN_INT_EXC(MUSIC::Index::Type, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
19084 #endif
19085 }
19086 } else {
19087 #if CYTHON_USE_PYLONG_INTERNALS
19088 const digit* digits = ((PyLongObject*)x)->ob_digit;
19089 switch (Py_SIZE(x)) {
19090 case 0: return (MUSIC::Index::Type) 0;
19091 case -1: __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, sdigit, (sdigit) (-(sdigit)digits[0]))
19092 case 1: __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, digit, +digits[0])
19093 case -2:
19094 if (8 * sizeof(MUSIC::Index::Type) - 1 > 1 * PyLong_SHIFT) {
19095 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
19096 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19097 } else if (8 * sizeof(MUSIC::Index::Type) - 1 > 2 * PyLong_SHIFT) {
19098 return (MUSIC::Index::Type) (((MUSIC::Index::Type)-1)*(((((MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0])));
19099 }
19100 }
19101 break;
19102 case 2:
19103 if (8 * sizeof(MUSIC::Index::Type) > 1 * PyLong_SHIFT) {
19104 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
19105 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19106 } else if (8 * sizeof(MUSIC::Index::Type) - 1 > 2 * PyLong_SHIFT) {
19107 return (MUSIC::Index::Type) ((((((MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0])));
19108 }
19109 }
19110 break;
19111 case -3:
19112 if (8 * sizeof(MUSIC::Index::Type) - 1 > 2 * PyLong_SHIFT) {
19113 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
19114 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19115 } else if (8 * sizeof(MUSIC::Index::Type) - 1 > 3 * PyLong_SHIFT) {
19116 return (MUSIC::Index::Type) (((MUSIC::Index::Type)-1)*(((((((MUSIC::Index::Type)digits[2]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0])));
19117 }
19118 }
19119 break;
19120 case 3:
19121 if (8 * sizeof(MUSIC::Index::Type) > 2 * PyLong_SHIFT) {
19122 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
19123 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19124 } else if (8 * sizeof(MUSIC::Index::Type) - 1 > 3 * PyLong_SHIFT) {
19125 return (MUSIC::Index::Type) ((((((((MUSIC::Index::Type)digits[2]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0])));
19126 }
19127 }
19128 break;
19129 case -4:
19130 if (8 * sizeof(MUSIC::Index::Type) - 1 > 3 * PyLong_SHIFT) {
19131 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
19132 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19133 } else if (8 * sizeof(MUSIC::Index::Type) - 1 > 4 * PyLong_SHIFT) {
19134 return (MUSIC::Index::Type) (((MUSIC::Index::Type)-1)*(((((((((MUSIC::Index::Type)digits[3]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[2]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0])));
19135 }
19136 }
19137 break;
19138 case 4:
19139 if (8 * sizeof(MUSIC::Index::Type) > 3 * PyLong_SHIFT) {
19140 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
19141 __PYX_VERIFY_RETURN_INT(MUSIC::Index::Type, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19142 } else if (8 * sizeof(MUSIC::Index::Type) - 1 > 4 * PyLong_SHIFT) {
19143 return (MUSIC::Index::Type) ((((((((((MUSIC::Index::Type)digits[3]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[2]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[1]) << PyLong_SHIFT) | (MUSIC::Index::Type)digits[0])));
19144 }
19145 }
19146 break;
19147 }
19148 #endif
19149 if (sizeof(MUSIC::Index::Type) <= sizeof(long)) {
19150 __PYX_VERIFY_RETURN_INT_EXC(MUSIC::Index::Type, long, PyLong_AsLong(x))
19151 #ifdef HAVE_LONG_LONG
19152 } else if (sizeof(MUSIC::Index::Type) <= sizeof(PY_LONG_LONG)) {
19153 __PYX_VERIFY_RETURN_INT_EXC(MUSIC::Index::Type, PY_LONG_LONG, PyLong_AsLongLong(x))
19154 #endif
19155 }
19156 }
19157 {
19158 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
19159 PyErr_SetString(PyExc_RuntimeError,
19160 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
19161 #else
19162 MUSIC::Index::Type val;
19163 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
19164 #if PY_MAJOR_VERSION < 3
19165 if (likely(v) && !PyLong_Check(v)) {
19166 PyObject *tmp = v;
19167 v = PyNumber_Long(tmp);
19168 Py_DECREF(tmp);
19169 }
19170 #endif
19171 if (likely(v)) {
19172 int one = 1; int is_little = (int)*(unsigned char *)&one;
19173 unsigned char *bytes = (unsigned char *)&val;
19174 int ret = _PyLong_AsByteArray((PyLongObject *)v,
19175 bytes, sizeof(val),
19176 is_little, !is_unsigned);
19177 Py_DECREF(v);
19178 if (likely(!ret))
19179 return val;
19180 }
19181 #endif
19182 return (MUSIC::Index::Type) -1;
19183 }
19184 } else {
19185 MUSIC::Index::Type val;
19186 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
19187 if (!tmp) return (MUSIC::Index::Type) -1;
19188 val = __Pyx_PyInt_As_MUSIC_3a__3a_Index_3a__3a_Type(tmp);
19189 Py_DECREF(tmp);
19190 return val;
19191 }
19192 raise_overflow:
19193 PyErr_SetString(PyExc_OverflowError,
19194 "value too large to convert to MUSIC::Index::Type");
19195 return (MUSIC::Index::Type) -1;
19196 raise_neg_overflow:
19197 PyErr_SetString(PyExc_OverflowError,
19198 "can't convert negative value to MUSIC::Index::Type");
19199 return (MUSIC::Index::Type) -1;
19200 }
19201
19202 /* CIntToPy */
19203 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
19204 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19205 #pragma GCC diagnostic push
19206 #pragma GCC diagnostic ignored "-Wconversion"
19207 #endif
19208 const int neg_one = (int) -1, const_zero = (int) 0;
19209 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19210 #pragma GCC diagnostic pop
19211 #endif
19212 const int is_unsigned = neg_one > const_zero;
19213 if (is_unsigned) {
19214 if (sizeof(int) < sizeof(long)) {
19215 return PyInt_FromLong((long) value);
19216 } else if (sizeof(int) <= sizeof(unsigned long)) {
19217 return PyLong_FromUnsignedLong((unsigned long) value);
19218 #ifdef HAVE_LONG_LONG
19219 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
19220 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
19221 #endif
19222 }
19223 } else {
19224 if (sizeof(int) <= sizeof(long)) {
19225 return PyInt_FromLong((long) value);
19226 #ifdef HAVE_LONG_LONG
19227 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
19228 return PyLong_FromLongLong((PY_LONG_LONG) value);
19229 #endif
19230 }
19231 }
19232 {
19233 int one = 1; int little = (int)*(unsigned char *)&one;
19234 unsigned char *bytes = (unsigned char *)&value;
19235 return _PyLong_FromByteArray(bytes, sizeof(int),
19236 little, !is_unsigned);
19237 }
19238 }
19239
19240 /* CIntFromPy */
19241 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
19242 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19243 #pragma GCC diagnostic push
19244 #pragma GCC diagnostic ignored "-Wconversion"
19245 #endif
19246 const long neg_one = (long) -1, const_zero = (long) 0;
19247 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19248 #pragma GCC diagnostic pop
19249 #endif
19250 const int is_unsigned = neg_one > const_zero;
19251 #if PY_MAJOR_VERSION < 3
19252 if (likely(PyInt_Check(x))) {
19253 if (sizeof(long) < sizeof(long)) {
19254 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
19255 } else {
19256 long val = PyInt_AS_LONG(x);
19257 if (is_unsigned && unlikely(val < 0)) {
19258 goto raise_neg_overflow;
19259 }
19260 return (long) val;
19261 }
19262 } else
19263 #endif
19264 if (likely(PyLong_Check(x))) {
19265 if (is_unsigned) {
19266 #if CYTHON_USE_PYLONG_INTERNALS
19267 const digit* digits = ((PyLongObject*)x)->ob_digit;
19268 switch (Py_SIZE(x)) {
19269 case 0: return (long) 0;
19270 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
19271 case 2:
19272 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
19273 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
19274 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19275 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
19276 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
19277 }
19278 }
19279 break;
19280 case 3:
19281 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
19282 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
19283 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19284 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
19285 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
19286 }
19287 }
19288 break;
19289 case 4:
19290 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
19291 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
19292 __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])))
19293 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
19294 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
19295 }
19296 }
19297 break;
19298 }
19299 #endif
19300 #if CYTHON_COMPILING_IN_CPYTHON
19301 if (unlikely(Py_SIZE(x) < 0)) {
19302 goto raise_neg_overflow;
19303 }
19304 #else
19305 {
19306 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
19307 if (unlikely(result < 0))
19308 return (long) -1;
19309 if (unlikely(result == 1))
19310 goto raise_neg_overflow;
19311 }
19312 #endif
19313 if (sizeof(long) <= sizeof(unsigned long)) {
19314 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
19315 #ifdef HAVE_LONG_LONG
19316 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
19317 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
19318 #endif
19319 }
19320 } else {
19321 #if CYTHON_USE_PYLONG_INTERNALS
19322 const digit* digits = ((PyLongObject*)x)->ob_digit;
19323 switch (Py_SIZE(x)) {
19324 case 0: return (long) 0;
19325 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
19326 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
19327 case -2:
19328 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
19329 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
19330 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19331 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
19332 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
19333 }
19334 }
19335 break;
19336 case 2:
19337 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
19338 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
19339 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19340 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
19341 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
19342 }
19343 }
19344 break;
19345 case -3:
19346 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
19347 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
19348 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19349 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
19350 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
19351 }
19352 }
19353 break;
19354 case 3:
19355 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
19356 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
19357 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
19358 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
19359 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
19360 }
19361 }
19362 break;
19363 case -4:
19364 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
19365 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
19366 __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])))
19367 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
19368 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
19369 }
19370 }
19371 break;
19372 case 4:
19373 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
19374 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
19375 __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])))
19376 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
19377 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
19378 }
19379 }
19380 break;
19381 }
19382 #endif
19383 if (sizeof(long) <= sizeof(long)) {
19384 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
19385 #ifdef HAVE_LONG_LONG
19386 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
19387 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
19388 #endif
19389 }
19390 }
19391 {
19392 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
19393 PyErr_SetString(PyExc_RuntimeError,
19394 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
19395 #else
19396 long val;
19397 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
19398 #if PY_MAJOR_VERSION < 3
19399 if (likely(v) && !PyLong_Check(v)) {
19400 PyObject *tmp = v;
19401 v = PyNumber_Long(tmp);
19402 Py_DECREF(tmp);
19403 }
19404 #endif
19405 if (likely(v)) {
19406 int one = 1; int is_little = (int)*(unsigned char *)&one;
19407 unsigned char *bytes = (unsigned char *)&val;
19408 int ret = _PyLong_AsByteArray((PyLongObject *)v,
19409 bytes, sizeof(val),
19410 is_little, !is_unsigned);
19411 Py_DECREF(v);
19412 if (likely(!ret))
19413 return val;
19414 }
19415 #endif
19416 return (long) -1;
19417 }
19418 } else {
19419 long val;
19420 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
19421 if (!tmp) return (long) -1;
19422 val = __Pyx_PyInt_As_long(tmp);
19423 Py_DECREF(tmp);
19424 return val;
19425 }
19426 raise_overflow:
19427 PyErr_SetString(PyExc_OverflowError,
19428 "value too large to convert to long");
19429 return (long) -1;
19430 raise_neg_overflow:
19431 PyErr_SetString(PyExc_OverflowError,
19432 "can't convert negative value to long");
19433 return (long) -1;
19434 }
19435
19436 /* CIntToPy */
19437 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
19438 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19439 #pragma GCC diagnostic push
19440 #pragma GCC diagnostic ignored "-Wconversion"
19441 #endif
19442 const long neg_one = (long) -1, const_zero = (long) 0;
19443 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19444 #pragma GCC diagnostic pop
19445 #endif
19446 const int is_unsigned = neg_one > const_zero;
19447 if (is_unsigned) {
19448 if (sizeof(long) < sizeof(long)) {
19449 return PyInt_FromLong((long) value);
19450 } else if (sizeof(long) <= sizeof(unsigned long)) {
19451 return PyLong_FromUnsignedLong((unsigned long) value);
19452 #ifdef HAVE_LONG_LONG
19453 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
19454 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
19455 #endif
19456 }
19457 } else {
19458 if (sizeof(long) <= sizeof(long)) {
19459 return PyInt_FromLong((long) value);
19460 #ifdef HAVE_LONG_LONG
19461 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
19462 return PyLong_FromLongLong((PY_LONG_LONG) value);
19463 #endif
19464 }
19465 }
19466 {
19467 int one = 1; int little = (int)*(unsigned char *)&one;
19468 unsigned char *bytes = (unsigned char *)&value;
19469 return _PyLong_FromByteArray(bytes, sizeof(long),
19470 little, !is_unsigned);
19471 }
19472 }
19473
19474 /* CIntToPy */
19475 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MUSIC_3a__3a_Index_3a__3a_Type(MUSIC::Index::Type value) {
19476 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19477 #pragma GCC diagnostic push
19478 #pragma GCC diagnostic ignored "-Wconversion"
19479 #endif
19480 const MUSIC::Index::Type neg_one = (MUSIC::Index::Type) -1, const_zero = (MUSIC::Index::Type) 0;
19481 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
19482 #pragma GCC diagnostic pop
19483 #endif
19484 const int is_unsigned = neg_one > const_zero;
19485 if (is_unsigned) {
19486 if (sizeof(MUSIC::Index::Type) < sizeof(long)) {
19487 return PyInt_FromLong((long) value);
19488 } else if (sizeof(MUSIC::Index::Type) <= sizeof(unsigned long)) {
19489 return PyLong_FromUnsignedLong((unsigned long) value);
19490 #ifdef HAVE_LONG_LONG
19491 } else if (sizeof(MUSIC::Index::Type) <= sizeof(unsigned PY_LONG_LONG)) {
19492 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
19493 #endif
19494 }
19495 } else {
19496 if (sizeof(MUSIC::Index::Type) <= sizeof(long)) {
19497 return PyInt_FromLong((long) value);
19498 #ifdef HAVE_LONG_LONG
19499 } else if (sizeof(MUSIC::Index::Type) <= sizeof(PY_LONG_LONG)) {
19500 return PyLong_FromLongLong((PY_LONG_LONG) value);
19501 #endif
19502 }
19503 }
19504 {
19505 int one = 1; int little = (int)*(unsigned char *)&one;
19506 unsigned char *bytes = (unsigned char *)&value;
19507 return _PyLong_FromByteArray(bytes, sizeof(MUSIC::Index::Type),
19508 little, !is_unsigned);
19509 }
19510 }
19511
19512 /* FastTypeChecks */
19513 #if CYTHON_COMPILING_IN_CPYTHON
19514 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
19515 while (a) {
19516 a = a->tp_base;
19517 if (a == b)
19518 return 1;
19519 }
19520 return b == &PyBaseObject_Type;
19521 }
19522 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
19523 PyObject *mro;
19524 if (a == b) return 1;
19525 mro = a->tp_mro;
19526 if (likely(mro)) {
19527 Py_ssize_t i, n;
19528 n = PyTuple_GET_SIZE(mro);
19529 for (i = 0; i < n; i++) {
19530 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
19531 return 1;
19532 }
19533 return 0;
19534 }
19535 return __Pyx_InBases(a, b);
19536 }
19537 #if PY_MAJOR_VERSION == 2
19538 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
19539 PyObject *exception, *value, *tb;
19540 int res;
19541 __Pyx_PyThreadState_declare
19542 __Pyx_PyThreadState_assign
19543 __Pyx_ErrFetch(&exception, &value, &tb);
19544 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
19545 if (unlikely(res == -1)) {
19546 PyErr_WriteUnraisable(err);
19547 res = 0;
19548 }
19549 if (!res) {
19550 res = PyObject_IsSubclass(err, exc_type2);
19551 if (unlikely(res == -1)) {
19552 PyErr_WriteUnraisable(err);
19553 res = 0;
19554 }
19555 }
19556 __Pyx_ErrRestore(exception, value, tb);
19557 return res;
19558 }
19559 #else
19560 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
19561 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
19562 if (!res) {
19563 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
19564 }
19565 return res;
19566 }
19567 #endif
19568 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
19569 Py_ssize_t i, n;
19570 assert(PyExceptionClass_Check(exc_type));
19571 n = PyTuple_GET_SIZE(tuple);
19572 #if PY_MAJOR_VERSION >= 3
19573 for (i=0; i<n; i++) {
19574 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
19575 }
19576 #endif
19577 for (i=0; i<n; i++) {
19578 PyObject *t = PyTuple_GET_ITEM(tuple, i);
19579 #if PY_MAJOR_VERSION < 3
19580 if (likely(exc_type == t)) return 1;
19581 #endif
19582 if (likely(PyExceptionClass_Check(t))) {
19583 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
19584 } else {
19585 }
19586 }
19587 return 0;
19588 }
19589 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
19590 if (likely(err == exc_type)) return 1;
19591 if (likely(PyExceptionClass_Check(err))) {
19592 if (likely(PyExceptionClass_Check(exc_type))) {
19593 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
19594 } else if (likely(PyTuple_Check(exc_type))) {
19595 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
19596 } else {
19597 }
19598 }
19599 return PyErr_GivenExceptionMatches(err, exc_type);
19600 }
19601 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
19602 assert(PyExceptionClass_Check(exc_type1));
19603 assert(PyExceptionClass_Check(exc_type2));
19604 if (likely(err == exc_type1 || err == exc_type2)) return 1;
19605 if (likely(PyExceptionClass_Check(err))) {
19606 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
19607 }
19608 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
19609 }
19610 #endif
19611
19612 /* PyObjectGetMethod */
19613 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
19614 PyObject *attr;
19615 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
19616 PyTypeObject *tp = Py_TYPE(obj);
19617 PyObject *descr;
19618 descrgetfunc f = NULL;
19619 PyObject **dictptr, *dict;
19620 int meth_found = 0;
19621 assert (*method == NULL);
19622 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
19623 attr = __Pyx_PyObject_GetAttrStr(obj, name);
19624 goto try_unpack;
19625 }
19626 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
19627 return 0;
19628 }
19629 descr = _PyType_Lookup(tp, name);
19630 if (likely(descr != NULL)) {
19631 Py_INCREF(descr);
19632 #if PY_MAJOR_VERSION >= 3
19633 #ifdef __Pyx_CyFunction_USED
19634 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
19635 #else
19636 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
19637 #endif
19638 #else
19639 #ifdef __Pyx_CyFunction_USED
19640 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
19641 #else
19642 if (likely(PyFunction_Check(descr)))
19643 #endif
19644 #endif
19645 {
19646 meth_found = 1;
19647 } else {
19648 f = Py_TYPE(descr)->tp_descr_get;
19649 if (f != NULL && PyDescr_IsData(descr)) {
19650 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
19651 Py_DECREF(descr);
19652 goto try_unpack;
19653 }
19654 }
19655 }
19656 dictptr = _PyObject_GetDictPtr(obj);
19657 if (dictptr != NULL && (dict = *dictptr) != NULL) {
19658 Py_INCREF(dict);
19659 attr = __Pyx_PyDict_GetItemStr(dict, name);
19660 if (attr != NULL) {
19661 Py_INCREF(attr);
19662 Py_DECREF(dict);
19663 Py_XDECREF(descr);
19664 goto try_unpack;
19665 }
19666 Py_DECREF(dict);
19667 }
19668 if (meth_found) {
19669 *method = descr;
19670 return 1;
19671 }
19672 if (f != NULL) {
19673 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
19674 Py_DECREF(descr);
19675 goto try_unpack;
19676 }
19677 if (descr != NULL) {
19678 *method = descr;
19679 return 0;
19680 }
19681 PyErr_Format(PyExc_AttributeError,
19682 #if PY_MAJOR_VERSION >= 3
19683 "'%.50s' object has no attribute '%U'",
19684 tp->tp_name, name);
19685 #else
19686 "'%.50s' object has no attribute '%.400s'",
19687 tp->tp_name, PyString_AS_STRING(name));
19688 #endif
19689 return 0;
19690 #else
19691 attr = __Pyx_PyObject_GetAttrStr(obj, name);
19692 goto try_unpack;
19693 #endif
19694 try_unpack:
19695 #if CYTHON_UNPACK_METHODS
19696 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
19697 PyObject *function = PyMethod_GET_FUNCTION(attr);
19698 Py_INCREF(function);
19699 Py_DECREF(attr);
19700 *method = function;
19701 return 1;
19702 }
19703 #endif
19704 *method = attr;
19705 return 0;
19706 }
19707
19708 /* PyObjectCallMethod1 */
19709 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
19710 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
19711 Py_DECREF(method);
19712 return result;
19713 }
19714 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
19715 PyObject *method = NULL, *result;
19716 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
19717 if (likely(is_method)) {
19718 result = __Pyx_PyObject_Call2Args(method, obj, arg);
19719 Py_DECREF(method);
19720 return result;
19721 }
19722 if (unlikely(!method)) return NULL;
19723 return __Pyx__PyObject_CallMethod1(method, arg);
19724 }
19725
19726 /* CoroutineBase */
19727 #include <structmember.h>
19728 #include <frameobject.h>
19729 #if PY_VERSION_HEX >= 0x030b00a6
19730 #ifndef Py_BUILD_CORE
19731 #define Py_BUILD_CORE 1
19732 #endif
19733 #include "internal/pycore_frame.h"
19734 #endif
19735 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
19736 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
19737 PyObject *et, *ev, *tb;
19738 PyObject *value = NULL;
19739 __Pyx_ErrFetch(&et, &ev, &tb);
19740 if (!et) {
19741 Py_XDECREF(tb);
19742 Py_XDECREF(ev);
19743 Py_INCREF(Py_None);
19744 *pvalue = Py_None;
19745 return 0;
19746 }
19747 if (likely(et == PyExc_StopIteration)) {
19748 if (!ev) {
19749 Py_INCREF(Py_None);
19750 value = Py_None;
19751 }
19752 #if PY_VERSION_HEX >= 0x030300A0
19753 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
19754 value = ((PyStopIterationObject *)ev)->value;
19755 Py_INCREF(value);
19756 Py_DECREF(ev);
19757 }
19758 #endif
19759 else if (unlikely(PyTuple_Check(ev))) {
19760 if (PyTuple_GET_SIZE(ev) >= 1) {
19761 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19762 value = PyTuple_GET_ITEM(ev, 0);
19763 Py_INCREF(value);
19764 #else
19765 value = PySequence_ITEM(ev, 0);
19766 #endif
19767 } else {
19768 Py_INCREF(Py_None);
19769 value = Py_None;
19770 }
19771 Py_DECREF(ev);
19772 }
19773 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
19774 value = ev;
19775 }
19776 if (likely(value)) {
19777 Py_XDECREF(tb);
19778 Py_DECREF(et);
19779 *pvalue = value;
19780 return 0;
19781 }
19782 } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
19783 __Pyx_ErrRestore(et, ev, tb);
19784 return -1;
19785 }
19786 PyErr_NormalizeException(&et, &ev, &tb);
19787 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
19788 __Pyx_ErrRestore(et, ev, tb);
19789 return -1;
19790 }
19791 Py_XDECREF(tb);
19792 Py_DECREF(et);
19793 #if PY_VERSION_HEX >= 0x030300A0
19794 value = ((PyStopIterationObject *)ev)->value;
19795 Py_INCREF(value);
19796 Py_DECREF(ev);
19797 #else
19798 {
19799 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
19800 Py_DECREF(ev);
19801 if (likely(args)) {
19802 value = PySequence_GetItem(args, 0);
19803 Py_DECREF(args);
19804 }
19805 if (unlikely(!value)) {
19806 __Pyx_ErrRestore(NULL, NULL, NULL);
19807 Py_INCREF(Py_None);
19808 value = Py_None;
19809 }
19810 }
19811 #endif
19812 *pvalue = value;
19813 return 0;
19814 }
19815 static CYTHON_INLINE
19816 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
19817 PyObject *t, *v, *tb;
19818 t = exc_state->exc_type;
19819 v = exc_state->exc_value;
19820 tb = exc_state->exc_traceback;
19821 exc_state->exc_type = NULL;
19822 exc_state->exc_value = NULL;
19823 exc_state->exc_traceback = NULL;
19824 Py_XDECREF(t);
19825 Py_XDECREF(v);
19826 Py_XDECREF(tb);
19827 }
19828 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
19829 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
19830 const char *msg;
19831 if ((0)) {
19832 #ifdef __Pyx_Coroutine_USED
19833 } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
19834 msg = "coroutine already executing";
19835 #endif
19836 #ifdef __Pyx_AsyncGen_USED
19837 } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
19838 msg = "async generator already executing";
19839 #endif
19840 } else {
19841 msg = "generator already executing";
19842 }
19843 PyErr_SetString(PyExc_ValueError, msg);
19844 }
19845 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
19846 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
19847 const char *msg;
19848 if ((0)) {
19849 #ifdef __Pyx_Coroutine_USED
19850 } else if (__Pyx_Coroutine_Check(gen)) {
19851 msg = "can't send non-None value to a just-started coroutine";
19852 #endif
19853 #ifdef __Pyx_AsyncGen_USED
19854 } else if (__Pyx_AsyncGen_CheckExact(gen)) {
19855 msg = "can't send non-None value to a just-started async generator";
19856 #endif
19857 } else {
19858 msg = "can't send non-None value to a just-started generator";
19859 }
19860 PyErr_SetString(PyExc_TypeError, msg);
19861 }
19862 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
19863 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
19864 #ifdef __Pyx_Coroutine_USED
19865 if (!closing && __Pyx_Coroutine_Check(gen)) {
19866 PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
19867 } else
19868 #endif
19869 if (value) {
19870 #ifdef __Pyx_AsyncGen_USED
19871 if (__Pyx_AsyncGen_CheckExact(gen))
19872 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
19873 else
19874 #endif
19875 PyErr_SetNone(PyExc_StopIteration);
19876 }
19877 }
19878 static
19879 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
19880 __Pyx_PyThreadState_declare
19881 PyThreadState *tstate;
19882 __Pyx_ExcInfoStruct *exc_state;
19883 PyObject *retval;
19884 assert(!self->is_running);
19885 if (unlikely(self->resume_label == 0)) {
19886 if (unlikely(value && value != Py_None)) {
19887 return __Pyx_Coroutine_NotStartedError((PyObject*)self);
19888 }
19889 }
19890 if (unlikely(self->resume_label == -1)) {
19891 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
19892 }
19893 #if CYTHON_FAST_THREAD_STATE
19894 __Pyx_PyThreadState_assign
19895 tstate = __pyx_tstate;
19896 #else
19897 tstate = __Pyx_PyThreadState_Current;
19898 #endif
19899 exc_state = &self->gi_exc_state;
19900 if (exc_state->exc_type) {
19901 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
19902 #else
19903 if (exc_state->exc_traceback) {
19904 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
19905 PyFrameObject *f = tb->tb_frame;
19906 assert(f->f_back == NULL);
19907 #if PY_VERSION_HEX >= 0x030B00A1
19908 f->f_back = PyThreadState_GetFrame(tstate);
19909 #else
19910 Py_XINCREF(tstate->frame);
19911 f->f_back = tstate->frame;
19912 #endif
19913 }
19914 #endif
19915 }
19916 #if CYTHON_USE_EXC_INFO_STACK
19917 exc_state->previous_item = tstate->exc_info;
19918 tstate->exc_info = exc_state;
19919 #else
19920 if (exc_state->exc_type) {
19921 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
19922 } else {
19923 __Pyx_Coroutine_ExceptionClear(exc_state);
19924 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
19925 }
19926 #endif
19927 self->is_running = 1;
19928 retval = self->body((PyObject *) self, tstate, value);
19929 self->is_running = 0;
19930 #if CYTHON_USE_EXC_INFO_STACK
19931 exc_state = &self->gi_exc_state;
19932 tstate->exc_info = exc_state->previous_item;
19933 exc_state->previous_item = NULL;
19934 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
19935 #endif
19936 return retval;
19937 }
19938 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
19939 PyObject *exc_tb = exc_state->exc_traceback;
19940 if (likely(exc_tb)) {
19941 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
19942 #else
19943 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
19944 PyFrameObject *f = tb->tb_frame;
19945 Py_CLEAR(f->f_back);
19946 #endif
19947 }
19948 }
19949 static CYTHON_INLINE
19950 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
19951 if (unlikely(!retval)) {
19952 __Pyx_PyThreadState_declare
19953 __Pyx_PyThreadState_assign
19954 if (!__Pyx_PyErr_Occurred()) {
19955 PyObject *exc = PyExc_StopIteration;
19956 #ifdef __Pyx_AsyncGen_USED
19957 if (__Pyx_AsyncGen_CheckExact(gen))
19958 exc = __Pyx_PyExc_StopAsyncIteration;
19959 #endif
19960 __Pyx_PyErr_SetNone(exc);
19961 }
19962 }
19963 return retval;
19964 }
19965 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
19966 static CYTHON_INLINE
19967 PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
19968 #if PY_VERSION_HEX <= 0x030A00A1
19969 return _PyGen_Send(gen, arg);
19970 #else
19971 PyObject *result;
19972 if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
19973 if (PyAsyncGen_CheckExact(gen)) {
19974 assert(result == Py_None);
19975 PyErr_SetNone(PyExc_StopAsyncIteration);
19976 }
19977 else if (result == Py_None) {
19978 PyErr_SetNone(PyExc_StopIteration);
19979 }
19980 else {
19981 _PyGen_SetStopIterationValue(result);
19982 }
19983 Py_CLEAR(result);
19984 }
19985 return result;
19986 #endif
19987 }
19988 #endif
19989 static CYTHON_INLINE
19990 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
19991 PyObject *ret;
19992 PyObject *val = NULL;
19993 __Pyx_Coroutine_Undelegate(gen);
19994 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
19995 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
19996 Py_XDECREF(val);
19997 return ret;
19998 }
19999 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
20000 PyObject *retval;
20001 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
20002 PyObject *yf = gen->yieldfrom;
20003 if (unlikely(gen->is_running))
20004 return __Pyx_Coroutine_AlreadyRunningError(gen);
20005 if (yf) {
20006 PyObject *ret;
20007 gen->is_running = 1;
20008 #ifdef __Pyx_Generator_USED
20009 if (__Pyx_Generator_CheckExact(yf)) {
20010 ret = __Pyx_Coroutine_Send(yf, value);
20011 } else
20012 #endif
20013 #ifdef __Pyx_Coroutine_USED
20014 if (__Pyx_Coroutine_Check(yf)) {
20015 ret = __Pyx_Coroutine_Send(yf, value);
20016 } else
20017 #endif
20018 #ifdef __Pyx_AsyncGen_USED
20019 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
20020 ret = __Pyx_async_gen_asend_send(yf, value);
20021 } else
20022 #endif
20023 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
20024 if (PyGen_CheckExact(yf)) {
20025 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
20026 } else
20027 #endif
20028 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
20029 if (PyCoro_CheckExact(yf)) {
20030 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
20031 } else
20032 #endif
20033 {
20034 if (value == Py_None)
20035 ret = Py_TYPE(yf)->tp_iternext(yf);
20036 else
20037 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
20038 }
20039 gen->is_running = 0;
20040 if (likely(ret)) {
20041 return ret;
20042 }
20043 retval = __Pyx_Coroutine_FinishDelegation(gen);
20044 } else {
20045 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
20046 }
20047 return __Pyx_Coroutine_MethodReturn(self, retval);
20048 }
20049 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
20050 PyObject *retval = NULL;
20051 int err = 0;
20052 #ifdef __Pyx_Generator_USED
20053 if (__Pyx_Generator_CheckExact(yf)) {
20054 retval = __Pyx_Coroutine_Close(yf);
20055 if (!retval)
20056 return -1;
20057 } else
20058 #endif
20059 #ifdef __Pyx_Coroutine_USED
20060 if (__Pyx_Coroutine_Check(yf)) {
20061 retval = __Pyx_Coroutine_Close(yf);
20062 if (!retval)
20063 return -1;
20064 } else
20065 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
20066 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
20067 if (!retval)
20068 return -1;
20069 } else
20070 #endif
20071 #ifdef __Pyx_AsyncGen_USED
20072 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
20073 retval = __Pyx_async_gen_asend_close(yf, NULL);
20074 } else
20075 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
20076 retval = __Pyx_async_gen_athrow_close(yf, NULL);
20077 } else
20078 #endif
20079 {
20080 PyObject *meth;
20081 gen->is_running = 1;
20082 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
20083 if (unlikely(!meth)) {
20084 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
20085 PyErr_WriteUnraisable(yf);
20086 }
20087 PyErr_Clear();
20088 } else {
20089 retval = PyObject_CallFunction(meth, NULL);
20090 Py_DECREF(meth);
20091 if (!retval)
20092 err = -1;
20093 }
20094 gen->is_running = 0;
20095 }
20096 Py_XDECREF(retval);
20097 return err;
20098 }
20099 static PyObject *__Pyx_Generator_Next(PyObject *self) {
20100 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
20101 PyObject *yf = gen->yieldfrom;
20102 if (unlikely(gen->is_running))
20103 return __Pyx_Coroutine_AlreadyRunningError(gen);
20104 if (yf) {
20105 PyObject *ret;
20106 gen->is_running = 1;
20107 #ifdef __Pyx_Generator_USED
20108 if (__Pyx_Generator_CheckExact(yf)) {
20109 ret = __Pyx_Generator_Next(yf);
20110 } else
20111 #endif
20112 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
20113 if (PyGen_CheckExact(yf)) {
20114 ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
20115 } else
20116 #endif
20117 #ifdef __Pyx_Coroutine_USED
20118 if (__Pyx_Coroutine_Check(yf)) {
20119 ret = __Pyx_Coroutine_Send(yf, Py_None);
20120 } else
20121 #endif
20122 ret = Py_TYPE(yf)->tp_iternext(yf);
20123 gen->is_running = 0;
20124 if (likely(ret)) {
20125 return ret;
20126 }
20127 return __Pyx_Coroutine_FinishDelegation(gen);
20128 }
20129 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
20130 }
20131 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
20132 return __Pyx_Coroutine_Close(self);
20133 }
20134 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
20135 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
20136 PyObject *retval, *raised_exception;
20137 PyObject *yf = gen->yieldfrom;
20138 int err = 0;
20139 if (unlikely(gen->is_running))
20140 return __Pyx_Coroutine_AlreadyRunningError(gen);
20141 if (yf) {
20142 Py_INCREF(yf);
20143 err = __Pyx_Coroutine_CloseIter(gen, yf);
20144 __Pyx_Coroutine_Undelegate(gen);
20145 Py_DECREF(yf);
20146 }
20147 if (err == 0)
20148 PyErr_SetNone(PyExc_GeneratorExit);
20149 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
20150 if (unlikely(retval)) {
20151 const char *msg;
20152 Py_DECREF(retval);
20153 if ((0)) {
20154 #ifdef __Pyx_Coroutine_USED
20155 } else if (__Pyx_Coroutine_Check(self)) {
20156 msg = "coroutine ignored GeneratorExit";
20157 #endif
20158 #ifdef __Pyx_AsyncGen_USED
20159 } else if (__Pyx_AsyncGen_CheckExact(self)) {
20160 #if PY_VERSION_HEX < 0x03060000
20161 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
20162 #else
20163 msg = "async generator ignored GeneratorExit";
20164 #endif
20165 #endif
20166 } else {
20167 msg = "generator ignored GeneratorExit";
20168 }
20169 PyErr_SetString(PyExc_RuntimeError, msg);
20170 return NULL;
20171 }
20172 raised_exception = PyErr_Occurred();
20173 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
20174 if (raised_exception) PyErr_Clear();
20175 Py_INCREF(Py_None);
20176 return Py_None;
20177 }
20178 return NULL;
20179 }
20180 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
20181 PyObject *args, int close_on_genexit) {
20182 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
20183 PyObject *yf = gen->yieldfrom;
20184 if (unlikely(gen->is_running))
20185 return __Pyx_Coroutine_AlreadyRunningError(gen);
20186 if (yf) {
20187 PyObject *ret;
20188 Py_INCREF(yf);
20189 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
20190 int err = __Pyx_Coroutine_CloseIter(gen, yf);
20191 Py_DECREF(yf);
20192 __Pyx_Coroutine_Undelegate(gen);
20193 if (err < 0)
20194 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
20195 goto throw_here;
20196 }
20197 gen->is_running = 1;
20198 if (0
20199 #ifdef __Pyx_Generator_USED
20200 || __Pyx_Generator_CheckExact(yf)
20201 #endif
20202 #ifdef __Pyx_Coroutine_USED
20203 || __Pyx_Coroutine_Check(yf)
20204 #endif
20205 ) {
20206 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
20207 #ifdef __Pyx_Coroutine_USED
20208 } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
20209 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
20210 #endif
20211 } else {
20212 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
20213 if (unlikely(!meth)) {
20214 Py_DECREF(yf);
20215 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
20216 gen->is_running = 0;
20217 return NULL;
20218 }
20219 PyErr_Clear();
20220 __Pyx_Coroutine_Undelegate(gen);
20221 gen->is_running = 0;
20222 goto throw_here;
20223 }
20224 if (likely(args)) {
20225 ret = PyObject_CallObject(meth, args);
20226 } else {
20227 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
20228 }
20229 Py_DECREF(meth);
20230 }
20231 gen->is_running = 0;
20232 Py_DECREF(yf);
20233 if (!ret) {
20234 ret = __Pyx_Coroutine_FinishDelegation(gen);
20235 }
20236 return __Pyx_Coroutine_MethodReturn(self, ret);
20237 }
20238 throw_here:
20239 __Pyx_Raise(typ, val, tb, NULL);
20240 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
20241 }
20242 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
20243 PyObject *typ;
20244 PyObject *val = NULL;
20245 PyObject *tb = NULL;
20246 if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
20247 return NULL;
20248 return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
20249 }
20250 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
20251 Py_VISIT(exc_state->exc_type);
20252 Py_VISIT(exc_state->exc_value);
20253 Py_VISIT(exc_state->exc_traceback);
20254 return 0;
20255 }
20256 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
20257 Py_VISIT(gen->closure);
20258 Py_VISIT(gen->classobj);
20259 Py_VISIT(gen->yieldfrom);
20260 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
20261 }
20262 static int __Pyx_Coroutine_clear(PyObject *self) {
20263 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
20264 Py_CLEAR(gen->closure);
20265 Py_CLEAR(gen->classobj);
20266 Py_CLEAR(gen->yieldfrom);
20267 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
20268 #ifdef __Pyx_AsyncGen_USED
20269 if (__Pyx_AsyncGen_CheckExact(self)) {
20270 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
20271 }
20272 #endif
20273 Py_CLEAR(gen->gi_code);
20274 Py_CLEAR(gen->gi_frame);
20275 Py_CLEAR(gen->gi_name);
20276 Py_CLEAR(gen->gi_qualname);
20277 Py_CLEAR(gen->gi_modulename);
20278 return 0;
20279 }
20280 static void __Pyx_Coroutine_dealloc(PyObject *self) {
20281 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
20282 PyObject_GC_UnTrack(gen);
20283 if (gen->gi_weakreflist != NULL)
20284 PyObject_ClearWeakRefs(self);
20285 if (gen->resume_label >= 0) {
20286 PyObject_GC_Track(self);
20287 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
20288 if (PyObject_CallFinalizerFromDealloc(self))
20289 #else
20290 Py_TYPE(gen)->tp_del(self);
20291 if (Py_REFCNT(self) > 0)
20292 #endif
20293 {
20294 return;
20295 }
20296 PyObject_GC_UnTrack(self);
20297 }
20298 #ifdef __Pyx_AsyncGen_USED
20299 if (__Pyx_AsyncGen_CheckExact(self)) {
20300 /* We have to handle this case for asynchronous generators
20301 right here, because this code has to be between UNTRACK
20302 and GC_Del. */
20303 Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
20304 }
20305 #endif
20306 __Pyx_Coroutine_clear(self);
20307 PyObject_GC_Del(gen);
20308 }
20309 static void __Pyx_Coroutine_del(PyObject *self) {
20310 PyObject *error_type, *error_value, *error_traceback;
20311 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
20312 __Pyx_PyThreadState_declare
20313 if (gen->resume_label < 0) {
20314 return;
20315 }
20316 #if !CYTHON_USE_TP_FINALIZE
20317 assert(self->ob_refcnt == 0);
20318 __Pyx_SET_REFCNT(self, 1);
20319 #endif
20320 __Pyx_PyThreadState_assign
20321 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
20322 #ifdef __Pyx_AsyncGen_USED
20323 if (__Pyx_AsyncGen_CheckExact(self)) {
20324 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
20325 PyObject *finalizer = agen->ag_finalizer;
20326 if (finalizer && !agen->ag_closed) {
20327 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
20328 if (unlikely(!res)) {
20329 PyErr_WriteUnraisable(self);
20330 } else {
20331 Py_DECREF(res);
20332 }
20333 __Pyx_ErrRestore(error_type, error_value, error_traceback);
20334 return;
20335 }
20336 }
20337 #endif
20338 if (unlikely(gen->resume_label == 0 && !error_value)) {
20339 #ifdef __Pyx_Coroutine_USED
20340 #ifdef __Pyx_Generator_USED
20341 if (!__Pyx_Generator_CheckExact(self))
20342 #endif
20343 {
20344 PyObject_GC_UnTrack(self);
20345 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
20346 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
20347 PyErr_WriteUnraisable(self);
20348 #else
20349 {PyObject *msg;
20350 char *cmsg;
20351 #if CYTHON_COMPILING_IN_PYPY
20352 msg = NULL;
20353 cmsg = (char*) "coroutine was never awaited";
20354 #else
20355 char *cname;
20356 PyObject *qualname;
20357 qualname = gen->gi_qualname;
20358 cname = PyString_AS_STRING(qualname);
20359 msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
20360 if (unlikely(!msg)) {
20361 PyErr_Clear();
20362 cmsg = (char*) "coroutine was never awaited";
20363 } else {
20364 cmsg = PyString_AS_STRING(msg);
20365 }
20366 #endif
20367 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
20368 PyErr_WriteUnraisable(self);
20369 Py_XDECREF(msg);}
20370 #endif
20371 PyObject_GC_Track(self);
20372 }
20373 #endif
20374 } else {
20375 PyObject *res = __Pyx_Coroutine_Close(self);
20376 if (unlikely(!res)) {
20377 if (PyErr_Occurred())
20378 PyErr_WriteUnraisable(self);
20379 } else {
20380 Py_DECREF(res);
20381 }
20382 }
20383 __Pyx_ErrRestore(error_type, error_value, error_traceback);
20384 #if !CYTHON_USE_TP_FINALIZE
20385 assert(Py_REFCNT(self) > 0);
20386 if (--self->ob_refcnt == 0) {
20387 return;
20388 }
20389 {
20390 Py_ssize_t refcnt = Py_REFCNT(self);
20391 _Py_NewReference(self);
20392 __Pyx_SET_REFCNT(self, refcnt);
20393 }
20394 #if CYTHON_COMPILING_IN_CPYTHON
20395 assert(PyType_IS_GC(Py_TYPE(self)) &&
20396 _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
20397 _Py_DEC_REFTOTAL;
20398 #endif
20399 #ifdef COUNT_ALLOCS
20400 --Py_TYPE(self)->tp_frees;
20401 --Py_TYPE(self)->tp_allocs;
20402 #endif
20403 #endif
20404 }
20405 static PyObject *
20406 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
20407 {
20408 PyObject *name = self->gi_name;
20409 if (unlikely(!name)) name = Py_None;
20410 Py_INCREF(name);
20411 return name;
20412 }
20413 static int
20414 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
20415 {
20416 PyObject *tmp;
20417 #if PY_MAJOR_VERSION >= 3
20418 if (unlikely(value == NULL || !PyUnicode_Check(value)))
20419 #else
20420 if (unlikely(value == NULL || !PyString_Check(value)))
20421 #endif
20422 {
20423 PyErr_SetString(PyExc_TypeError,
20424 "__name__ must be set to a string object");
20425 return -1;
20426 }
20427 tmp = self->gi_name;
20428 Py_INCREF(value);
20429 self->gi_name = value;
20430 Py_XDECREF(tmp);
20431 return 0;
20432 }
20433 static PyObject *
20434 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
20435 {
20436 PyObject *name = self->gi_qualname;
20437 if (unlikely(!name)) name = Py_None;
20438 Py_INCREF(name);
20439 return name;
20440 }
20441 static int
20442 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
20443 {
20444 PyObject *tmp;
20445 #if PY_MAJOR_VERSION >= 3
20446 if (unlikely(value == NULL || !PyUnicode_Check(value)))
20447 #else
20448 if (unlikely(value == NULL || !PyString_Check(value)))
20449 #endif
20450 {
20451 PyErr_SetString(PyExc_TypeError,
20452 "__qualname__ must be set to a string object");
20453 return -1;
20454 }
20455 tmp = self->gi_qualname;
20456 Py_INCREF(value);
20457 self->gi_qualname = value;
20458 Py_XDECREF(tmp);
20459 return 0;
20460 }
20461 static PyObject *
20462 __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
20463 {
20464 PyObject *frame = self->gi_frame;
20465 if (!frame) {
20466 if (unlikely(!self->gi_code)) {
20467 Py_RETURN_NONE;
20468 }
20469 frame = (PyObject *) PyFrame_New(
20470 PyThreadState_Get(), /*PyThreadState *tstate,*/
20471 (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/
20472 __pyx_d, /*PyObject *globals,*/
20473 0 /*PyObject *locals*/
20474 );
20475 if (unlikely(!frame))
20476 return NULL;
20477 self->gi_frame = frame;
20478 }
20479 Py_INCREF(frame);
20480 return frame;
20481 }
20482 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
20483 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
20484 PyObject *name, PyObject *qualname, PyObject *module_name) {
20485 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
20486 if (unlikely(!gen))
20487 return NULL;
20488 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
20489 }
20490 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
20491 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
20492 PyObject *name, PyObject *qualname, PyObject *module_name) {
20493 gen->body = body;
20494 gen->closure = closure;
20495 Py_XINCREF(closure);
20496 gen->is_running = 0;
20497 gen->resume_label = 0;
20498 gen->classobj = NULL;
20499 gen->yieldfrom = NULL;
20500 gen->gi_exc_state.exc_type = NULL;
20501 gen->gi_exc_state.exc_value = NULL;
20502 gen->gi_exc_state.exc_traceback = NULL;
20503 #if CYTHON_USE_EXC_INFO_STACK
20504 gen->gi_exc_state.previous_item = NULL;
20505 #endif
20506 gen->gi_weakreflist = NULL;
20507 Py_XINCREF(qualname);
20508 gen->gi_qualname = qualname;
20509 Py_XINCREF(name);
20510 gen->gi_name = name;
20511 Py_XINCREF(module_name);
20512 gen->gi_modulename = module_name;
20513 Py_XINCREF(code);
20514 gen->gi_code = code;
20515 gen->gi_frame = NULL;
20516 PyObject_GC_Track(gen);
20517 return gen;
20518 }
20519
20520 /* PatchModuleWithCoroutine */
20521 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
20522 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
20523 int result;
20524 PyObject *globals, *result_obj;
20525 globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
20526 result = PyDict_SetItemString(globals, "_cython_coroutine_type",
20527 #ifdef __Pyx_Coroutine_USED
20528 (PyObject*)__pyx_CoroutineType);
20529 #else
20530 Py_None);
20531 #endif
20532 if (unlikely(result < 0)) goto ignore;
20533 result = PyDict_SetItemString(globals, "_cython_generator_type",
20534 #ifdef __Pyx_Generator_USED
20535 (PyObject*)__pyx_GeneratorType);
20536 #else
20537 Py_None);
20538 #endif
20539 if (unlikely(result < 0)) goto ignore;
20540 if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
20541 if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
20542 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
20543 if (unlikely(!result_obj)) goto ignore;
20544 Py_DECREF(result_obj);
20545 Py_DECREF(globals);
20546 return module;
20547 ignore:
20548 Py_XDECREF(globals);
20549 PyErr_WriteUnraisable(module);
20550 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
20551 Py_DECREF(module);
20552 module = NULL;
20553 }
20554 #else
20555 py_code++;
20556 #endif
20557 return module;
20558 }
20559
20560 /* PatchGeneratorABC */
20561 #ifndef CYTHON_REGISTER_ABCS
20562 #define CYTHON_REGISTER_ABCS 1
20563 #endif
20564 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
20565 static PyObject* __Pyx_patch_abc_module(PyObject *module);
20566 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
20567 module = __Pyx_Coroutine_patch_module(
20568 module, ""
20569 "if _cython_generator_type is not None:\n"
20570 " try: Generator = _module.Generator\n"
20571 " except AttributeError: pass\n"
20572 " else: Generator.register(_cython_generator_type)\n"
20573 "if _cython_coroutine_type is not None:\n"
20574 " try: Coroutine = _module.Coroutine\n"
20575 " except AttributeError: pass\n"
20576 " else: Coroutine.register(_cython_coroutine_type)\n"
20577 );
20578 return module;
20579 }
20580 #endif
20581 static int __Pyx_patch_abc(void) {
20582 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
20583 static int abc_patched = 0;
20584 if (CYTHON_REGISTER_ABCS && !abc_patched) {
20585 PyObject *module;
20586 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
20587 if (!module) {
20588 PyErr_WriteUnraisable(NULL);
20589 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
20590 ((PY_MAJOR_VERSION >= 3) ?
20591 "Cython module failed to register with collections.abc module" :
20592 "Cython module failed to register with collections module"), 1) < 0)) {
20593 return -1;
20594 }
20595 } else {
20596 module = __Pyx_patch_abc_module(module);
20597 abc_patched = 1;
20598 if (unlikely(!module))
20599 return -1;
20600 Py_DECREF(module);
20601 }
20602 module = PyImport_ImportModule("backports_abc");
20603 if (module) {
20604 module = __Pyx_patch_abc_module(module);
20605 Py_XDECREF(module);
20606 }
20607 if (!module) {
20608 PyErr_Clear();
20609 }
20610 }
20611 #else
20612 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
20613 #endif
20614 return 0;
20615 }
20616
20617 /* Generator */
20618 static PyMethodDef __pyx_Generator_methods[] = {
20619 {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
20620 (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
20621 {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
20622 (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
20623 {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
20624 (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
20625 {0, 0, 0, 0}
20626 };
20627 static PyMemberDef __pyx_Generator_memberlist[] = {
20628 {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
20629 {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
20630 (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
20631 {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
20632 {0, 0, 0, 0, 0}
20633 };
20634 static PyGetSetDef __pyx_Generator_getsets[] = {
20635 {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
20636 (char*) PyDoc_STR("name of the generator"), 0},
20637 {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
20638 (char*) PyDoc_STR("qualified name of the generator"), 0},
20639 {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
20640 (char*) PyDoc_STR("Frame of the generator"), 0},
20641 {0, 0, 0, 0, 0}
20642 };
20643 static PyTypeObject __pyx_GeneratorType_type = {
20644 PyVarObject_HEAD_INIT(0, 0)
20645 "generator",
20646 sizeof(__pyx_CoroutineObject),
20647 0,
20648 (destructor) __Pyx_Coroutine_dealloc,
20649 0,
20650 0,
20651 0,
20652 0,
20653 0,
20654 0,
20655 0,
20656 0,
20657 0,
20658 0,
20659 0,
20660 0,
20661 0,
20662 0,
20663 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
20664 0,
20665 (traverseproc) __Pyx_Coroutine_traverse,
20666 0,
20667 0,
20668 offsetof(__pyx_CoroutineObject, gi_weakreflist),
20669 0,
20670 (iternextfunc) __Pyx_Generator_Next,
20671 __pyx_Generator_methods,
20672 __pyx_Generator_memberlist,
20673 __pyx_Generator_getsets,
20674 0,
20675 0,
20676 0,
20677 0,
20678 0,
20679 0,
20680 0,
20681 0,
20682 0,
20683 0,
20684 0,
20685 0,
20686 0,
20687 0,
20688 0,
20689 #if CYTHON_USE_TP_FINALIZE
20690 0,
20691 #else
20692 __Pyx_Coroutine_del,
20693 #endif
20694 0,
20695 #if CYTHON_USE_TP_FINALIZE
20696 __Pyx_Coroutine_del,
20697 #elif PY_VERSION_HEX >= 0x030400a1
20698 0,
20699 #endif
20700 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20701 0,
20702 #endif
20703 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20704 0,
20705 #endif
20706 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20707 0,
20708 #endif
20709 };
20710 static int __pyx_Generator_init(void) {
20711 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
20712 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
20713 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
20714 if (unlikely(!__pyx_GeneratorType)) {
20715 return -1;
20716 }
20717 return 0;
20718 }
20719
20720 /* CheckBinaryVersion */
20721 static int __Pyx_check_binary_version(void) {
20722 char ctversion[5];
20723 int same=1, i, found_dot;
20724 const char* rt_from_call = Py_GetVersion();
20725 PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
20726 found_dot = 0;
20727 for (i = 0; i < 4; i++) {
20728 if (!ctversion[i]) {
20729 same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
20730 break;
20731 }
20732 if (rt_from_call[i] != ctversion[i]) {
20733 same = 0;
20734 break;
20735 }
20736 }
20737 if (!same) {
20738 char rtversion[5] = {'\0'};
20739 char message[200];
20740 for (i=0; i<4; ++i) {
20741 if (rt_from_call[i] == '.') {
20742 if (found_dot) break;
20743 found_dot = 1;
20744 } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
20745 break;
20746 }
20747 rtversion[i] = rt_from_call[i];
20748 }
20749 PyOS_snprintf(message, sizeof(message),
20750 "compiletime version %s of module '%.100s' "
20751 "does not match runtime version %s",
20752 ctversion, __Pyx_MODULE_NAME, rtversion);
20753 return PyErr_WarnEx(NULL, message, 1);
20754 }
20755 return 0;
20756 }
20757
20758 /* FunctionExport */
20759 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
20760 PyObject *d = 0;
20761 PyObject *cobj = 0;
20762 union {
20763 void (*fp)(void);
20764 void *p;
20765 } tmp;
20766 d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
20767 if (!d) {
20768 PyErr_Clear();
20769 d = PyDict_New();
20770 if (!d)
20771 goto bad;
20772 Py_INCREF(d);
20773 if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
20774 goto bad;
20775 }
20776 tmp.fp = f;
20777 #if PY_VERSION_HEX >= 0x02070000
20778 cobj = PyCapsule_New(tmp.p, sig, 0);
20779 #else
20780 cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
20781 #endif
20782 if (!cobj)
20783 goto bad;
20784 if (PyDict_SetItemString(d, name, cobj) < 0)
20785 goto bad;
20786 Py_DECREF(cobj);
20787 Py_DECREF(d);
20788 return 0;
20789 bad:
20790 Py_XDECREF(cobj);
20791 Py_XDECREF(d);
20792 return -1;
20793 }
20794
20795 /* InitStrings */
20796 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
20797 while (t->p) {
20798 #if PY_MAJOR_VERSION < 3
20799 if (t->is_unicode) {
20800 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
20801 } else if (t->intern) {
20802 *t->p = PyString_InternFromString(t->s);
20803 } else {
20804 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
20805 }
20806 #else
20807 if (t->is_unicode | t->is_str) {
20808 if (t->intern) {
20809 *t->p = PyUnicode_InternFromString(t->s);
20810 } else if (t->encoding) {
20811 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
20812 } else {
20813 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
20814 }
20815 } else {
20816 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
20817 }
20818 #endif
20819 if (!*t->p)
20820 return -1;
20821 if (PyObject_Hash(*t->p) == -1)
20822 return -1;
20823 ++t;
20824 }
20825 return 0;
20826 }
20827
20828 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
20829 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
20830 }
20831 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
20832 Py_ssize_t ignore;
20833 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
20834 }
20835 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
20836 #if !CYTHON_PEP393_ENABLED
20837 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
20838 char* defenc_c;
20839 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
20840 if (!defenc) return NULL;
20841 defenc_c = PyBytes_AS_STRING(defenc);
20842 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
20843 {
20844 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
20845 char* c;
20846 for (c = defenc_c; c < end; c++) {
20847 if ((unsigned char) (*c) >= 128) {
20848 PyUnicode_AsASCIIString(o);
20849 return NULL;
20850 }
20851 }
20852 }
20853 #endif
20854 *length = PyBytes_GET_SIZE(defenc);
20855 return defenc_c;
20856 }
20857 #else
20858 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
20859 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
20860 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
20861 if (likely(PyUnicode_IS_ASCII(o))) {
20862 *length = PyUnicode_GET_LENGTH(o);
20863 return PyUnicode_AsUTF8(o);
20864 } else {
20865 PyUnicode_AsASCIIString(o);
20866 return NULL;
20867 }
20868 #else
20869 return PyUnicode_AsUTF8AndSize(o, length);
20870 #endif
20871 }
20872 #endif
20873 #endif
20874 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
20875 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
20876 if (
20877 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
20878 __Pyx_sys_getdefaultencoding_not_ascii &&
20879 #endif
20880 PyUnicode_Check(o)) {
20881 return __Pyx_PyUnicode_AsStringAndSize(o, length);
20882 } else
20883 #endif
20884 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
20885 if (PyByteArray_Check(o)) {
20886 *length = PyByteArray_GET_SIZE(o);
20887 return PyByteArray_AS_STRING(o);
20888 } else
20889 #endif
20890 {
20891 char* result;
20892 int r = PyBytes_AsStringAndSize(o, &result, length);
20893 if (unlikely(r < 0)) {
20894 return NULL;
20895 } else {
20896 return result;
20897 }
20898 }
20899 }
20900 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
20901 int is_true = x == Py_True;
20902 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
20903 else return PyObject_IsTrue(x);
20904 }
20905 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
20906 int retval;
20907 if (unlikely(!x)) return -1;
20908 retval = __Pyx_PyObject_IsTrue(x);
20909 Py_DECREF(x);
20910 return retval;
20911 }
20912 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
20913 #if PY_MAJOR_VERSION >= 3
20914 if (PyLong_Check(result)) {
20915 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
20916 "__int__ returned non-int (type %.200s). "
20917 "The ability to return an instance of a strict subclass of int "
20918 "is deprecated, and may be removed in a future version of Python.",
20919 Py_TYPE(result)->tp_name)) {
20920 Py_DECREF(result);
20921 return NULL;
20922 }
20923 return result;
20924 }
20925 #endif
20926 PyErr_Format(PyExc_TypeError,
20927 "__%.4s__ returned non-%.4s (type %.200s)",
20928 type_name, type_name, Py_TYPE(result)->tp_name);
20929 Py_DECREF(result);
20930 return NULL;
20931 }
20932 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
20933 #if CYTHON_USE_TYPE_SLOTS
20934 PyNumberMethods *m;
20935 #endif
20936 const char *name = NULL;
20937 PyObject *res = NULL;
20938 #if PY_MAJOR_VERSION < 3
20939 if (likely(PyInt_Check(x) || PyLong_Check(x)))
20940 #else
20941 if (likely(PyLong_Check(x)))
20942 #endif
20943 return __Pyx_NewRef(x);
20944 #if CYTHON_USE_TYPE_SLOTS
20945 m = Py_TYPE(x)->tp_as_number;
20946 #if PY_MAJOR_VERSION < 3
20947 if (m && m->nb_int) {
20948 name = "int";
20949 res = m->nb_int(x);
20950 }
20951 else if (m && m->nb_long) {
20952 name = "long";
20953 res = m->nb_long(x);
20954 }
20955 #else
20956 if (likely(m && m->nb_int)) {
20957 name = "int";
20958 res = m->nb_int(x);
20959 }
20960 #endif
20961 #else
20962 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
20963 res = PyNumber_Int(x);
20964 }
20965 #endif
20966 if (likely(res)) {
20967 #if PY_MAJOR_VERSION < 3
20968 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
20969 #else
20970 if (unlikely(!PyLong_CheckExact(res))) {
20971 #endif
20972 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
20973 }
20974 }
20975 else if (!PyErr_Occurred()) {
20976 PyErr_SetString(PyExc_TypeError,
20977 "an integer is required");
20978 }
20979 return res;
20980 }
20981 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
20982 Py_ssize_t ival;
20983 PyObject *x;
20984 #if PY_MAJOR_VERSION < 3
20985 if (likely(PyInt_CheckExact(b))) {
20986 if (sizeof(Py_ssize_t) >= sizeof(long))
20987 return PyInt_AS_LONG(b);
20988 else
20989 return PyInt_AsSsize_t(b);
20990 }
20991 #endif
20992 if (likely(PyLong_CheckExact(b))) {
20993 #if CYTHON_USE_PYLONG_INTERNALS
20994 const digit* digits = ((PyLongObject*)b)->ob_digit;
20995 const Py_ssize_t size = Py_SIZE(b);
20996 if (likely(__Pyx_sst_abs(size) <= 1)) {
20997 ival = likely(size) ? digits[0] : 0;
20998 if (size == -1) ival = -ival;
20999 return ival;
21000 } else {
21001 switch (size) {
21002 case 2:
21003 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
21004 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
21005 }
21006 break;
21007 case -2:
21008 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
21009 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
21010 }
21011 break;
21012 case 3:
21013 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
21014 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
21015 }
21016 break;
21017 case -3:
21018 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
21019 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
21020 }
21021 break;
21022 case 4:
21023 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
21024 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]));
21025 }
21026 break;
21027 case -4:
21028 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
21029 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]));
21030 }
21031 break;
21032 }
21033 }
21034 #endif
21035 return PyLong_AsSsize_t(b);
21036 }
21037 x = PyNumber_Index(b);
21038 if (!x) return -1;
21039 ival = PyInt_AsSsize_t(x);
21040 Py_DECREF(x);
21041 return ival;
21042 }
21043 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
21044 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
21045 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
21046 #if PY_MAJOR_VERSION < 3
21047 } else if (likely(PyInt_CheckExact(o))) {
21048 return PyInt_AS_LONG(o);
21049 #endif
21050 } else {
21051 Py_ssize_t ival;
21052 PyObject *x;
21053 x = PyNumber_Index(o);
21054 if (!x) return -1;
21055 ival = PyInt_AsLong(x);
21056 Py_DECREF(x);
21057 return ival;
21058 }
21059 }
21060 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
21061 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
21062 }
21063 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
21064 return PyInt_FromSize_t(ival);
21065 }
21066
21067
21068 #endif /* Py_PYTHON_H */