/* Generated by Cython 0.29.24 */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_24"
#define CYTHON_HEX_VERSION 0x001D18F0
#define CYTHON_FUTURE_DIVISION 0
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #endif
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#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))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__pysdif___pysdif
#define __PYX_HAVE_API__pysdif___pysdif
/* Early includes */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "string.h"
#include "numpy/arrayobject.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#include "numpy/arrayscalars.h"
#include "numpy/ufuncobject.h"

    /* NumPy API declarations from "numpy/__init__.pxd" */
    
#include "sdif.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "pysdif/_pysdif.pyx",
  "stringsource",
  ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd",
  ".eggs/Cython-0.29.24-py3.8-linux-x86_64.egg/Cython/Includes/cpython/type.pxd",
};

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":690
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":691
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":692
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":693
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":697
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":698
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":699
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":700
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":704
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":705
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":714
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":715
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":716
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":718
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":719
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":720
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":722
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":723
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":725
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":726
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":727
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/
struct __pyx_obj_6pysdif_7_pysdif_StreamID;
struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition;
struct __pyx_obj_6pysdif_7_pysdif_Component;
struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition;
struct __pyx_obj_6pysdif_7_pysdif_Matrix;
struct __pyx_obj_6pysdif_7_pysdif_FrameR;
struct __pyx_obj_6pysdif_7_pysdif_FrameW;
struct __pyx_obj_6pysdif_7_pysdif_SdifFile;
struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__;
struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr;
struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames;
struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":729
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":730
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":731
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":733
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new;

/* "pysdif/_pysdif.pyx":571
 * 
 * # enums to keep state of reading
 * cdef enum MatrixStatusE:             # <<<<<<<<<<<<<<
 *     eMatrixInvalid,
 *     eMatrixNothingRead,
 */
enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE {
  __pyx_e_6pysdif_7_pysdif_eMatrixInvalid,
  __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead,
  __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead,
  __pyx_e_6pysdif_7_pysdif_eMatrixDataRead,
  __pyx_e_6pysdif_7_pysdif_eMatrixDataSkipped,
  __pyx_e_6pysdif_7_pysdif_eMatrixOffline
};

/* "pysdif/_pysdif.pyx":579
 *     eMatrixOffline
 * 
 * cdef enum FrameStatusE:             # <<<<<<<<<<<<<<
 *     eFrameInvalid,
 *     eFrameNothingRead,
 */
enum __pyx_t_6pysdif_7_pysdif_FrameStatusE {
  __pyx_e_6pysdif_7_pysdif_eFrameInvalid,
  __pyx_e_6pysdif_7_pysdif_eFrameNothingRead,
  __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead,
  __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead,
  __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead,
  __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead
};

/* "pysdif/_pysdif.pyx":587
 *     eFrameSignatureRead
 * 
 * cdef enum SdifStatusE:             # <<<<<<<<<<<<<<
 *     eSdifNothing,
 *     eSdifGeneralHeader,
 */
enum __pyx_t_6pysdif_7_pysdif_SdifStatusE {
  __pyx_e_6pysdif_7_pysdif_eSdifNothing,
  __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader,
  __pyx_e_6pysdif_7_pysdif_eSdifAllASCIIChunks,
  __pyx_e_6pysdif_7_pysdif_eSdifSignature,
  __pyx_e_6pysdif_7_pysdif_eSdifFrameHeader,
  __pyx_e_6pysdif_7_pysdif_eSdifMatrixHeader,
  __pyx_e_6pysdif_7_pysdif_eSdifMatrixData
};

/* "pysdif/_pysdif.pyx":1052
 * 
 * 
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig,             # <<<<<<<<<<<<<<
 *                        SdifFloat8 time, SdifUInt4 streamID=0):
 *     cdef FrameW f = FrameW()
 */
struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new {
  int __pyx_n;
  SdifUInt4 streamID;
};

/* "pysdif/_pysdif.pyx":247
 *     return streams
 * 
 * cdef class StreamID:             # <<<<<<<<<<<<<<
 *     cdef SdifStreamIDT *this
 *     cdef int own_this
 */
struct __pyx_obj_6pysdif_7_pysdif_StreamID {
  PyObject_HEAD
  SdifStreamIDT *this;
  int own_this;
};


/* "pysdif/_pysdif.pyx":327
 *         raise TypeError("s should be either a str or bytes, got {}".format(type(s)))
 * 
 * cdef class MatrixTypeDefinition:             # <<<<<<<<<<<<<<
 *     cdef public bytes signature
 *     cdef public list column_names
 */
struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_vtab;
  PyObject *signature;
  PyObject *column_names;
};


/* "pysdif/_pysdif.pyx":371
 *     return out
 * 
 * cdef class Component:             # <<<<<<<<<<<<<<
 *     cdef readonly bytes signature
 *     cdef readonly bytes name
 */
struct __pyx_obj_6pysdif_7_pysdif_Component {
  PyObject_HEAD
  PyObject *signature;
  PyObject *name;
  unsigned int num;
};


/* "pysdif/_pysdif.pyx":410
 *     return out
 * 
 * cdef class FrameTypeDefinition:             # <<<<<<<<<<<<<<
 *     cdef readonly bytes signature
 *     cdef readonly list components
 */
struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition {
  PyObject_HEAD
  PyObject *signature;
  PyObject *components;
};


/* "pysdif/_pysdif.pyx":637
 * # -----------------------------------------------------------------------------------------------
 * 
 * cdef class Matrix:             # <<<<<<<<<<<<<<
 *     """
 *     Matrix is a placeholder class to iterate through data while reading a SdifFile
 */
struct __pyx_obj_6pysdif_7_pysdif_Matrix {
  PyObject_HEAD
  SdifFileT *source_this;
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *source;
  PyArrayObject *data;
  SdifSignature _signature;
  enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE _status;
  int _valid;
};


/* "pysdif/_pysdif.pyx":567
 * 
 * # Forward declarations
 * cdef class FrameR             # <<<<<<<<<<<<<<
 * cdef class SdifFile
 * 
 */
struct __pyx_obj_6pysdif_7_pysdif_FrameR {
  PyObject_HEAD
  SdifFrameHeaderT *header;
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *source;
  SdifFileT *source_this;
};


/* "pysdif/_pysdif.pyx":947
 * 
 * 
 * cdef class FrameW:             # <<<<<<<<<<<<<<
 *     """
 *     Class to write frames to a SdifFile
 */
struct __pyx_obj_6pysdif_7_pysdif_FrameW {
  PyObject_HEAD
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *sdiffile;
  SdifSignature signature;
  SdifFloat8 time;
  SdifUInt4 streamID;
  PyObject *matrices;
  PyObject *signatures;
  SdifUInt4 frame_size;
  SdifUInt4 num_matrices;
  int _written;
};


/* "pysdif/_pysdif.pyx":568
 * # Forward declarations
 * cdef class FrameR
 * cdef class SdifFile             # <<<<<<<<<<<<<<
 * 
 * # enums to keep state of reading
 */
struct __pyx_obj_6pysdif_7_pysdif_SdifFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *__pyx_vtab;
  SdifFileT *this;
  int eof;
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *frame;
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *matrix;
  enum __pyx_t_6pysdif_7_pysdif_FrameStatusE frame_status;
  int matrix_idx;
  enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE matrix_status;
  enum __pyx_t_6pysdif_7_pysdif_SdifStatusE write_status;
  PyObject *_frametypes_defined;
  PyObject *_matrixtypes_defined;
};


/* "pysdif/_pysdif.pyx":414
 *     cdef readonly list components
 * 
 *     def __init__(self, signature, components):             # <<<<<<<<<<<<<<
 *         """
 *         Object representing a 1FTD
 */
struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ {
  PyObject_HEAD
  PyObject *__pyx_v_components;
};


/* "pysdif/_pysdif.pyx":425
 *         assert len(signature) == 4
 *         assert isinstance(components, list)
 *         assert all(isinstance(c, Component) for c in components)             # <<<<<<<<<<<<<<
 *         self.signature = asbytes(signature)
 *         self.components = components
 */
struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *__pyx_outer_scope;
  PyObject *__pyx_v_c;
};


/* "pysdif/_pysdif.pyx":2030
 *         return self
 * 
 *     def clone_frames(self, SdifFile source, signatures_to_clone=None):             # <<<<<<<<<<<<<<
 *         """
 *         Clone all the frames in source which are included in
 */
struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames {
  PyObject_HEAD
  PyObject *__pyx_v_signatures_to_clone;
};


/* "pysdif/_pysdif.pyx":2052
 * 
 *         if signatures_to_clone is not None:
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)             # <<<<<<<<<<<<<<
 *         for frame0 in source:
 *             if signatures_to_clone is None or frame0.signature in sigs:
 */
struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *__pyx_outer_scope;
  PyObject *__pyx_v_sig;
};



/* "pysdif/_pysdif.pyx":327
 *         raise TypeError("s should be either a str or bytes, got {}".format(type(s)))
 * 
 * cdef class MatrixTypeDefinition:             # <<<<<<<<<<<<<<
 *     cdef public bytes signature
 *     cdef public list column_names
 */

struct __pyx_vtabstruct_6pysdif_7_pysdif_MatrixTypeDefinition {
  SdifMatrixTypeT *(*toSdifMatrixType)(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *);
};
static struct __pyx_vtabstruct_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_vtabptr_6pysdif_7_pysdif_MatrixTypeDefinition;


/* "pysdif/_pysdif.pyx":1069
 * # -----------------------------------------------------------------------------------------------
 * 
 * cdef class SdifFile:             # <<<<<<<<<<<<<<
 *     """
 *     This is a wrapper around a SdifFileT c-struct (`sdif.h`)
 */

struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile {
  void (*init_read)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*init_containers)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*init_write)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  int (*curr_matrix_numerical_signature)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  int (*_frame_read_header)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  int (*_read_signature)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *, int __pyx_skip_dispatch);
  size_t (*_read_matrix_header)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  int (*_matrix_read_data)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  int (*_finalize_matrix)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*_next_frame)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  int (*_frame_skip_rest)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  int (*_finalize_frame)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*reinit)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
};
static struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *__pyx_vtabptr_6pysdif_7_pysdif_SdifFile;
static CYTHON_INLINE size_t __pyx_f_6pysdif_7_pysdif_8SdifFile__read_matrix_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__matrix_read_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
static CYTHON_INLINE void __pyx_f_6pysdif_7_pysdif_8SdifFile__next_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    (likely((cfunc)->func) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
            (PY_VERSION_HEX >= 0x030700A0 ?\
                (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
                (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
          (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
            (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
            (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
               ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) :\
               __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif

/* py_dict_items.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;  // used by FusedFunction for copying defaults
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* CallUnboundCMethod1.proto */
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

/* CallUnboundCMethod2.proto */
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

/* pyfrozenset_new.proto */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);

/* PySetContains.proto */
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* decode_c_string_utf16.proto */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 0;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = -1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}

/* decode_c_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
         PyObject* string, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    return __Pyx_decode_c_bytes(
        PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
        start, stop, encoding, errors, decode_func);
}

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* GCCDiagnostics.proto */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* Print.proto */
static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SdifUInt4(SdifUInt4 value);

/* CIntFromPy.proto */
static CYTHON_INLINE SdifUInt4 __Pyx_PyInt_As_SdifUInt4(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__SdifFileModeE(enum SdifFileModeE value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__SdifDataTypeE(enum SdifDataTypeE value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_MatrixStatusE(enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum SdifFileModeE __Pyx_PyInt_As_enum__SdifFileModeE(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_FrameStatusE(enum __pyx_t_6pysdif_7_pysdif_FrameStatusE value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SdiffPosT(SdiffPosT value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__SdifErrorTagE(enum SdifErrorTagE value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__SdifErrorLevelE(enum SdifErrorLevelE value);

/* PrintOne.proto */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static SdifMatrixTypeT *__pyx_f_6pysdif_7_pysdif_20MatrixTypeDefinition_toSdifMatrixType(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self); /* proto*/
static void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_read(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_containers(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_write(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static int __pyx_f_6pysdif_7_pysdif_8SdifFile_curr_matrix_numerical_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static int __pyx_f_6pysdif_7_pysdif_8SdifFile__frame_read_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static int __pyx_f_6pysdif_7_pysdif_8SdifFile__read_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static CYTHON_INLINE size_t __pyx_f_6pysdif_7_pysdif_8SdifFile__read_matrix_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__matrix_read_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static CYTHON_INLINE void __pyx_f_6pysdif_7_pysdif_8SdifFile__next_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static int __pyx_f_6pysdif_7_pysdif_8SdifFile__frame_skip_rest(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/
static void __pyx_f_6pysdif_7_pysdif_8SdifFile_reinit(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto*/

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'cpython.buffer' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'cpython' */

/* Module declarations from 'cpython.object' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'cpython.mem' */

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
static PyTypeObject *__pyx_ptype_5numpy_number = 0;
static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
static PyTypeObject *__pyx_ptype_5numpy_character = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;

/* Module declarations from 'pysdif.pysdif' */

/* Module declarations from 'pysdif._pysdif' */
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_StreamID = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_Component = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_FrameR = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_SdifFile = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_Matrix = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_FrameW = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct____init__ = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr = 0;
static int __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED;
static int __pyx_v_6pysdif_7_pysdif__g_sdif_initiated;
static PyObject *__pyx_v_6pysdif_7_pysdif_FILEMODE_STR2MODE = 0;
static PyObject *__pyx_v_6pysdif_7_pysdif_FILEMODE_MODE2STR = 0;
static PyObject *__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES = 0;
static PyObject *__pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM = 0;
static PyObject *__pyx_v_6pysdif_7_pysdif__framestatus2str = 0;
static PyObject *__pyx_v_6pysdif_7_pysdif__matrixstatus2str = 0;
static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_dtype_sdif2numpy(int); /*proto*/
static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(int); /*proto*/
static CYTHON_INLINE unsigned int __pyx_f_6pysdif_7_pysdif_str2sig(char *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pysdif_7_pysdif_sig2str(SdifSignature); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(SdifMatrixDataT *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_copy(SdifMatrixDataT *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pysdif_7_pysdif_bytes_from_sdifstring(SdifStringT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_nvt_to_dict(SdifNameValueTableT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_valuetables_to_dicts(SdifNameValuesLT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_streamidtable_to_list(SdifStreamIDTableT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_StreamID_fromSdifStreadIDT(SdifStreamIDT *); /*proto*/
static SdifMatrixTypeT *__pyx_f_6pysdif_7_pysdif_MatrixType_create(PyObject *, PyObject *); /*proto*/
static SdifFrameTypeT *__pyx_f_6pysdif_7_pysdif_FrameType_create(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pysdif_7_pysdif_asbytes(PyObject *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_MatrixTypesTable_to_list(SdifHashTableT *); /*proto*/
static struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_f_6pysdif_7_pysdif_Component_from_SdifComponent(SdifComponentT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_FrameTypesTable_to_list(SdifHashTableT *); /*proto*/
static struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_f_6pysdif_7_pysdif_FrameW_new(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *, SdifSignature, SdifFloat8, struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif___pyx_unpickle_MatrixTypeDefinition__set_state(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *, PyObject *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif___pyx_unpickle_Component__set_state(struct __pyx_obj_6pysdif_7_pysdif_Component *, PyObject *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif___pyx_unpickle_FrameTypeDefinition__set_state(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *, PyObject *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif___pyx_unpickle_FrameW__set_state(struct __pyx_obj_6pysdif_7_pysdif_FrameW *, PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "pysdif._pysdif"
extern int __pyx_module_is_main_pysdif___pysdif;
int __pyx_module_is_main_pysdif___pysdif = 0;

/* Implementation of 'pysdif._pysdif' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_NameError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_EOFError;
static PyObject *__pyx_builtin_ImportError;
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_w[] = "w";
static const char __pyx_k__4[] = " ";
static const char __pyx_k__5[] = ", ";
static const char __pyx_k__8[] = ".";
static const char __pyx_k__9[] = "";
static const char __pyx_k_ft[] = "ft";
static const char __pyx_k_mt[] = "mt";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_p2[] = "p2";
static const char __pyx_k_pl[] = "pl";
static const char __pyx_k_rw[] = "rw";
static const char __pyx_k_wr[] = "wr";
static const char __pyx_k__17[] = "\n";
static const char __pyx_k__21[] = ",";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_fsz[] = "fsz";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_idx[] = "idx";
static const char __pyx_k_mtd[] = "mtd";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_num[] = "num";
static const char __pyx_k_nvt[] = "nvt";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_sig[] = "sig";
static const char __pyx_k_INFO[] = "INFO";
static const char __pyx_k_RBEP[] = "RBEP";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_char[] = "char";
static const char __pyx_k_cols[] = "cols";
static const char __pyx_k_comp[] = "comp";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_file[] = "__file__";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_int8[] = "int8";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_midx[] = "midx";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_next[] = "__next__";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_rows[] = "rows";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sigs[] = "sigs";
static const char __pyx_k_skip[] = "skip";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_Linux[] = "Linux";
static const char __pyx_k_ascii[] = "ascii";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_debug[] = "debug";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_frame[] = "frame";
static const char __pyx_k_int16[] = "int16";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_int64[] = "int64";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_numid[] = "numid";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_paths[] = "paths";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_strip[] = "strip";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_uint8[] = "uint8";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_Darwin[] = "Darwin";
static const char __pyx_k_FrameR[] = "FrameR";
static const char __pyx_k_FrameW[] = "FrameW";
static const char __pyx_k_Matrix[] = "Matrix";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_exists[] = "exists";
static const char __pyx_k_file_2[] = "file";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_frame0[] = "frame0";
static const char __pyx_k_frame1[] = "frame1";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_logger[] = "logger";
static const char __pyx_k_matrix[] = "matrix";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_pysdif[] = "pysdif";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_resize[] = "resize";
static const char __pyx_k_rewind[] = "rewind";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_status[] = "status";
static const char __pyx_k_system[] = "system";
static const char __pyx_k_uint16[] = "uint16";
static const char __pyx_k_uint32[] = "uint32";
static const char __pyx_k_uint64[] = "uint64";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_Invalid[] = "Invalid";
static const char __pyx_k_NoFrame[] = "NoFrame";
static const char __pyx_k_Offline[] = "Offline";
static const char __pyx_k_Windows[] = "Windows";
static const char __pyx_k_abspath[] = "abspath";
static const char __pyx_k_add_NVT[] = "add_NVT";
static const char __pyx_k_datadir[] = "datadir";
static const char __pyx_k_float32[] = "float32";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_os_path[] = "os.path";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_sdifstr[] = "sdifstr";
static const char __pyx_k_treeway[] = "treeway";
static const char __pyx_k_DataRead[] = "DataRead";
static const char __pyx_k_EOFError[] = "EOFError";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_NoMatrix[] = "NoMatrix";
static const char __pyx_k_SdifFile[] = "SdifFile";
static const char __pyx_k_StreamID[] = "StreamID";
static const char __pyx_k_colnames[] = "colnames";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_frame_id[] = "frame_id";
static const char __pyx_k_get_NVTs[] = "get_NVTs";
static const char __pyx_k_get_data[] = "get_data";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_platform[] = "platform";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_rewind_2[] = "_rewind";
static const char __pyx_k_setLevel[] = "setLevel";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_streamID[] = "streamID";
static const char __pyx_k_thisfile[] = "thisfile";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_Component[] = "Component";
static const char __pyx_k_NameError[] = "NameError";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_bytesread[] = "bytesread";
static const char __pyx_k_frame_sig[] = "frame_sig";
static const char __pyx_k_frametype[] = "frametype";
static const char __pyx_k_getLogger[] = "getLogger";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_matrixsig[] = "matrixsig";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_new_frame[] = "new_frame";
static const char __pyx_k_print_NVT[] = "print_NVT";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_sdif_init[] = "sdif_init";
static const char __pyx_k_signature[] = "signature";
static const char __pyx_k_traceback[] = "traceback";
static const char __pyx_k_usr_share[] = "/usr/share";
static const char __pyx_k_HeaderRead[] = "HeaderRead";
static const char __pyx_k_add_matrix[] = "add_matrix";
static const char __pyx_k_bytes_read[] = "bytes_read";
static const char __pyx_k_clone_NVTs[] = "clone_NVTs";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_data_array[] = "data_array";
static const char __pyx_k_expanduser[] = "expanduser";
static const char __pyx_k_frame_size[] = "frame_size";
static const char __pyx_k_frame_time[] = "frame_time";
static const char __pyx_k_frametypes[] = "frametypes";
static const char __pyx_k_get_matrix[] = "get_matrix";
static const char __pyx_k_last_error[] = "last_error";
static const char __pyx_k_matrix_idx[] = "matrix_idx";
static const char __pyx_k_matrix_sig[] = "matrix_sig";
static const char __pyx_k_matrixdata[] = "matrixdata";
static const char __pyx_k_matrixrole[] = "matrixrole";
static const char __pyx_k_matrixtype[] = "matrixtype";
static const char __pyx_k_next_frame[] = "next_frame";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_AllDataRead[] = "AllDataRead";
static const char __pyx_k_DataSkipped[] = "DataSkipped";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Matrix_skip[] = "Matrix.skip";
static const char __pyx_k_NothingRead[] = "NothingRead";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_local_share[] = "~/.local/share";
static const char __pyx_k_matrix_skip[] = "matrix_skip";
static const char __pyx_k_matrixtypes[] = "matrixtypes";
static const char __pyx_k_next_matrix[] = "next_matrix";
static const char __pyx_k_FrameW_write[] = "FrameW.write";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_SomeDataRead[] = "SomeDataRead";
static const char __pyx_k_add_streamID[] = "add_streamID";
static const char __pyx_k_c_contiguous[] = "c_contiguous";
static const char __pyx_k_clone_frames[] = "clone_frames";
static const char __pyx_k_column_names[] = "column_names";
static const char __pyx_k_get_num_NVTs[] = "get_num_NVTs";
static const char __pyx_k_num_matrices[] = "num_matrices";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_read_padding[] = "_read_padding";
static const char __pyx_k_sdif_cleanup[] = "sdif_cleanup";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_FrameW___exit[] = "FrameW.__exit__";
static const char __pyx_k_SdifFile_NULL[] = "SdifFile(NULL)";
static const char __pyx_k_SignatureRead[] = "SignatureRead";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_allframetypes[] = "allframetypes";
static const char __pyx_k_matrix_status[] = "matrix_status";
static const char __pyx_k_print_one_row[] = "print_one_row";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_signature2str[] = "signature2str";
static const char __pyx_k_str2signature[] = "str2signature";
static const char __pyx_k_FrameW___enter[] = "FrameW.__enter__";
static const char __pyx_k_SdifFile_close[] = "SdifFile.close";
static const char __pyx_k_SdifOrderError[] = "SdifOrderError";
static const char __pyx_k_SdifTypes_STYP[] = "SdifTypes.STYP";
static const char __pyx_k_add_frame_type[] = "add_frame_type";
static const char __pyx_k_allmatrixtypes[] = "allmatrixtypes";
static const char __pyx_k_curr_signature[] = "curr_signature";
static const char __pyx_k_exception_type[] = "exception_type";
static const char __pyx_k_finalize_frame[] = "_finalize_frame";
static const char __pyx_k_find_sdiftypes[] = "_find_sdiftypes";
static const char __pyx_k_frametypeslist[] = "frametypeslist";
static const char __pyx_k_get_stream_IDs[] = "get_stream_IDs";
static const char __pyx_k_pysdif__pysdif[] = "pysdif._pysdif";
static const char __pyx_k_read_sdiftypes[] = "read_sdiftypes";
static const char __pyx_k_read_signature[] = "_read_signature";
static const char __pyx_k_sdiftypes_data[] = "sdiftypes_data";
static const char __pyx_k_sdiftypes_path[] = "sdiftypes_path";
static const char __pyx_k_signaturesture[] = "signaturesture";
static const char __pyx_k_Matrix_get_data[] = "Matrix.get_data";
static const char __pyx_k_SdifFile___exit[] = "SdifFile.__exit__";
static const char __pyx_k_SdifFile___init[] = "SdifFile.__init__";
static const char __pyx_k_SdifFile_rewind[] = "SdifFile.rewind";
static const char __pyx_k_SdifFile_status[] = "SdifFile.status";
static const char __pyx_k_add_matrix_type[] = "add_matrix_type";
static const char __pyx_k_exception_value[] = "exception_value";
static const char __pyx_k_finalize_matrix[] = "finalize_matrix";
static const char __pyx_k_frame_signature[] = "frame_signature";
static const char __pyx_k_frame_skip_data[] = "frame_skip_data";
static const char __pyx_k_frame_skip_rest[] = "frame_skip_rest";
static const char __pyx_k_framestatus2str[] = "framestatus2str";
static const char __pyx_k_get_frame_types[] = "get_frame_types";
static const char __pyx_k_matrixtypeslist[] = "matrixtypeslist";
static const char __pyx_k_predefined_type[] = "predefined_type";
static const char __pyx_k_print_all_types[] = "print_all_types";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_usr_local_share[] = "/usr/local/share";
static const char __pyx_k_Could_not_open_s[] = "Could not open %s";
static const char __pyx_k_Platform_unknown[] = "Platform unknown";
static const char __pyx_k_SdifFile___enter[] = "SdifFile.__enter__";
static const char __pyx_k_SdifFile__rewind[] = "SdifFile._rewind";
static const char __pyx_k_SdifFile_add_NVT[] = "SdifFile.add_NVT";
static const char __pyx_k_SdifFile_dealloc[] = "SdifFile: dealloc";
static const char __pyx_k_curr_matrix_size[] = "curr_matrix_size";
static const char __pyx_k_frame_num_matrix[] = "frame_num_matrix";
static const char __pyx_k_get_matrix_types[] = "get_matrix_types";
static const char __pyx_k_matrix_read_data[] = "matrix_read_data";
static const char __pyx_k_matrix_skip_data[] = "matrix_skip_data";
static const char __pyx_k_matrixstatus2str[] = "matrixstatus2str";
static const char __pyx_k_no_current_frame[] = "no current frame";
static const char __pyx_k_FrameR_get_matrix[] = "FrameR.get_matrix";
static const char __pyx_k_FrameW_add_matrix[] = "FrameW.add_matrix";
static const char __pyx_k_No_current_matrix[] = "No current matrix";
static const char __pyx_k_SdifFile_frame_id[] = "SdifFile.frame_id";
static const char __pyx_k_SdifFile_get_NVTs[] = "SdifFile.get_NVTs";
static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
static const char __pyx_k_clone_definitions[] = "clone_definitions";
static const char __pyx_k_frame_read_header[] = "frame_read_header";
static const char __pyx_k_SdifFile_new_frame[] = "SdifFile.new_frame";
static const char __pyx_k_SdifFile_print_NVT[] = "SdifFile.print_NVT";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_error_opening_file[] = "error opening file";
static const char __pyx_k_matrix_read_header[] = "matrix_read_header";
static const char __pyx_k_packaged_sdiftypes[] = "packaged_sdiftypes";
static const char __pyx_k_print_frame_header[] = "print_frame_header";
static const char __pyx_k_pysdif__pysdif_pyx[] = "pysdif/_pysdif.pyx";
static const char __pyx_k_FrameTypeDefinition[] = "FrameTypeDefinition";
static const char __pyx_k_Matrix_column_names[] = "Matrix.column_names";
static const char __pyx_k_No_current_matrix_2[] = "No current matrix!";
static const char __pyx_k_SdifFile_clone_NVTs[] = "SdifFile.clone_NVTs";
static const char __pyx_k_SdifFile_frame_time[] = "SdifFile.frame_time";
static const char __pyx_k_SdifFile_last_error[] = "SdifFile.last_error";
static const char __pyx_k_SdifFile_next_frame[] = "SdifFile.next_frame";
static const char __pyx_k_frametypes_populate[] = "_frametypes_populate";
static const char __pyx_k_print_all_stream_ID[] = "print_all_stream_ID";
static const char __pyx_k_print_matrix_header[] = "print_matrix_header";
static const char __pyx_k_pyx_unpickle_FrameW[] = "__pyx_unpickle_FrameW";
static const char __pyx_k_signature_not_found[] = "signature not found";
static const char __pyx_k_signatures_to_clone[] = "signatures_to_clone";
static const char __pyx_k_MatrixTypeDefinition[] = "MatrixTypeDefinition";
static const char __pyx_k_SDIF_PREDEFINEDTYPES[] = "SDIF_PREDEFINEDTYPES";
static const char __pyx_k_SdifFile_matrix_skip[] = "SdifFile.matrix_skip";
static const char __pyx_k_SdifFile_next_matrix[] = "SdifFile.next_matrix";
static const char __pyx_k_curr_frame_available[] = "curr_frame_available";
static const char __pyx_k_curr_matrix_datatype[] = "curr_matrix_datatype";
static const char __pyx_k_new_frame_one_matrix[] = "new_frame_one_matrix";
static const char __pyx_k_print_general_header[] = "print_general_header";
static const char __pyx_k_SdifFile_add_streamID[] = "SdifFile.add_streamID";
static const char __pyx_k_SdifFile_clone_frames[] = "SdifFile.clone_frames";
static const char __pyx_k_SdifFile_get_num_NVTs[] = "SdifFile.get_num_NVTs";
static const char __pyx_k_curr_matrix_available[] = "curr_matrix_available";
static const char __pyx_k_curr_matrix_signature[] = "curr_matrix_signature";
static const char __pyx_k_frame_types_to_string[] = "frame_types_to_string";
static const char __pyx_k_init___locals_genexpr[] = "__init__.<locals>.genexpr";
static const char __pyx_k_predefined_frametypes[] = "predefined_frametypes";
static const char __pyx_k_Error_finalizing_Frame[] = "Error finalizing Frame";
static const char __pyx_k_FrameR___reduce_cython[] = "FrameR.__reduce_cython__";
static const char __pyx_k_FrameW___reduce_cython[] = "FrameW.__reduce_cython__";
static const char __pyx_k_Matrix___reduce_cython[] = "Matrix.__reduce_cython__";
static const char __pyx_k_SdifFile__read_padding[] = "SdifFile._read_padding";
static const char __pyx_k_SdifFile_print_one_row[] = "SdifFile.print_one_row";
static const char __pyx_k_clone_type_definitions[] = "clone_type_definitions";
static const char __pyx_k_curr_frame_is_selected[] = "curr_frame_is_selected";
static const char __pyx_k_error_finishing_matrix[] = "error finishing matrix";
static const char __pyx_k_get_packaged_sdiftypes[] = "get_packaged_sdiftypes";
static const char __pyx_k_matrix_types_to_string[] = "matrix_types_to_string";
static const char __pyx_k_predefined_matrixtypes[] = "predefined_matrixtypes";
static const char __pyx_k_print_all_ascii_chunks[] = "print_all_ascii_chunks";
static const char __pyx_k_pyx_unpickle_Component[] = "__pyx_unpickle_Component";
static const char __pyx_k_write_all_ascii_chunks[] = "write_all_ascii_chunks";
static const char __pyx_k_Error_finalizing_matrix[] = "Error finalizing matrix";
static const char __pyx_k_SdifFile_add_frame_type[] = "SdifFile.add_frame_type";
static const char __pyx_k_SdifFile_curr_signature[] = "SdifFile.curr_signature";
static const char __pyx_k_SdifFile_get_stream_IDs[] = "SdifFile.get_stream_IDs";
static const char __pyx_k_curr_matrix_is_selected[] = "curr_matrix_is_selected";
static const char __pyx_k_FrameR___setstate_cython[] = "FrameR.__setstate_cython__";
static const char __pyx_k_FrameW___setstate_cython[] = "FrameW.__setstate_cython__";
static const char __pyx_k_Matrix___setstate_cython[] = "Matrix.__setstate_cython__";
static const char __pyx_k_SdifFile___reduce_cython[] = "SdifFile.__reduce_cython__";
static const char __pyx_k_SdifFile__read_signature[] = "SdifFile._read_signature";
static const char __pyx_k_SdifFile_add_matrix_type[] = "SdifFile.add_matrix_type";
static const char __pyx_k_SdifFile_frame_signature[] = "SdifFile.frame_signature";
static const char __pyx_k_SdifFile_frame_skip_data[] = "SdifFile.frame_skip_data";
static const char __pyx_k_SdifFile_frame_skip_rest[] = "SdifFile.frame_skip_rest";
static const char __pyx_k_SdifFile_get_frame_types[] = "SdifFile.get_frame_types";
static const char __pyx_k_SdifFile_print_all_types[] = "SdifFile.print_all_types";
static const char __pyx_k_StreamID___reduce_cython[] = "StreamID.__reduce_cython__";
static const char __pyx_k_add_predefined_frametype[] = "add_predefined_frametype";
static const char __pyx_k_Component___reduce_cython[] = "Component.__reduce_cython__";
static const char __pyx_k_SdifFile_curr_matrix_size[] = "SdifFile.curr_matrix_size";
static const char __pyx_k_SdifFile_frame_num_matrix[] = "SdifFile.frame_num_matrix";
static const char __pyx_k_SdifFile_get_matrix_types[] = "SdifFile.get_matrix_types";
static const char __pyx_k_SdifFile_matrix_read_data[] = "SdifFile.matrix_read_data";
static const char __pyx_k_SdifFile_matrix_skip_data[] = "SdifFile.matrix_skip_data";
static const char __pyx_k_frame_numerical_signature[] = "frame_numerical_signature";
static const char __pyx_k_Could_not_create_frametype[] = "Could not create frametype";
static const char __pyx_k_SdifFile___setstate_cython[] = "SdifFile.__setstate_cython__";
static const char __pyx_k_SdifFile_clone_definitions[] = "SdifFile.clone_definitions";
static const char __pyx_k_SdifFile_frame_read_header[] = "SdifFile.frame_read_header";
static const char __pyx_k_StreamID___setstate_cython[] = "StreamID.__setstate_cython__";
static const char __pyx_k_Component___setstate_cython[] = "Component.__setstate_cython__";
static const char __pyx_k_Could_not_create_matrixtype[] = "Could not create matrixtype";
static const char __pyx_k_SdifFile_matrix_read_header[] = "SdifFile.matrix_read_header";
static const char __pyx_k_SdifFile_print_frame_header[] = "SdifFile.print_frame_header";
static const char __pyx_k_The_header_was_already_read[] = "The header was already read";
static const char __pyx_k_clone_frames_locals_genexpr[] = "clone_frames.<locals>.genexpr";
static const char __pyx_k_mode_should_be_on_of_r_w_rw[] = "mode should be on of 'r', 'w', 'rw'";
static const char __pyx_k_Could_not_read_matrix_header[] = "Could not read matrix header. ";
static const char __pyx_k_SdifFile_name_name_mode_mode[] = "SdifFile(name={name}, mode={mode})";
static const char __pyx_k_SdifFile_print_all_stream_ID[] = "SdifFile.print_all_stream_ID";
static const char __pyx_k_SdifFile_print_matrix_header[] = "SdifFile.print_matrix_header";
static const char __pyx_k_matrix_skip_no_current_frame[] = "matrix_skip: no current frame";
static const char __pyx_k_1FTD_signature_s_components_s[] = "1FTD(signature='%s', components=%s)";
static const char __pyx_k_SdifFile_curr_frame_available[] = "SdifFile.curr_frame_available";
static const char __pyx_k_SdifFile_curr_matrix_datatype[] = "SdifFile.curr_matrix_datatype";
static const char __pyx_k_SdifFile_new_frame_one_matrix[] = "SdifFile.new_frame_one_matrix";
static const char __pyx_k_SdifFile_print_general_header[] = "SdifFile.print_general_header";
static const char __pyx_k_Sdif_initialized_using_path_s[] = "Sdif initialized using path: %s";
static const char __pyx_k_Frame_has_already_been_written[] = "Frame has already been written!";
static const char __pyx_k_Frame_header_has_not_been_read[] = "Frame header has not been read";
static const char __pyx_k_Matrix_header_was_already_read[] = "Matrix header was already read";
static const char __pyx_k_SdifFile_curr_matrix_available[] = "SdifFile.curr_matrix_available";
static const char __pyx_k_SdifFile_curr_matrix_signature[] = "SdifFile.curr_matrix_signature";
static const char __pyx_k_SdifFile_frame_types_to_string[] = "SdifFile.frame_types_to_string";
static const char __pyx_k_pyx_unpickle_FrameTypeDefiniti[] = "__pyx_unpickle_FrameTypeDefinition";
static const char __pyx_k_pyx_unpickle_MatrixTypeDefinit[] = "__pyx_unpickle_MatrixTypeDefinition";
static const char __pyx_k_1MTD_signature_s_column_names_s[] = "1MTD(signature=%s, column_names=%s)";
static const char __pyx_k_Attempted_to_read_matrix_header[] = "Attempted to read matrix header, but there are no more matrices in this frame";
static const char __pyx_k_Can_t_get_the_data_since_it_was[] = "Can't get the data, since it was already skipped";
static const char __pyx_k_Can_t_skip_the_matrix_status_is[] = "Can't skip the matrix, status is %s";
static const char __pyx_k_GPL_This_file_is_part_of_pysdif[] = "\nGPL \n\nThis file is part of pysdif\n\npysdif is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nFoobar is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with Foobar.  If not, see <http://www.gnu.org/licenses/>.\n";
static const char __pyx_k_Index_Frequency_Amplitude_Phase[] = "Index, Frequency, Amplitude, Phase, Bandwidth, Offset";
static const char __pyx_k_MatrixTypeDefinition___setstate[] = "MatrixTypeDefinition.__setstate_cython__";
static const char __pyx_k_Matrix_data_can_only_be_skipped[] = "Matrix data can only be skipped after reading the matrix header";
static const char __pyx_k_Only_strings_or_bytestrings_are[] = "Only strings or bytestrings are allowed, but found %s of type %s";
static const char __pyx_k_SdifFile_clone_type_definitions[] = "SdifFile.clone_type_definitions";
static const char __pyx_k_SdifFile_curr_frame_is_selected[] = "SdifFile.curr_frame_is_selected";
static const char __pyx_k_SdifFile_matrix_types_to_string[] = "SdifFile.matrix_types_to_string";
static const char __pyx_k_SdifFile_print_all_ascii_chunks[] = "SdifFile.print_all_ascii_chunks";
static const char __pyx_k_SdifFile_write_all_ascii_chunks[] = "SdifFile.write_all_ascii_chunks";
static const char __pyx_k_The_header_of_the_current_frame[] = "The header of the current frame has not been read";
static const char __pyx_k_finalize_frame_called_but_heade[] = "_finalize_frame called, but header was not even read";
static const char __pyx_k_finalize_frame_without_having_r[] = "_finalize_frame without having read everything";
static const char __pyx_k_find_sdiftypes_locals_get_packa[] = "_find_sdiftypes.<locals>.get_packaged_sdiftypes";
static const char __pyx_k_frame_skip_rest_Attempted_to_sk[] = "_frame_skip_rest: Attempted to skip, but everything was read already";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_path_not_found_cannot_open_sdif[] = "path not found, cannot open sdif file for reading";
static const char __pyx_k_A_Frame_can_only_be_iterated_onc[] = "A Frame can only be iterated once";
static const char __pyx_k_Attempted_to_read_past_end_of_fi[] = "Attempted to read past end of file";
static const char __pyx_k_Component_signature_s_name_s_num[] = "Component(signature=%s, name=%s, num=%d)";
static const char __pyx_k_Failed_to_fetch_the_column_names[] = "Failed to fetch the column names for {sig}";
static const char __pyx_k_FrameR_signature_sig_time_t_matr[] = "FrameR(signature={sig}, time={t}, matrices={num}, idx={idx})";
static const char __pyx_k_FrameTypeDefinition___reduce_cyt[] = "FrameTypeDefinition.__reduce_cython__";
static const char __pyx_k_FrameTypeDefinition___setstate_c[] = "FrameTypeDefinition.__setstate_cython__";
static const char __pyx_k_FrameW_signature_s_time_f_stream[] = "FrameW(signature=%s, time=%f, streamID=%d, written=%s)";
static const char __pyx_k_Incompatible_checksums_s_vs_0x0c[] = "Incompatible checksums (%s vs 0x0cc732b = (_written, frame_size, matrices, num_matrices, sdiffile, signature, signatures, streamID, time))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x13[] = "Incompatible checksums (%s vs 0x13edf36 = (name, num, signature))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x36[] = "Incompatible checksums (%s vs 0x3698374 = (components, signature))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x3f[] = "Incompatible checksums (%s vs 0x3fbaffb = (column_names, signature))";
static const char __pyx_k_MatrixTypeDefinition___reduce_cy[] = "MatrixTypeDefinition.__reduce_cython__";
static const char __pyx_k_Matrix_can_only_be_skipped_if_da[] = "Matrix can only be skipped if data has not been already read or skipped";
static const char __pyx_k_Matrix_sig_s_rows_d_cols_d_dtype[] = "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)";
static const char __pyx_k_No_matrices_were_added_Frame_not[] = "No matrices were added! Frame not written";
static const char __pyx_k_Path_s_does_not_exist_can_t_crea[] = "Path %s does not exist, can't create a file";
static const char __pyx_k_RBEP_ReassignedBandEnhancedParti[] = "RBEP ReassignedBandEnhancedPartials";
static const char __pyx_k_SdifFile_add_predefined_frametyp[] = "SdifFile.add_predefined_frametype";
static const char __pyx_k_SdifFile_curr_matrix_is_selected[] = "SdifFile.curr_matrix_is_selected";
static const char __pyx_k_SdifFile_frame_numerical_signatu[] = "SdifFile.frame_numerical_signature";
static const char __pyx_k_Sdif_initialized_without_SdifTyp[] = "Sdif initialized without SdifTypes.";
static const char __pyx_k_Some_data_of_the_matrix_has_been[] = "Some data of the matrix has been read (%s)";
static const char __pyx_k_Status_Frame_frame_MatrixIdx_mid[] = "Status: Frame: {frame}  | MatrixIdx: {midx} | Matrix: {matrix}";
static const char __pyx_k_StreamID_numid_d_source_s_treewa[] = "StreamID(numid=%d, source='%s', treeway='%s')";
static const char __pyx_k_The_frame_should_be_read_or_skip[] = "The frame should be read or skipped before a new header is read";
static const char __pyx_k_This_function_is_only_possible_f[] = "This function is only possible for SdifFiles opened in write mode";
static const char __pyx_k_This_matrix_type_sig_does_not_se[] = "This matrix type ({sig}) does not seem to be defined!";
static const char __pyx_k_Undefined_frametype_sig_You_must[] = "Undefined frametype: {sig}.\nYou must add the frametype definition and thecorresponding matrix definitions before reading";
static const char __pyx_k_close_can_t_close_SdifFile_it_is[] = "close: can't close SdifFile: it is NULL";
static const char __pyx_k_close_can_t_close_SdifFile_since[] = "close: can't close SdifFile, since it was already closed";
static const char __pyx_k_components_should_be_a_seq_of_Co[] = "components should be a seq. of Componentsor tuples(signature, name), but got: %s";
static const char __pyx_k_frame_read_header_finalizing_las[] = "frame_read_header: finalizing last frame";
static const char __pyx_k_frame_skip_data_calling_finalize[] = "frame_skip_data: calling finalize_frame";
static const char __pyx_k_matrix_empty_or_could_not_read_m[] = "matrix empty or could not read matrix data";
static const char __pyx_k_matrix_skip_data_no_current_fram[] = "matrix_skip_data: no current frame";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_s_should_be_either_a_str_or_byte[] = "s should be either a str or bytes, got {}";
static const char __pyx_k_tried_to_finalize_matrix_but_sta[] = "tried to finalize matrix, but status is %s";
static PyObject *__pyx_kp_s_1FTD_signature_s_components_s;
static PyObject *__pyx_kp_s_1MTD_signature_s_column_names_s;
static PyObject *__pyx_kp_s_A_Frame_can_only_be_iterated_onc;
static PyObject *__pyx_n_s_AllDataRead;
static PyObject *__pyx_kp_s_Attempted_to_read_matrix_header;
static PyObject *__pyx_kp_s_Attempted_to_read_past_end_of_fi;
static PyObject *__pyx_kp_s_Can_t_get_the_data_since_it_was;
static PyObject *__pyx_kp_s_Can_t_skip_the_matrix_status_is;
static PyObject *__pyx_n_s_Component;
static PyObject *__pyx_n_s_Component___reduce_cython;
static PyObject *__pyx_n_s_Component___setstate_cython;
static PyObject *__pyx_kp_s_Component_signature_s_name_s_num;
static PyObject *__pyx_kp_s_Could_not_create_frametype;
static PyObject *__pyx_kp_s_Could_not_create_matrixtype;
static PyObject *__pyx_kp_s_Could_not_open_s;
static PyObject *__pyx_kp_s_Could_not_read_matrix_header;
static PyObject *__pyx_n_s_Darwin;
static PyObject *__pyx_n_s_DataRead;
static PyObject *__pyx_n_s_DataSkipped;
static PyObject *__pyx_n_s_EOFError;
static PyObject *__pyx_kp_s_Error_finalizing_Frame;
static PyObject *__pyx_kp_s_Error_finalizing_matrix;
static PyObject *__pyx_kp_s_Failed_to_fetch_the_column_names;
static PyObject *__pyx_n_s_FrameR;
static PyObject *__pyx_n_s_FrameR___reduce_cython;
static PyObject *__pyx_n_s_FrameR___setstate_cython;
static PyObject *__pyx_n_s_FrameR_get_matrix;
static PyObject *__pyx_kp_s_FrameR_signature_sig_time_t_matr;
static PyObject *__pyx_n_s_FrameTypeDefinition;
static PyObject *__pyx_n_s_FrameTypeDefinition___reduce_cyt;
static PyObject *__pyx_n_s_FrameTypeDefinition___setstate_c;
static PyObject *__pyx_n_s_FrameW;
static PyObject *__pyx_n_s_FrameW___enter;
static PyObject *__pyx_n_s_FrameW___exit;
static PyObject *__pyx_n_s_FrameW___reduce_cython;
static PyObject *__pyx_n_s_FrameW___setstate_cython;
static PyObject *__pyx_n_s_FrameW_add_matrix;
static PyObject *__pyx_kp_s_FrameW_signature_s_time_f_stream;
static PyObject *__pyx_n_s_FrameW_write;
static PyObject *__pyx_kp_s_Frame_has_already_been_written;
static PyObject *__pyx_kp_s_Frame_header_has_not_been_read;
static PyObject *__pyx_n_s_HeaderRead;
static PyObject *__pyx_n_s_INFO;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x0c;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x13;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x36;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x3f;
static PyObject *__pyx_kp_b_Index_Frequency_Amplitude_Phase;
static PyObject *__pyx_n_s_Invalid;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_Linux;
static PyObject *__pyx_n_s_Matrix;
static PyObject *__pyx_n_s_MatrixTypeDefinition;
static PyObject *__pyx_n_s_MatrixTypeDefinition___reduce_cy;
static PyObject *__pyx_n_s_MatrixTypeDefinition___setstate;
static PyObject *__pyx_n_s_Matrix___reduce_cython;
static PyObject *__pyx_n_s_Matrix___setstate_cython;
static PyObject *__pyx_kp_s_Matrix_can_only_be_skipped_if_da;
static PyObject *__pyx_n_s_Matrix_column_names;
static PyObject *__pyx_kp_s_Matrix_data_can_only_be_skipped;
static PyObject *__pyx_n_s_Matrix_get_data;
static PyObject *__pyx_kp_s_Matrix_header_was_already_read;
static PyObject *__pyx_kp_s_Matrix_sig_s_rows_d_cols_d_dtype;
static PyObject *__pyx_n_s_Matrix_skip;
static PyObject *__pyx_n_s_NameError;
static PyObject *__pyx_n_s_NoFrame;
static PyObject *__pyx_n_s_NoMatrix;
static PyObject *__pyx_kp_s_No_current_matrix;
static PyObject *__pyx_kp_s_No_current_matrix_2;
static PyObject *__pyx_kp_s_No_matrices_were_added_Frame_not;
static PyObject *__pyx_n_s_NothingRead;
static PyObject *__pyx_n_s_Offline;
static PyObject *__pyx_kp_s_Only_strings_or_bytestrings_are;
static PyObject *__pyx_kp_s_Path_s_does_not_exist_can_t_crea;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_s_Platform_unknown;
static PyObject *__pyx_n_b_RBEP;
static PyObject *__pyx_kp_b_RBEP_ReassignedBandEnhancedParti;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SDIF_PREDEFINEDTYPES;
static PyObject *__pyx_n_s_SdifFile;
static PyObject *__pyx_kp_s_SdifFile_NULL;
static PyObject *__pyx_n_s_SdifFile___enter;
static PyObject *__pyx_n_s_SdifFile___exit;
static PyObject *__pyx_kp_s_SdifFile___init;
static PyObject *__pyx_n_s_SdifFile___reduce_cython;
static PyObject *__pyx_n_s_SdifFile___setstate_cython;
static PyObject *__pyx_n_s_SdifFile__read_padding;
static PyObject *__pyx_n_s_SdifFile__read_signature;
static PyObject *__pyx_n_s_SdifFile__rewind;
static PyObject *__pyx_n_s_SdifFile_add_NVT;
static PyObject *__pyx_n_s_SdifFile_add_frame_type;
static PyObject *__pyx_n_s_SdifFile_add_matrix_type;
static PyObject *__pyx_n_s_SdifFile_add_predefined_frametyp;
static PyObject *__pyx_n_s_SdifFile_add_streamID;
static PyObject *__pyx_n_s_SdifFile_clone_NVTs;
static PyObject *__pyx_n_s_SdifFile_clone_definitions;
static PyObject *__pyx_n_s_SdifFile_clone_frames;
static PyObject *__pyx_n_s_SdifFile_clone_type_definitions;
static PyObject *__pyx_n_s_SdifFile_close;
static PyObject *__pyx_n_s_SdifFile_curr_frame_available;
static PyObject *__pyx_n_s_SdifFile_curr_frame_is_selected;
static PyObject *__pyx_n_s_SdifFile_curr_matrix_available;
static PyObject *__pyx_n_s_SdifFile_curr_matrix_datatype;
static PyObject *__pyx_n_s_SdifFile_curr_matrix_is_selected;
static PyObject *__pyx_n_s_SdifFile_curr_matrix_signature;
static PyObject *__pyx_n_s_SdifFile_curr_matrix_size;
static PyObject *__pyx_n_s_SdifFile_curr_signature;
static PyObject *__pyx_kp_s_SdifFile_dealloc;
static PyObject *__pyx_n_s_SdifFile_frame_id;
static PyObject *__pyx_n_s_SdifFile_frame_num_matrix;
static PyObject *__pyx_n_s_SdifFile_frame_numerical_signatu;
static PyObject *__pyx_n_s_SdifFile_frame_read_header;
static PyObject *__pyx_n_s_SdifFile_frame_signature;
static PyObject *__pyx_n_s_SdifFile_frame_skip_data;
static PyObject *__pyx_n_s_SdifFile_frame_skip_rest;
static PyObject *__pyx_n_s_SdifFile_frame_time;
static PyObject *__pyx_n_s_SdifFile_frame_types_to_string;
static PyObject *__pyx_n_s_SdifFile_get_NVTs;
static PyObject *__pyx_n_s_SdifFile_get_frame_types;
static PyObject *__pyx_n_s_SdifFile_get_matrix_types;
static PyObject *__pyx_n_s_SdifFile_get_num_NVTs;
static PyObject *__pyx_n_s_SdifFile_get_stream_IDs;
static PyObject *__pyx_n_s_SdifFile_last_error;
static PyObject *__pyx_n_s_SdifFile_matrix_read_data;
static PyObject *__pyx_n_s_SdifFile_matrix_read_header;
static PyObject *__pyx_n_s_SdifFile_matrix_skip;
static PyObject *__pyx_n_s_SdifFile_matrix_skip_data;
static PyObject *__pyx_n_s_SdifFile_matrix_types_to_string;
static PyObject *__pyx_kp_s_SdifFile_name_name_mode_mode;
static PyObject *__pyx_n_s_SdifFile_new_frame;
static PyObject *__pyx_n_s_SdifFile_new_frame_one_matrix;
static PyObject *__pyx_n_s_SdifFile_next_frame;
static PyObject *__pyx_n_s_SdifFile_next_matrix;
static PyObject *__pyx_n_s_SdifFile_print_NVT;
static PyObject *__pyx_n_s_SdifFile_print_all_ascii_chunks;
static PyObject *__pyx_n_s_SdifFile_print_all_stream_ID;
static PyObject *__pyx_n_s_SdifFile_print_all_types;
static PyObject *__pyx_n_s_SdifFile_print_frame_header;
static PyObject *__pyx_n_s_SdifFile_print_general_header;
static PyObject *__pyx_n_s_SdifFile_print_matrix_header;
static PyObject *__pyx_n_s_SdifFile_print_one_row;
static PyObject *__pyx_n_s_SdifFile_rewind;
static PyObject *__pyx_n_s_SdifFile_status;
static PyObject *__pyx_n_s_SdifFile_write_all_ascii_chunks;
static PyObject *__pyx_n_s_SdifOrderError;
static PyObject *__pyx_kp_s_SdifTypes_STYP;
static PyObject *__pyx_kp_s_Sdif_initialized_using_path_s;
static PyObject *__pyx_kp_s_Sdif_initialized_without_SdifTyp;
static PyObject *__pyx_n_s_SignatureRead;
static PyObject *__pyx_n_s_SomeDataRead;
static PyObject *__pyx_kp_s_Some_data_of_the_matrix_has_been;
static PyObject *__pyx_kp_s_Status_Frame_frame_MatrixIdx_mid;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_n_s_StreamID;
static PyObject *__pyx_n_s_StreamID___reduce_cython;
static PyObject *__pyx_n_s_StreamID___setstate_cython;
static PyObject *__pyx_kp_s_StreamID_numid_d_source_s_treewa;
static PyObject *__pyx_kp_s_The_frame_should_be_read_or_skip;
static PyObject *__pyx_kp_s_The_header_of_the_current_frame;
static PyObject *__pyx_kp_s_The_header_was_already_read;
static PyObject *__pyx_kp_s_This_function_is_only_possible_f;
static PyObject *__pyx_kp_s_This_matrix_type_sig_does_not_se;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Undefined_frametype_sig_You_must;
static PyObject *__pyx_n_s_Windows;
static PyObject *__pyx_kp_s__17;
static PyObject *__pyx_kp_b__21;
static PyObject *__pyx_kp_b__4;
static PyObject *__pyx_kp_b__5;
static PyObject *__pyx_kp_s__8;
static PyObject *__pyx_kp_s__9;
static PyObject *__pyx_n_s_abspath;
static PyObject *__pyx_n_s_add_NVT;
static PyObject *__pyx_n_s_add_frame_type;
static PyObject *__pyx_n_s_add_matrix;
static PyObject *__pyx_n_s_add_matrix_type;
static PyObject *__pyx_n_s_add_predefined_frametype;
static PyObject *__pyx_n_s_add_streamID;
static PyObject *__pyx_n_s_allframetypes;
static PyObject *__pyx_n_s_allmatrixtypes;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_ascii;
static PyObject *__pyx_n_s_ascontiguousarray;
static PyObject *__pyx_n_s_bytes_read;
static PyObject *__pyx_n_s_bytesread;
static PyObject *__pyx_n_s_c_contiguous;
static PyObject *__pyx_n_s_char;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_clone_NVTs;
static PyObject *__pyx_n_s_clone_definitions;
static PyObject *__pyx_n_s_clone_frames;
static PyObject *__pyx_n_s_clone_frames_locals_genexpr;
static PyObject *__pyx_n_s_clone_type_definitions;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_kp_s_close_can_t_close_SdifFile_it_is;
static PyObject *__pyx_kp_s_close_can_t_close_SdifFile_since;
static PyObject *__pyx_n_s_colnames;
static PyObject *__pyx_n_s_cols;
static PyObject *__pyx_n_s_column_names;
static PyObject *__pyx_n_s_comp;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_kp_s_components_should_be_a_seq_of_Co;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_curr_frame_available;
static PyObject *__pyx_n_s_curr_frame_is_selected;
static PyObject *__pyx_n_s_curr_matrix_available;
static PyObject *__pyx_n_s_curr_matrix_datatype;
static PyObject *__pyx_n_s_curr_matrix_is_selected;
static PyObject *__pyx_n_s_curr_matrix_signature;
static PyObject *__pyx_n_s_curr_matrix_size;
static PyObject *__pyx_n_s_curr_signature;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_data_array;
static PyObject *__pyx_n_s_datadir;
static PyObject *__pyx_n_s_debug;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dict_2;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_kp_s_error_finishing_matrix;
static PyObject *__pyx_kp_s_error_opening_file;
static PyObject *__pyx_n_s_exception_type;
static PyObject *__pyx_n_s_exception_value;
static PyObject *__pyx_n_s_exists;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_expanduser;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_file_2;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_s_finalize_frame;
static PyObject *__pyx_kp_s_finalize_frame_called_but_heade;
static PyObject *__pyx_kp_s_finalize_frame_without_having_r;
static PyObject *__pyx_n_s_finalize_matrix;
static PyObject *__pyx_n_s_find_sdiftypes;
static PyObject *__pyx_n_s_find_sdiftypes_locals_get_packa;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_frame;
static PyObject *__pyx_n_s_frame0;
static PyObject *__pyx_n_s_frame1;
static PyObject *__pyx_n_s_frame_id;
static PyObject *__pyx_n_s_frame_num_matrix;
static PyObject *__pyx_n_s_frame_numerical_signature;
static PyObject *__pyx_n_s_frame_read_header;
static PyObject *__pyx_kp_s_frame_read_header_finalizing_las;
static PyObject *__pyx_n_s_frame_sig;
static PyObject *__pyx_n_s_frame_signature;
static PyObject *__pyx_n_s_frame_size;
static PyObject *__pyx_n_s_frame_skip_data;
static PyObject *__pyx_kp_s_frame_skip_data_calling_finalize;
static PyObject *__pyx_n_s_frame_skip_rest;
static PyObject *__pyx_kp_s_frame_skip_rest_Attempted_to_sk;
static PyObject *__pyx_n_s_frame_time;
static PyObject *__pyx_n_s_frame_types_to_string;
static PyObject *__pyx_n_s_framestatus2str;
static PyObject *__pyx_n_s_frametype;
static PyObject *__pyx_n_s_frametypes;
static PyObject *__pyx_n_s_frametypes_populate;
static PyObject *__pyx_n_s_frametypeslist;
static PyObject *__pyx_n_s_fsz;
static PyObject *__pyx_n_s_ft;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_getLogger;
static PyObject *__pyx_n_s_get_NVTs;
static PyObject *__pyx_n_s_get_data;
static PyObject *__pyx_n_s_get_frame_types;
static PyObject *__pyx_n_s_get_matrix;
static PyObject *__pyx_n_s_get_matrix_types;
static PyObject *__pyx_n_s_get_num_NVTs;
static PyObject *__pyx_n_s_get_packaged_sdiftypes;
static PyObject *__pyx_n_s_get_stream_IDs;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_idx;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_info;
static PyObject *__pyx_n_s_init___locals_genexpr;
static PyObject *__pyx_n_s_int16;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_s_int8;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_last_error;
static PyObject *__pyx_kp_s_local_share;
static PyObject *__pyx_n_s_logger;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_matrix;
static PyObject *__pyx_kp_s_matrix_empty_or_could_not_read_m;
static PyObject *__pyx_n_s_matrix_idx;
static PyObject *__pyx_n_s_matrix_read_data;
static PyObject *__pyx_n_s_matrix_read_header;
static PyObject *__pyx_n_s_matrix_sig;
static PyObject *__pyx_n_s_matrix_skip;
static PyObject *__pyx_n_s_matrix_skip_data;
static PyObject *__pyx_kp_s_matrix_skip_data_no_current_fram;
static PyObject *__pyx_kp_s_matrix_skip_no_current_frame;
static PyObject *__pyx_n_s_matrix_status;
static PyObject *__pyx_n_s_matrix_types_to_string;
static PyObject *__pyx_n_s_matrixdata;
static PyObject *__pyx_n_s_matrixrole;
static PyObject *__pyx_n_s_matrixsig;
static PyObject *__pyx_n_s_matrixstatus2str;
static PyObject *__pyx_n_s_matrixtype;
static PyObject *__pyx_n_s_matrixtypes;
static PyObject *__pyx_n_s_matrixtypeslist;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_midx;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_kp_s_mode_should_be_on_of_r_w_rw;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mt;
static PyObject *__pyx_n_s_mtd;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_new_frame;
static PyObject *__pyx_n_s_new_frame_one_matrix;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_next_frame;
static PyObject *__pyx_n_s_next_matrix;
static PyObject *__pyx_kp_s_no_current_frame;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_num;
static PyObject *__pyx_n_s_num_matrices;
static PyObject *__pyx_n_s_numid;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_nvt;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_os_path;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_p2;
static PyObject *__pyx_n_s_packaged_sdiftypes;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_kp_s_path_not_found_cannot_open_sdif;
static PyObject *__pyx_n_s_paths;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_pl;
static PyObject *__pyx_n_s_platform;
static PyObject *__pyx_n_s_predefined_frametypes;
static PyObject *__pyx_n_s_predefined_matrixtypes;
static PyObject *__pyx_n_s_predefined_type;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_print_NVT;
static PyObject *__pyx_n_s_print_all_ascii_chunks;
static PyObject *__pyx_n_s_print_all_stream_ID;
static PyObject *__pyx_n_s_print_all_types;
static PyObject *__pyx_n_s_print_frame_header;
static PyObject *__pyx_n_s_print_general_header;
static PyObject *__pyx_n_s_print_matrix_header;
static PyObject *__pyx_n_s_print_one_row;
static PyObject *__pyx_n_s_pysdif;
static PyObject *__pyx_n_s_pysdif__pysdif;
static PyObject *__pyx_kp_s_pysdif__pysdif_pyx;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Component;
static PyObject *__pyx_n_s_pyx_unpickle_FrameTypeDefiniti;
static PyObject *__pyx_n_s_pyx_unpickle_FrameW;
static PyObject *__pyx_n_s_pyx_unpickle_MatrixTypeDefinit;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_read_padding;
static PyObject *__pyx_n_s_read_sdiftypes;
static PyObject *__pyx_n_s_read_signature;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_resize;
static PyObject *__pyx_n_s_rewind;
static PyObject *__pyx_n_s_rewind_2;
static PyObject *__pyx_n_s_rows;
static PyObject *__pyx_n_s_rw;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_kp_s_s_should_be_either_a_str_or_byte;
static PyObject *__pyx_n_s_sdif_cleanup;
static PyObject *__pyx_n_s_sdif_init;
static PyObject *__pyx_n_s_sdifstr;
static PyObject *__pyx_n_s_sdiftypes_data;
static PyObject *__pyx_n_s_sdiftypes_path;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_setLevel;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_sig;
static PyObject *__pyx_n_s_signature;
static PyObject *__pyx_n_s_signature2str;
static PyObject *__pyx_kp_s_signature_not_found;
static PyObject *__pyx_n_s_signatures_to_clone;
static PyObject *__pyx_n_s_signaturesture;
static PyObject *__pyx_n_s_sigs;
static PyObject *__pyx_n_s_skip;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_status;
static PyObject *__pyx_n_s_str2signature;
static PyObject *__pyx_n_s_streamID;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_system;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_thisfile;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_n_s_treeway;
static PyObject *__pyx_kp_s_tried_to_finalize_matrix_but_sta;
static PyObject *__pyx_n_s_uint16;
static PyObject *__pyx_n_s_uint32;
static PyObject *__pyx_n_s_uint64;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_use_setstate;
static PyObject *__pyx_kp_s_usr_local_share;
static PyObject *__pyx_kp_s_usr_share;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_wr;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_write_all_ascii_chunks;
static PyObject *__pyx_pf_6pysdif_7_pysdif_signature2str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_sig); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_2str2signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_5numid___get__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_6source___get__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_7treeway___get__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_8StreamID___cinit__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self, int __pyx_v_numid, PyObject *__pyx_v_source, PyObject *__pyx_v_treeway); /* proto */
static void __pyx_pf_6pysdif_7_pysdif_8StreamID_2__dealloc__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_4__repr__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___init__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_column_names); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_2__repr__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_2__set__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_4__del__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___get__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_2__set__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_4__del__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_4__reduce_cython__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_6__setstate_cython__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_9Component___init__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_name, PyObject *__pyx_v_num); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_2__repr__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_4name___get__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_3num___get__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_4__reduce_cython__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_6__setstate_cython__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_8__init___genexpr(PyObject *__pyx_self); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___init__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_components); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_2__repr__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_4__reduce_cython__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_6__setstate_cython__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_4read_sdiftypes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6_frametypes_populate(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8predefined_frametypes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_10predefined_matrixtypes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_15_find_sdiftypes_get_packaged_sdiftypes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_12_find_sdiftypes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_14sdif_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sdiftypes_path); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_16sdif_cleanup(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_18framestatus2str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_status); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_20matrixstatus2str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_status); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_6Matrix___cinit__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4rows___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4cols___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_5dtype___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_19numerical_signature___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_2get_data(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self, PyObject *__pyx_v_copy); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4column_names(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_6skip(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_8__repr__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_6status___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_6FrameR___cinit__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source); /* proto */
static void __pyx_pf_6pysdif_7_pysdif_6FrameR_2__dealloc__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4__repr__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_19numerical_signature___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4size___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_12num_matrices___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_6pysdif_7_pysdif_6FrameR_6__len__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_2id___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4time___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_10matrix_idx___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_8__iter__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_10__next__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_12get_matrix(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self, PyObject *__pyx_v_copy); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW___repr__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_2__enter__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_4__exit__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exception_type, CYTHON_UNUSED PyObject *__pyx_v_exception_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_7written___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_6add_matrix(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self, PyObject *__pyx_v_signature, PyArrayObject *__pyx_v_data_array); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_8write(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_10__reduce_cython__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_12__setstate_cython__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_8SdifFile___cinit__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, CYTHON_UNUSED PyObject *__pyx_v_predefined_type); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_8SdifFile_2__init__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_filename, CYTHON_UNUSED PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4__repr__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static void __pyx_pf_6pysdif_7_pysdif_8SdifFile_6__dealloc__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_8close(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4name___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4mode___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_11is_seekable___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_19numerical_signature___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9prev_time___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9frame_pos___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_10curr_matrix_size(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_12curr_matrix_datatype(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_14curr_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_16curr_matrix_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_18frame_num_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_20frame_id(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static int __pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos_2__set__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, long __pyx_v_pos); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_22frame_numerical_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_24frame_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_26frame_time(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_28last_error(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_30curr_frame_is_selected(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_32curr_matrix_is_selected(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_34get_num_NVTs(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_36frame_read_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_38frame_skip_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_40_read_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_42matrix_read_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_44curr_frame_available(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_46curr_matrix_available(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_48matrix_skip_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_50matrix_read_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_copy); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_52matrix_skip(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_54status(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_56__iter__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_58__next__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_60next_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_62__enter__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_64__exit__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_66frame_skip_rest(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_68next_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_70rewind(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_72_rewind(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_74_read_padding(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_76add_NVT(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_78add_matrix_type(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_column_names); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_80add_frame_type(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_components); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_82clone_type_definitions(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_84clone_NVTs(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_86clone_definitions(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_12clone_frames_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_88clone_frames(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source, PyObject *__pyx_v_signatures_to_clone); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_90add_streamID(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, unsigned int __pyx_v_numid, char *__pyx_v_source, char *__pyx_v_treeway); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_92add_predefined_frametype(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_signature); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_94write_all_ascii_chunks(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_96new_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_signature, SdifFloat8 __pyx_v_time, SdifUInt4 __pyx_v_streamID); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_98new_frame_one_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_frame_sig, SdifFloat8 __pyx_v_time, PyObject *__pyx_v_matrix_sig, PyArrayObject *__pyx_v_matrixdata, SdifUInt4 __pyx_v_streamID); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_100print_NVT(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_102print_general_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_104print_all_ascii_chunks(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_106print_all_types(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_108print_matrix_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_110print_one_row(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_112print_frame_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_114print_all_stream_ID(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_116frame_types_to_string(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_118get_frame_types(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_120matrix_types_to_string(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_122get_matrix_types(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_124get_NVTs(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_126get_stream_IDs(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_3eof___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_130__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_22__pyx_unpickle_MatrixTypeDefinition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_24__pyx_unpickle_Component(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_26__pyx_unpickle_FrameTypeDefinition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6pysdif_7_pysdif_28__pyx_unpickle_FrameW(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_6pysdif_7_pysdif_StreamID(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif_MatrixTypeDefinition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif_Component(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameTypeDefinition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameR(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif_SdifFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif_Matrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameW(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct____init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyBytes_Type_split = {0, &__pyx_n_s_split, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_257;
static PyObject *__pyx_int_258;
static PyObject *__pyx_int_260;
static PyObject *__pyx_int_264;
static PyObject *__pyx_int_513;
static PyObject *__pyx_int_514;
static PyObject *__pyx_int_516;
static PyObject *__pyx_int_520;
static PyObject *__pyx_int_769;
static PyObject *__pyx_int_13398827;
static PyObject *__pyx_int_20897590;
static PyObject *__pyx_int_57246580;
static PyObject *__pyx_int_66826235;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_codeobj__7;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_codeobj__33;
static PyObject *__pyx_codeobj__35;
static PyObject *__pyx_codeobj__37;
static PyObject *__pyx_codeobj__39;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__45;
static PyObject *__pyx_codeobj__47;
static PyObject *__pyx_codeobj__49;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__56;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__71;
static PyObject *__pyx_codeobj__73;
static PyObject *__pyx_codeobj__75;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__83;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__105;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__109;
static PyObject *__pyx_codeobj__111;
static PyObject *__pyx_codeobj__113;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__119;
static PyObject *__pyx_codeobj__121;
static PyObject *__pyx_codeobj__123;
static PyObject *__pyx_codeobj__125;
static PyObject *__pyx_codeobj__127;
static PyObject *__pyx_codeobj__129;
static PyObject *__pyx_codeobj__131;
static PyObject *__pyx_codeobj__133;
static PyObject *__pyx_codeobj__135;
static PyObject *__pyx_codeobj__137;
static PyObject *__pyx_codeobj__139;
static PyObject *__pyx_codeobj__141;
static PyObject *__pyx_codeobj__143;
static PyObject *__pyx_codeobj__145;
static PyObject *__pyx_codeobj__147;
static PyObject *__pyx_codeobj__149;
static PyObject *__pyx_codeobj__151;
static PyObject *__pyx_codeobj__153;
static PyObject *__pyx_codeobj__155;
static PyObject *__pyx_codeobj__157;
static PyObject *__pyx_codeobj__159;
static PyObject *__pyx_codeobj__161;
static PyObject *__pyx_codeobj__163;
static PyObject *__pyx_codeobj__165;
static PyObject *__pyx_codeobj__167;
static PyObject *__pyx_codeobj__169;
static PyObject *__pyx_codeobj__171;
static PyObject *__pyx_codeobj__173;
static PyObject *__pyx_codeobj__175;
static PyObject *__pyx_codeobj__177;
static PyObject *__pyx_codeobj__179;
static PyObject *__pyx_codeobj__181;
static PyObject *__pyx_codeobj__183;
static PyObject *__pyx_codeobj__185;
static PyObject *__pyx_codeobj__187;
static PyObject *__pyx_codeobj__189;
static PyObject *__pyx_codeobj__191;
static PyObject *__pyx_codeobj__193;
static PyObject *__pyx_codeobj__195;
static PyObject *__pyx_codeobj__197;
static PyObject *__pyx_codeobj__199;
static PyObject *__pyx_codeobj__201;
static PyObject *__pyx_codeobj__203;
static PyObject *__pyx_codeobj__205;
static PyObject *__pyx_codeobj__207;
static PyObject *__pyx_codeobj__209;
static PyObject *__pyx_codeobj__211;
static PyObject *__pyx_codeobj__213;
static PyObject *__pyx_codeobj__215;
static PyObject *__pyx_codeobj__217;
static PyObject *__pyx_codeobj__219;
static PyObject *__pyx_codeobj__221;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__225;
/* Late includes */

/* "pysdif/_pysdif.pyx":104
 *     }
 * 
 * cdef inline int dtype_sdif2numpy(int typenum):             # <<<<<<<<<<<<<<
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 */

static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_dtype_sdif2numpy(int __pyx_v_typenum) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dtype_sdif2numpy", 0);

  /* "pysdif/_pysdif.pyx":105
 * 
 * cdef inline int dtype_sdif2numpy(int typenum):
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE
 */
  switch (__pyx_v_typenum) {
    case 0x0004:
    __pyx_v_typenum = NPY_FLOAT;
    break;
    case 0x0301:

    /* "pysdif/_pysdif.pyx":106
 * cdef inline int dtype_sdif2numpy(int typenum):
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT
 */
    __pyx_v_typenum = NPY_BYTE;
    break;
    case 0x0008:

    /* "pysdif/_pysdif.pyx":107
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE
 */
    __pyx_v_typenum = NPY_DOUBLE;
    break;
    case 0x0104:

    /* "pysdif/_pysdif.pyx":108
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT
 */
    __pyx_v_typenum = NPY_INT;
    break;
    case 0x0101:

    /* "pysdif/_pysdif.pyx":109
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG
 */
    __pyx_v_typenum = NPY_BYTE;
    break;
    case 0x0102:

    /* "pysdif/_pysdif.pyx":110
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE
 */
    __pyx_v_typenum = NPY_SHORT;
    break;
    case 0x0108:

    /* "pysdif/_pysdif.pyx":111
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT
 */
    __pyx_v_typenum = NPY_LONG;
    break;
    case 0x0201:

    /* "pysdif/_pysdif.pyx":112
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT
 */
    __pyx_v_typenum = NPY_UBYTE;
    break;
    case 0x0202:

    /* "pysdif/_pysdif.pyx":113
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT
 *     elif typenum == 0x0208: typenum = c_numpy.NPY_ULONG
 */
    __pyx_v_typenum = NPY_USHORT;
    break;
    case 0x0204:

    /* "pysdif/_pysdif.pyx":114
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0208: typenum = c_numpy.NPY_ULONG
 *     return typenum
 */
    __pyx_v_typenum = NPY_UINT;
    break;
    case 0x0208:

    /* "pysdif/_pysdif.pyx":115
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT
 *     elif typenum == 0x0208: typenum = c_numpy.NPY_ULONG             # <<<<<<<<<<<<<<
 *     return typenum
 * 
 */
    __pyx_v_typenum = NPY_ULONG;
    break;
    default: break;
  }

  /* "pysdif/_pysdif.pyx":116
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT
 *     elif typenum == 0x0208: typenum = c_numpy.NPY_ULONG
 *     return typenum             # <<<<<<<<<<<<<<
 * 
 * cdef inline int dtype_numpy2sdif(int dtype):
 */
  __pyx_r = __pyx_v_typenum;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":104
 *     }
 * 
 * cdef inline int dtype_sdif2numpy(int typenum):             # <<<<<<<<<<<<<<
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":118
 *     return typenum
 * 
 * cdef inline int dtype_numpy2sdif(int dtype):             # <<<<<<<<<<<<<<
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 */

static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(int __pyx_v_dtype) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("dtype_numpy2sdif", 0);

  /* "pysdif/_pysdif.pyx":119
 * 
 * cdef inline int dtype_numpy2sdif(int dtype):
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_FLOAT) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0004;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":120
 * cdef inline int dtype_numpy2sdif(int dtype):
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_BYTE) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0301;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":121
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_DOUBLE) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0008;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":122
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_INT) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0104;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":123
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_BYTE) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0101;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":124
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_SHORT) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0102;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":125
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_LONG) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0108;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":126
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_UBYTE) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0201;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":127
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204
 *     elif dtype == c_numpy.NPY_ULONG : dtype = 0x0208
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_USHORT) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0202;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":128
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_ULONG : dtype = 0x0208
 *     return dtype
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_UINT) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0204;
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":129
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204
 *     elif dtype == c_numpy.NPY_ULONG : dtype = 0x0208             # <<<<<<<<<<<<<<
 *     return dtype
 * 
 */
  __pyx_t_1 = ((__pyx_v_dtype == NPY_ULONG) != 0);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0208;
  }
  __pyx_L3:;

  /* "pysdif/_pysdif.pyx":130
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204
 *     elif dtype == c_numpy.NPY_ULONG : dtype = 0x0208
 *     return dtype             # <<<<<<<<<<<<<<
 * 
 * cdef inline unsigned int str2sig (char *sig):
 */
  __pyx_r = __pyx_v_dtype;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":118
 *     return typenum
 * 
 * cdef inline int dtype_numpy2sdif(int dtype):             # <<<<<<<<<<<<<<
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":132
 *     return dtype
 * 
 * cdef inline unsigned int str2sig (char *sig):             # <<<<<<<<<<<<<<
 *    return ((((<unsigned int>(sig[0])) & 0xff) << 24) |
 *        (((<unsigned int>(sig[1])) & 0xff) << 16) |
 */

static CYTHON_INLINE unsigned int __pyx_f_6pysdif_7_pysdif_str2sig(char *__pyx_v_sig) {
  unsigned int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("str2sig", 0);

  /* "pysdif/_pysdif.pyx":135
 *    return ((((<unsigned int>(sig[0])) & 0xff) << 24) |
 *        (((<unsigned int>(sig[1])) & 0xff) << 16) |
 *        (((<unsigned int>(sig[2])) & 0xff) << 8) |             # <<<<<<<<<<<<<<
 *        ((<unsigned int>(sig[3])) & 0xff))
 * 
 */
  __pyx_r = (((((((unsigned int)(__pyx_v_sig[0])) & 0xff) << 24) | ((((unsigned int)(__pyx_v_sig[1])) & 0xff) << 16)) | ((((unsigned int)(__pyx_v_sig[2])) & 0xff) << 8)) | (((unsigned int)(__pyx_v_sig[3])) & 0xff));
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":132
 *     return dtype
 * 
 * cdef inline unsigned int str2sig (char *sig):             # <<<<<<<<<<<<<<
 *    return ((((<unsigned int>(sig[0])) & 0xff) << 24) |
 *        (((<unsigned int>(sig[1])) & 0xff) << 16) |
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":141
 * #    return PyString_FromStringAndSize(SdifSignatureToString(signature), 4)
 * 
 * cdef inline bytes sig2str(SdifSignature signature):             # <<<<<<<<<<<<<<
 *     cdef char* c_str = SdifSignatureToString(signature)
 *     cdef bytes out = c_str[:4]
 */

static CYTHON_INLINE PyObject *__pyx_f_6pysdif_7_pysdif_sig2str(SdifSignature __pyx_v_signature) {
  char *__pyx_v_c_str;
  PyObject *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sig2str", 0);

  /* "pysdif/_pysdif.pyx":142
 * 
 * cdef inline bytes sig2str(SdifSignature signature):
 *     cdef char* c_str = SdifSignatureToString(signature)             # <<<<<<<<<<<<<<
 *     cdef bytes out = c_str[:4]
 *     return out
 */
  __pyx_v_c_str = SdifSignatureToString(__pyx_v_signature);

  /* "pysdif/_pysdif.pyx":143
 * cdef inline bytes sig2str(SdifSignature signature):
 *     cdef char* c_str = SdifSignatureToString(signature)
 *     cdef bytes out = c_str[:4]             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_str + 0, 4 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":144
 *     cdef char* c_str = SdifSignatureToString(signature)
 *     cdef bytes out = c_str[:4]
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":141
 * #    return PyString_FromStringAndSize(SdifSignatureToString(signature), 4)
 * 
 * cdef inline bytes sig2str(SdifSignature signature):             # <<<<<<<<<<<<<<
 *     cdef char* c_str = SdifSignatureToString(signature)
 *     cdef bytes out = c_str[:4]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.sig2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":147
 * 
 * 
 * def signature2str(int sig):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a numeric signature into a string signature
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_1signature2str(PyObject *__pyx_self, PyObject *__pyx_arg_sig); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_signature2str[] = "signature2str(int sig)\n\n    Converts a numeric signature into a string signature\n\n    Args:\n        sig (int): Numeric signature\n\n    Returns:\n        (str) The string signature corresponding to the numeric signature\n    ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_1signature2str = {"signature2str", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_1signature2str, METH_O, __pyx_doc_6pysdif_7_pysdif_signature2str};
static PyObject *__pyx_pw_6pysdif_7_pysdif_1signature2str(PyObject *__pyx_self, PyObject *__pyx_arg_sig) {
  int __pyx_v_sig;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("signature2str (wrapper)", 0);
  assert(__pyx_arg_sig); {
    __pyx_v_sig = __Pyx_PyInt_As_int(__pyx_arg_sig); if (unlikely((__pyx_v_sig == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.signature2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_signature2str(__pyx_self, ((int)__pyx_v_sig));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_signature2str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_sig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("signature2str", 0);

  /* "pysdif/_pysdif.pyx":157
 *         (str) The string signature corresponding to the numeric signature
 *     """
 *     return sig2str(sig)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_sig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":147
 * 
 * 
 * def signature2str(int sig):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a numeric signature into a string signature
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.signature2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":160
 * 
 * 
 * def str2signature(s):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a 4-byte string signature into a numeric signature
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_3str2signature(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_2str2signature[] = "str2signature(s)\n\n    Converts a 4-byte string signature into a numeric signature\n\n    Args:\n        s (str): a string of 4 characters \n\n    Returns:\n        (int) The numeric signature corresponding to the string signature\n    ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_3str2signature = {"str2signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_3str2signature, METH_O, __pyx_doc_6pysdif_7_pysdif_2str2signature};
static PyObject *__pyx_pw_6pysdif_7_pysdif_3str2signature(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("str2signature (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_2str2signature(__pyx_self, ((PyObject *)__pyx_v_s));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_2str2signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("str2signature", 0);

  /* "pysdif/_pysdif.pyx":170
 *         (int) The numeric signature corresponding to the string signature
 *     """
 *     return str2sig(asbytes(s))             # <<<<<<<<<<<<<<
 * 
 * cdef inline ndarray _array_from_matrix_data_no_copy(SdifMatrixDataT *matrix):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 170, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":160
 * 
 * 
 * def str2signature(s):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a 4-byte string signature into a numeric signature
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.str2signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":172
 *     return str2sig(asbytes(s))
 * 
 * cdef inline ndarray _array_from_matrix_data_no_copy(SdifMatrixDataT *matrix):             # <<<<<<<<<<<<<<
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 *     cdef npy_intp dims[2]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(SdifMatrixDataT *__pyx_v_matrix) {
  SdifMatrixHeaderT *__pyx_v_header;
  npy_intp __pyx_v_dims[2];
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  SdifMatrixHeaderT *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_array_from_matrix_data_no_copy", 0);

  /* "pysdif/_pysdif.pyx":173
 * 
 * cdef inline ndarray _array_from_matrix_data_no_copy(SdifMatrixDataT *matrix):
 *     cdef SdifMatrixHeaderT *header = matrix.Header             # <<<<<<<<<<<<<<
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow
 */
  __pyx_t_1 = __pyx_v_matrix->Header;
  __pyx_v_header = __pyx_t_1;

  /* "pysdif/_pysdif.pyx":175
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow             # <<<<<<<<<<<<<<
 *     dims[1] = <npy_intp>header.NbCol
 *     return PyArray_SimpleNewFromData(2, dims, dtype_sdif2numpy(header.DataType), matrix.Data.Void)
 */
  (__pyx_v_dims[0]) = ((npy_intp)__pyx_v_header->NbRow);

  /* "pysdif/_pysdif.pyx":176
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow
 *     dims[1] = <npy_intp>header.NbCol             # <<<<<<<<<<<<<<
 *     return PyArray_SimpleNewFromData(2, dims, dtype_sdif2numpy(header.DataType), matrix.Data.Void)
 * 
 */
  (__pyx_v_dims[1]) = ((npy_intp)__pyx_v_header->NbCol);

  /* "pysdif/_pysdif.pyx":177
 *     dims[0] = <npy_intp>header.NbRow
 *     dims[1] = <npy_intp>header.NbCol
 *     return PyArray_SimpleNewFromData(2, dims, dtype_sdif2numpy(header.DataType), matrix.Data.Void)             # <<<<<<<<<<<<<<
 * 
 * cdef inline ndarray _array_from_matrix_data_copy(SdifMatrixDataT *matrix):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = PyArray_SimpleNewFromData(2, __pyx_v_dims, __pyx_f_6pysdif_7_pysdif_dtype_sdif2numpy(__pyx_v_header->DataType), __pyx_v_matrix->Data.Void); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 177, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":172
 *     return str2sig(asbytes(s))
 * 
 * cdef inline ndarray _array_from_matrix_data_no_copy(SdifMatrixDataT *matrix):             # <<<<<<<<<<<<<<
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 *     cdef npy_intp dims[2]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif._array_from_matrix_data_no_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":179
 *     return PyArray_SimpleNewFromData(2, dims, dtype_sdif2numpy(header.DataType), matrix.Data.Void)
 * 
 * cdef inline ndarray _array_from_matrix_data_copy(SdifMatrixDataT *matrix):             # <<<<<<<<<<<<<<
 *     cdef ndarray out
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_copy(SdifMatrixDataT *__pyx_v_matrix) {
  PyArrayObject *__pyx_v_out = 0;
  SdifMatrixHeaderT *__pyx_v_header;
  npy_intp __pyx_v_dims[2];
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  SdifMatrixHeaderT *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_array_from_matrix_data_copy", 0);

  /* "pysdif/_pysdif.pyx":181
 * cdef inline ndarray _array_from_matrix_data_copy(SdifMatrixDataT *matrix):
 *     cdef ndarray out
 *     cdef SdifMatrixHeaderT *header = matrix.Header             # <<<<<<<<<<<<<<
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow
 */
  __pyx_t_1 = __pyx_v_matrix->Header;
  __pyx_v_header = __pyx_t_1;

  /* "pysdif/_pysdif.pyx":183
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow             # <<<<<<<<<<<<<<
 *     dims[1] = <npy_intp>header.NbCol
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))
 */
  (__pyx_v_dims[0]) = ((npy_intp)__pyx_v_header->NbRow);

  /* "pysdif/_pysdif.pyx":184
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow
 *     dims[1] = <npy_intp>header.NbCol             # <<<<<<<<<<<<<<
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))
 *     memcpy(<void *>out.data, matrix.Data.Void, c_numpy.PyArray_ITEMSIZE(out) * dims[0] * dims[1])
 */
  (__pyx_v_dims[1]) = ((npy_intp)__pyx_v_header->NbCol);

  /* "pysdif/_pysdif.pyx":185
 *     dims[0] = <npy_intp>header.NbRow
 *     dims[1] = <npy_intp>header.NbCol
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))             # <<<<<<<<<<<<<<
 *     memcpy(<void *>out.data, matrix.Data.Void, c_numpy.PyArray_ITEMSIZE(out) * dims[0] * dims[1])
 *     return out
 */
  __pyx_t_2 = PyArray_SimpleNew(2, __pyx_v_dims, __pyx_f_6pysdif_7_pysdif_dtype_sdif2numpy(__pyx_v_header->DataType)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 185, __pyx_L1_error)
  __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":186
 *     dims[1] = <npy_intp>header.NbCol
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))
 *     memcpy(<void *>out.data, matrix.Data.Void, c_numpy.PyArray_ITEMSIZE(out) * dims[0] * dims[1])             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  (void)(memcpy(((void *)__pyx_v_out->data), __pyx_v_matrix->Data.Void, ((PyArray_ITEMSIZE(__pyx_v_out) * (__pyx_v_dims[0])) * (__pyx_v_dims[1]))));

  /* "pysdif/_pysdif.pyx":187
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))
 *     memcpy(<void *>out.data, matrix.Data.Void, c_numpy.PyArray_ITEMSIZE(out) * dims[0] * dims[1])
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":179
 *     return PyArray_SimpleNewFromData(2, dims, dtype_sdif2numpy(header.DataType), matrix.Data.Void)
 * 
 * cdef inline ndarray _array_from_matrix_data_copy(SdifMatrixDataT *matrix):             # <<<<<<<<<<<<<<
 *     cdef ndarray out
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif._array_from_matrix_data_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":190
 * 
 * 
 * cdef inline bytes bytes_from_sdifstring(SdifStringT *s):             # <<<<<<<<<<<<<<
 *     cdef bytes out = s.str[:s.SizeW]
 *     return out
 */

static CYTHON_INLINE PyObject *__pyx_f_6pysdif_7_pysdif_bytes_from_sdifstring(SdifStringT *__pyx_v_s) {
  PyObject *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bytes_from_sdifstring", 0);

  /* "pysdif/_pysdif.pyx":191
 * 
 * cdef inline bytes bytes_from_sdifstring(SdifStringT *s):
 *     cdef bytes out = s.str[:s.SizeW]             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s->str + 0, __pyx_v_s->SizeW - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":192
 * cdef inline bytes bytes_from_sdifstring(SdifStringT *s):
 *     cdef bytes out = s.str[:s.SizeW]
 *     return out             # <<<<<<<<<<<<<<
 * 
 * # cdef inline PyString_from_SdifString(SdifStringT *s):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":190
 * 
 * 
 * cdef inline bytes bytes_from_sdifstring(SdifStringT *s):             # <<<<<<<<<<<<<<
 *     cdef bytes out = s.str[:s.SizeW]
 *     return out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.bytes_from_sdifstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":198
 * #     return PyString_FromStringAndSize(s.str, s.SizeW)
 * 
 * cdef SdifStringT *SdifString_from_PyString(s):             # <<<<<<<<<<<<<<
 *     cdef bytes s_bytes = asbytes(s)
 *     cdef char *c = s
 */

static SdifStringT *__pyx_f_6pysdif_7_pysdif_SdifString_from_PyString(PyObject *__pyx_v_s) {
  CYTHON_UNUSED PyObject *__pyx_v_s_bytes = 0;
  char *__pyx_v_c;
  SdifStringT *__pyx_v_sdifstr;
  SdifStringT *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SdifString_from_PyString", 0);

  /* "pysdif/_pysdif.pyx":199
 * 
 * cdef SdifStringT *SdifString_from_PyString(s):
 *     cdef bytes s_bytes = asbytes(s)             # <<<<<<<<<<<<<<
 *     cdef char *c = s
 *     cdef SdifStringT *sdifstr = SdifStringNew()
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_s_bytes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":200
 * cdef SdifStringT *SdifString_from_PyString(s):
 *     cdef bytes s_bytes = asbytes(s)
 *     cdef char *c = s             # <<<<<<<<<<<<<<
 *     cdef SdifStringT *sdifstr = SdifStringNew()
 *     SdifStringAppend(sdifstr, c)
 */
  __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
  __pyx_v_c = __pyx_t_2;

  /* "pysdif/_pysdif.pyx":201
 *     cdef bytes s_bytes = asbytes(s)
 *     cdef char *c = s
 *     cdef SdifStringT *sdifstr = SdifStringNew()             # <<<<<<<<<<<<<<
 *     SdifStringAppend(sdifstr, c)
 *     return sdifstr
 */
  __pyx_v_sdifstr = SdifStringNew();

  /* "pysdif/_pysdif.pyx":202
 *     cdef char *c = s
 *     cdef SdifStringT *sdifstr = SdifStringNew()
 *     SdifStringAppend(sdifstr, c)             # <<<<<<<<<<<<<<
 *     return sdifstr
 * 
 */
  (void)(SdifStringAppend(__pyx_v_sdifstr, __pyx_v_c));

  /* "pysdif/_pysdif.pyx":203
 *     cdef SdifStringT *sdifstr = SdifStringNew()
 *     SdifStringAppend(sdifstr, c)
 *     return sdifstr             # <<<<<<<<<<<<<<
 * 
 * cdef dict nvt_to_dict( SdifNameValueTableT *nvt ):
 */
  __pyx_r = __pyx_v_sdifstr;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":198
 * #     return PyString_FromStringAndSize(s.str, s.SizeW)
 * 
 * cdef SdifStringT *SdifString_from_PyString(s):             # <<<<<<<<<<<<<<
 *     cdef bytes s_bytes = asbytes(s)
 *     cdef char *c = s
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifString_from_PyString", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s_bytes);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":205
 *     return sdifstr
 * 
 * cdef dict nvt_to_dict( SdifNameValueTableT *nvt ):             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef SdifUInt4      iNV
 */

static PyObject *__pyx_f_6pysdif_7_pysdif_nvt_to_dict(SdifNameValueTableT *__pyx_v_nvt) {
  int __pyx_v_i;
  SdifHashNT *__pyx_v_pNV;
  SdifHashTableT *__pyx_v_HTable;
  SdifNameValueT *__pyx_v_namevalue;
  PyObject *__pyx_v_table = NULL;
  char *__pyx_v_name;
  char *__pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  SdifHashTableT *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  SdifHashNT *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nvt_to_dict", 0);

  /* "pysdif/_pysdif.pyx":212
 *     cdef SdifNameValueT *namevalue
 * 
 *     HTable = nvt.NVHT             # <<<<<<<<<<<<<<
 *     table = {}
 *     for i in range(HTable.HashSize):
 */
  __pyx_t_1 = __pyx_v_nvt->NVHT;
  __pyx_v_HTable = __pyx_t_1;

  /* "pysdif/_pysdif.pyx":213
 * 
 *     HTable = nvt.NVHT
 *     table = {}             # <<<<<<<<<<<<<<
 *     for i in range(HTable.HashSize):
 *         pNV = HTable.Table[i]
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_table = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":214
 *     HTable = nvt.NVHT
 *     table = {}
 *     for i in range(HTable.HashSize):             # <<<<<<<<<<<<<<
 *         pNV = HTable.Table[i]
 *         while pNV:
 */
  __pyx_t_3 = __pyx_v_HTable->HashSize;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pysdif/_pysdif.pyx":215
 *     table = {}
 *     for i in range(HTable.HashSize):
 *         pNV = HTable.Table[i]             # <<<<<<<<<<<<<<
 *         while pNV:
 *             namevalue = <SdifNameValueT *>(pNV.Data)
 */
    __pyx_v_pNV = (__pyx_v_HTable->Table[__pyx_v_i]);

    /* "pysdif/_pysdif.pyx":216
 *     for i in range(HTable.HashSize):
 *         pNV = HTable.Table[i]
 *         while pNV:             # <<<<<<<<<<<<<<
 *             namevalue = <SdifNameValueT *>(pNV.Data)
 *             name = namevalue.Name
 */
    while (1) {
      __pyx_t_6 = (__pyx_v_pNV != 0);
      if (!__pyx_t_6) break;

      /* "pysdif/_pysdif.pyx":217
 *         pNV = HTable.Table[i]
 *         while pNV:
 *             namevalue = <SdifNameValueT *>(pNV.Data)             # <<<<<<<<<<<<<<
 *             name = namevalue.Name
 *             value = namevalue.Value
 */
      __pyx_v_namevalue = ((SdifNameValueT *)__pyx_v_pNV->Data);

      /* "pysdif/_pysdif.pyx":218
 *         while pNV:
 *             namevalue = <SdifNameValueT *>(pNV.Data)
 *             name = namevalue.Name             # <<<<<<<<<<<<<<
 *             value = namevalue.Value
 *             table[name] = value
 */
      __pyx_t_7 = __pyx_v_namevalue->Name;
      __pyx_v_name = __pyx_t_7;

      /* "pysdif/_pysdif.pyx":219
 *             namevalue = <SdifNameValueT *>(pNV.Data)
 *             name = namevalue.Name
 *             value = namevalue.Value             # <<<<<<<<<<<<<<
 *             table[name] = value
 *             pNV = pNV.Next
 */
      __pyx_t_7 = __pyx_v_namevalue->Value;
      __pyx_v_value = __pyx_t_7;

      /* "pysdif/_pysdif.pyx":220
 *             name = namevalue.Name
 *             value = namevalue.Value
 *             table[name] = value             # <<<<<<<<<<<<<<
 *             pNV = pNV.Next
 *     return table
 */
      __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_t_8, __pyx_t_2) < 0)) __PYX_ERR(0, 220, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pysdif/_pysdif.pyx":221
 *             value = namevalue.Value
 *             table[name] = value
 *             pNV = pNV.Next             # <<<<<<<<<<<<<<
 *     return table
 * 
 */
      __pyx_t_9 = __pyx_v_pNV->Next;
      __pyx_v_pNV = __pyx_t_9;
    }
  }

  /* "pysdif/_pysdif.pyx":222
 *             table[name] = value
 *             pNV = pNV.Next
 *     return table             # <<<<<<<<<<<<<<
 * 
 * cdef valuetables_to_dicts (SdifNameValuesLT *namevalues):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_table);
  __pyx_r = __pyx_v_table;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":205
 *     return sdifstr
 * 
 * cdef dict nvt_to_dict( SdifNameValueTableT *nvt ):             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef SdifUInt4      iNV
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysdif._pysdif.nvt_to_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":224
 *     return table
 * 
 * cdef valuetables_to_dicts (SdifNameValuesLT *namevalues):             # <<<<<<<<<<<<<<
 *     """ create a list of dicts where each dict represents a value table """
 *     SdifListInitLoop(namevalues.NVTList)
 */

static PyObject *__pyx_f_6pysdif_7_pysdif_valuetables_to_dicts(SdifNameValuesLT *__pyx_v_namevalues) {
  PyObject *__pyx_v_tables = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("valuetables_to_dicts", 0);

  /* "pysdif/_pysdif.pyx":226
 * cdef valuetables_to_dicts (SdifNameValuesLT *namevalues):
 *     """ create a list of dicts where each dict represents a value table """
 *     SdifListInitLoop(namevalues.NVTList)             # <<<<<<<<<<<<<<
 *     tables = []
 *     while SdifListIsNext(namevalues.NVTList):
 */
  (void)(SdifListInitLoop(__pyx_v_namevalues->NVTList));

  /* "pysdif/_pysdif.pyx":227
 *     """ create a list of dicts where each dict represents a value table """
 *     SdifListInitLoop(namevalues.NVTList)
 *     tables = []             # <<<<<<<<<<<<<<
 *     while SdifListIsNext(namevalues.NVTList):
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":228
 *     SdifListInitLoop(namevalues.NVTList)
 *     tables = []
 *     while SdifListIsNext(namevalues.NVTList):             # <<<<<<<<<<<<<<
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))
 *         tables.append(nvt_to_dict(namevalues.CurrNVT))
 */
  while (1) {
    __pyx_t_2 = (SdifListIsNext(__pyx_v_namevalues->NVTList) != 0);
    if (!__pyx_t_2) break;

    /* "pysdif/_pysdif.pyx":229
 *     tables = []
 *     while SdifListIsNext(namevalues.NVTList):
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))             # <<<<<<<<<<<<<<
 *         tables.append(nvt_to_dict(namevalues.CurrNVT))
 *     return tables
 */
    __pyx_v_namevalues->CurrNVT = ((SdifNameValueTableT *)SdifListGetNext(__pyx_v_namevalues->NVTList));

    /* "pysdif/_pysdif.pyx":230
 *     while SdifListIsNext(namevalues.NVTList):
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))
 *         tables.append(nvt_to_dict(namevalues.CurrNVT))             # <<<<<<<<<<<<<<
 *     return tables
 * 
 */
    __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_nvt_to_dict(__pyx_v_namevalues->CurrNVT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_tables, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pysdif/_pysdif.pyx":231
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))
 *         tables.append(nvt_to_dict(namevalues.CurrNVT))
 *     return tables             # <<<<<<<<<<<<<<
 * 
 * cdef streamidtable_to_list(SdifStreamIDTableT *table):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tables);
  __pyx_r = __pyx_v_tables;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":224
 *     return table
 * 
 * cdef valuetables_to_dicts (SdifNameValuesLT *namevalues):             # <<<<<<<<<<<<<<
 *     """ create a list of dicts where each dict represents a value table """
 *     SdifListInitLoop(namevalues.NVTList)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.valuetables_to_dicts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tables);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":233
 *     return tables
 * 
 * cdef streamidtable_to_list(SdifStreamIDTableT *table):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pID
 */

static PyObject *__pyx_f_6pysdif_7_pysdif_streamidtable_to_list(SdifStreamIDTableT *__pyx_v_table) {
  unsigned int __pyx_v_i;
  SdifHashNT *__pyx_v_pID;
  SdifStreamIDT *__pyx_v_streamid;
  PyObject *__pyx_v_streams = NULL;
  PyObject *__pyx_v_streamid_w = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  SdifHashNT *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("streamidtable_to_list", 0);

  /* "pysdif/_pysdif.pyx":237
 *     cdef SdifHashNT *pID
 *     cdef SdifStreamIDT *streamid
 *     streams = []             # <<<<<<<<<<<<<<
 *     for i in range(table.SIDHT.HashSize):
 *         pID = table.SIDHT.Table[i]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_streams = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":238
 *     cdef SdifStreamIDT *streamid
 *     streams = []
 *     for i in range(table.SIDHT.HashSize):             # <<<<<<<<<<<<<<
 *         pID = table.SIDHT.Table[i]
 *         while pID:
 */
  __pyx_t_2 = __pyx_v_table->SIDHT->HashSize;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pysdif/_pysdif.pyx":239
 *     streams = []
 *     for i in range(table.SIDHT.HashSize):
 *         pID = table.SIDHT.Table[i]             # <<<<<<<<<<<<<<
 *         while pID:
 *             streamid = <SdifStreamIDT *>(pID.Data)
 */
    __pyx_v_pID = (__pyx_v_table->SIDHT->Table[__pyx_v_i]);

    /* "pysdif/_pysdif.pyx":240
 *     for i in range(table.SIDHT.HashSize):
 *         pID = table.SIDHT.Table[i]
 *         while pID:             # <<<<<<<<<<<<<<
 *             streamid = <SdifStreamIDT *>(pID.Data)
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)
 */
    while (1) {
      __pyx_t_5 = (__pyx_v_pID != 0);
      if (!__pyx_t_5) break;

      /* "pysdif/_pysdif.pyx":241
 *         pID = table.SIDHT.Table[i]
 *         while pID:
 *             streamid = <SdifStreamIDT *>(pID.Data)             # <<<<<<<<<<<<<<
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)
 *             streams.append(streamid_w)
 */
      __pyx_v_streamid = ((SdifStreamIDT *)__pyx_v_pID->Data);

      /* "pysdif/_pysdif.pyx":242
 *         while pID:
 *             streamid = <SdifStreamIDT *>(pID.Data)
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)             # <<<<<<<<<<<<<<
 *             streams.append(streamid_w)
 *             pID = pID.Next
 */
      __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_StreamID_fromSdifStreadIDT(__pyx_v_streamid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_streamid_w, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pysdif/_pysdif.pyx":243
 *             streamid = <SdifStreamIDT *>(pID.Data)
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)
 *             streams.append(streamid_w)             # <<<<<<<<<<<<<<
 *             pID = pID.Next
 *     return streams
 */
      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_streams, __pyx_v_streamid_w); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 243, __pyx_L1_error)

      /* "pysdif/_pysdif.pyx":244
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)
 *             streams.append(streamid_w)
 *             pID = pID.Next             # <<<<<<<<<<<<<<
 *     return streams
 * 
 */
      __pyx_t_7 = __pyx_v_pID->Next;
      __pyx_v_pID = __pyx_t_7;
    }
  }

  /* "pysdif/_pysdif.pyx":245
 *             streams.append(streamid_w)
 *             pID = pID.Next
 *     return streams             # <<<<<<<<<<<<<<
 * 
 * cdef class StreamID:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_streams);
  __pyx_r = __pyx_v_streams;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":233
 *     return tables
 * 
 * cdef streamidtable_to_list(SdifStreamIDTableT *table):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pID
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.streamidtable_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_streams);
  __Pyx_XDECREF(__pyx_v_streamid_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":252
 * 
 *     property numid:
 *         def __get__(self): return self.this.NumID             # <<<<<<<<<<<<<<
 * 
 *     property source:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_5numid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_5numid_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8StreamID_5numid___get__(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_5numid___get__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->this->NumID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.numid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":255
 * 
 *     property source:
 *         def __get__(self): return self.this.Source             # <<<<<<<<<<<<<<
 * 
 *     property treeway:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_6source_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_6source_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8StreamID_6source___get__(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_6source___get__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->this->Source); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.source.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":258
 * 
 *     property treeway:
 *         def __get__(self): return self.this.TreeWay             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, int numid, source, treeway):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_7treeway_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_7treeway_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8StreamID_7treeway___get__(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_7treeway___get__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->this->TreeWay); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.treeway.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":260
 *         def __get__(self): return self.this.TreeWay
 * 
 *     def __cinit__(self, int numid, source, treeway):             # <<<<<<<<<<<<<<
 *         if numid == -1:
 *             # we are a wrapper of an existing SdifStreamID
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_8StreamID_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_8StreamID_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_numid;
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_treeway = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numid,&__pyx_n_s_source,&__pyx_n_s_treeway,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numid)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 260, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_treeway)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 260, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 260, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_numid = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_numid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L3_error)
    __pyx_v_source = values[1];
    __pyx_v_treeway = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 260, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8StreamID___cinit__(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self), __pyx_v_numid, __pyx_v_source, __pyx_v_treeway);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_8StreamID___cinit__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self, int __pyx_v_numid, PyObject *__pyx_v_source, PyObject *__pyx_v_treeway) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  char *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pysdif/_pysdif.pyx":261
 * 
 *     def __cinit__(self, int numid, source, treeway):
 *         if numid == -1:             # <<<<<<<<<<<<<<
 *             # we are a wrapper of an existing SdifStreamID
 *             self.own_this = 0
 */
  __pyx_t_1 = ((__pyx_v_numid == -1L) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":263
 *         if numid == -1:
 *             # we are a wrapper of an existing SdifStreamID
 *             self.own_this = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self.this = SdifCreateStreamID(<SdifUInt4>numid, source, treeway)
 */
    __pyx_v_self->own_this = 0;

    /* "pysdif/_pysdif.pyx":261
 * 
 *     def __cinit__(self, int numid, source, treeway):
 *         if numid == -1:             # <<<<<<<<<<<<<<
 *             # we are a wrapper of an existing SdifStreamID
 *             self.own_this = 0
 */
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":265
 *             self.own_this = 0
 *         else:
 *             self.this = SdifCreateStreamID(<SdifUInt4>numid, source, treeway)             # <<<<<<<<<<<<<<
 *             self.own_this = 1
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_source); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_treeway); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error)
    __pyx_v_self->this = SdifCreateStreamID(((SdifUInt4)__pyx_v_numid), __pyx_t_2, __pyx_t_3);

    /* "pysdif/_pysdif.pyx":266
 *         else:
 *             self.this = SdifCreateStreamID(<SdifUInt4>numid, source, treeway)
 *             self.own_this = 1             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_v_self->own_this = 1;
  }
  __pyx_L3:;

  /* "pysdif/_pysdif.pyx":260
 *         def __get__(self): return self.this.TreeWay
 * 
 *     def __cinit__(self, int numid, source, treeway):             # <<<<<<<<<<<<<<
 *         if numid == -1:
 *             # we are a wrapper of an existing SdifStreamID
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":268
 *             self.own_this = 1
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_this:
 *             SdifKillStreamID(self.this)
 */

/* Python wrapper */
static void __pyx_pw_6pysdif_7_pysdif_8StreamID_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6pysdif_7_pysdif_8StreamID_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6pysdif_7_pysdif_8StreamID_2__dealloc__(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_6pysdif_7_pysdif_8StreamID_2__dealloc__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pysdif/_pysdif.pyx":269
 * 
 *     def __dealloc__(self):
 *         if self.own_this:             # <<<<<<<<<<<<<<
 *             SdifKillStreamID(self.this)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->own_this != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":270
 *     def __dealloc__(self):
 *         if self.own_this:
 *             SdifKillStreamID(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    SdifKillStreamID(__pyx_v_self->this);

    /* "pysdif/_pysdif.pyx":269
 * 
 *     def __dealloc__(self):
 *         if self.own_this:             # <<<<<<<<<<<<<<
 *             SdifKillStreamID(self.this)
 * 
 */
  }

  /* "pysdif/_pysdif.pyx":268
 *             self.own_this = 1
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_this:
 *             SdifKillStreamID(self.this)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pysdif/_pysdif.pyx":272
 *             SdifKillStreamID(self.this)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 *             self.numid,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8StreamID_4__repr__(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_4__repr__(struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pysdif/_pysdif.pyx":273
 * 
 *     def __repr__(self):
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (             # <<<<<<<<<<<<<<
 *             self.numid,
 *             self.source,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pysdif/_pysdif.pyx":274
 *     def __repr__(self):
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 *             self.numid,             # <<<<<<<<<<<<<<
 *             self.source,
 *             self.treeway)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_numid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pysdif/_pysdif.pyx":275
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 *             self.numid,
 *             self.source,             # <<<<<<<<<<<<<<
 *             self.treeway)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_source); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pysdif/_pysdif.pyx":276
 *             self.numid,
 *             self.source,
 *             self.treeway)             # <<<<<<<<<<<<<<
 * 
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_treeway); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pysdif/_pysdif.pyx":274
 *     def __repr__(self):
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 *             self.numid,             # <<<<<<<<<<<<<<
 *             self.source,
 *             self.treeway)
 */
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":273
 * 
 *     def __repr__(self):
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (             # <<<<<<<<<<<<<<
 *             self.numid,
 *             self.source,
 */
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_StreamID_numid_d_source_s_treewa, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":272
 *             SdifKillStreamID(self.this)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 *             self.numid,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8StreamID_6__reduce_cython__[] = "StreamID.__reduce_cython__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8StreamID_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8StreamID_7__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8StreamID_6__reduce_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8StreamID_6__reduce_cython__(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8StreamID_8__setstate_cython__[] = "StreamID.__setstate_cython__(self, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8StreamID_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8StreamID_9__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_8StreamID_8__setstate_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8StreamID_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8StreamID_8__setstate_cython__(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __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)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":278
 *             self.treeway)
 * 
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):             # <<<<<<<<<<<<<<
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper
 *     out.this = this
 */

static PyObject *__pyx_f_6pysdif_7_pysdif_StreamID_fromSdifStreadIDT(SdifStreamIDT *__pyx_v_this) {
  struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("StreamID_fromSdifStreadIDT", 0);

  /* "pysdif/_pysdif.pyx":279
 * 
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper             # <<<<<<<<<<<<<<
 *     out.this = this
 *     out.own_this = 0
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_StreamID), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out = ((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":280
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper
 *     out.this = this             # <<<<<<<<<<<<<<
 *     out.own_this = 0
 *     return out
 */
  __pyx_v_out->this = __pyx_v_this;

  /* "pysdif/_pysdif.pyx":281
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper
 *     out.this = this
 *     out.own_this = 0             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_v_out->own_this = 0;

  /* "pysdif/_pysdif.pyx":282
 *     out.this = this
 *     out.own_this = 0
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":278
 *             self.treeway)
 * 
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):             # <<<<<<<<<<<<<<
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper
 *     out.this = this
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID_fromSdifStreadIDT", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":284
 *     return out
 * 
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):             # <<<<<<<<<<<<<<
 *     cdef SdifSignature sig = str2sig(asbytes(signature))
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 */

static SdifMatrixTypeT *__pyx_f_6pysdif_7_pysdif_MatrixType_create(PyObject *__pyx_v_signature, PyObject *__pyx_v_column_names) {
  SdifSignature __pyx_v_sig;
  SdifMatrixTypeT *__pyx_v_mt;
  PyObject *__pyx_v_column_name = NULL;
  SdifMatrixTypeT *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  const char* __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("MatrixType_create", 0);

  /* "pysdif/_pysdif.pyx":285
 * 
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):
 *     cdef SdifSignature sig = str2sig(asbytes(signature))             # <<<<<<<<<<<<<<
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 *     for column_name in column_names:
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 285, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error)
  __pyx_v_sig = __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":286
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):
 *     cdef SdifSignature sig = str2sig(asbytes(signature))
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)             # <<<<<<<<<<<<<<
 *     for column_name in column_names:
 *         SdifMatrixTypeInsertTailColumnDef(mt, asbytes(column_name))
 */
  __pyx_v_mt = SdifCreateMatrixType(__pyx_v_sig, NULL);

  /* "pysdif/_pysdif.pyx":287
 *     cdef SdifSignature sig = str2sig(asbytes(signature))
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 *     for column_name in column_names:             # <<<<<<<<<<<<<<
 *         SdifMatrixTypeInsertTailColumnDef(mt, asbytes(column_name))
 *     return mt
 */
  if (likely(PyList_CheckExact(__pyx_v_column_names)) || PyTuple_CheckExact(__pyx_v_column_names)) {
    __pyx_t_1 = __pyx_v_column_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_column_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 287, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_column_name, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pysdif/_pysdif.pyx":288
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 *     for column_name in column_names:
 *         SdifMatrixTypeInsertTailColumnDef(mt, asbytes(column_name))             # <<<<<<<<<<<<<<
 *     return mt
 * 
 */
    __pyx_t_5 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_column_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__pyx_t_5 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
      __PYX_ERR(0, 288, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_5); if (unlikely((__pyx_t_6 == ((const char*)NULL)) && PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L1_error)
    (void)(SdifMatrixTypeInsertTailColumnDef(__pyx_v_mt, __pyx_t_6));
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pysdif/_pysdif.pyx":287
 *     cdef SdifSignature sig = str2sig(asbytes(signature))
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 *     for column_name in column_names:             # <<<<<<<<<<<<<<
 *         SdifMatrixTypeInsertTailColumnDef(mt, asbytes(column_name))
 *     return mt
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":289
 *     for column_name in column_names:
 *         SdifMatrixTypeInsertTailColumnDef(mt, asbytes(column_name))
 *     return mt             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_mt;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":284
 *     return out
 * 
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):             # <<<<<<<<<<<<<<
 *     cdef SdifSignature sig = str2sig(asbytes(signature))
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("pysdif._pysdif.MatrixType_create", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_column_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":292
 * 
 * 
 * cdef SdifFrameTypeT *FrameType_create(signature, list components):             # <<<<<<<<<<<<<<
 *     """
 *     Create a SdifFrameType with a given signature
 */

static SdifFrameTypeT *__pyx_f_6pysdif_7_pysdif_FrameType_create(PyObject *__pyx_v_signature, PyObject *__pyx_v_components) {
  SdifSignature __pyx_v_sig;
  SdifFrameTypeT *__pyx_v_ft;
  PyObject *__pyx_v_component = NULL;
  PyObject *__pyx_v_component_b = NULL;
  PyObject *__pyx_v_component_sig = NULL;
  PyObject *__pyx_v_component_name = NULL;
  SdifFrameTypeT *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("FrameType_create", 0);

  /* "pysdif/_pysdif.pyx":302
 *         + strings "{SIGN} {ROLE}", like "1TRC SinusoidalTracks"
 *     """
 *     cdef SdifSignature sig = str2sig(asbytes(signature))             # <<<<<<<<<<<<<<
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 *     for component in components:
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 302, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error)
  __pyx_v_sig = __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":303
 *     """
 *     cdef SdifSignature sig = str2sig(asbytes(signature))
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)             # <<<<<<<<<<<<<<
 *     for component in components:
 *         if isinstance(component, Component):
 */
  __pyx_v_ft = SdifCreateFrameType(__pyx_v_sig, NULL);

  /* "pysdif/_pysdif.pyx":304
 *     cdef SdifSignature sig = str2sig(asbytes(signature))
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 *     for component in components:             # <<<<<<<<<<<<<<
 *         if isinstance(component, Component):
 *             SdifFrameTypePutComponent(ft, str2sig(component.signature), component.name)
 */
  if (unlikely(__pyx_v_components == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 304, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_components; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 304, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_component, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":305
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 *     for component in components:
 *         if isinstance(component, Component):             # <<<<<<<<<<<<<<
 *             SdifFrameTypePutComponent(ft, str2sig(component.signature), component.name)
 *         elif isinstance(component, tuple):
 */
    __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_component, __pyx_ptype_6pysdif_7_pysdif_Component); 
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pysdif/_pysdif.pyx":306
 *     for component in components:
 *         if isinstance(component, Component):
 *             SdifFrameTypePutComponent(ft, str2sig(component.signature), component.name)             # <<<<<<<<<<<<<<
 *         elif isinstance(component, tuple):
 *             SdifFrameTypePutComponent(ft, str2sig(asbytes(component[0])), asbytes(component[1]))
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_component, __pyx_n_s_signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_component, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_t_7); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
      (void)(SdifFrameTypePutComponent(__pyx_v_ft, __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_2), __pyx_t_8));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "pysdif/_pysdif.pyx":305
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 *     for component in components:
 *         if isinstance(component, Component):             # <<<<<<<<<<<<<<
 *             SdifFrameTypePutComponent(ft, str2sig(component.signature), component.name)
 *         elif isinstance(component, tuple):
 */
      goto __pyx_L5;
    }

    /* "pysdif/_pysdif.pyx":307
 *         if isinstance(component, Component):
 *             SdifFrameTypePutComponent(ft, str2sig(component.signature), component.name)
 *         elif isinstance(component, tuple):             # <<<<<<<<<<<<<<
 *             SdifFrameTypePutComponent(ft, str2sig(asbytes(component[0])), asbytes(component[1]))
 *         elif isinstance(component, (str, bytes)):
 */
    __pyx_t_6 = PyTuple_Check(__pyx_v_component); 
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (__pyx_t_5) {

      /* "pysdif/_pysdif.pyx":308
 *             SdifFrameTypePutComponent(ft, str2sig(component.signature), component.name)
 *         elif isinstance(component, tuple):
 *             SdifFrameTypePutComponent(ft, str2sig(asbytes(component[0])), asbytes(component[1]))             # <<<<<<<<<<<<<<
 *         elif isinstance(component, (str, bytes)):
 *             component_b = asbytes(component)
 */
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_component, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__pyx_t_4 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
        __PYX_ERR(0, 308, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error)
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_component, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__pyx_t_9 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
        __PYX_ERR(0, 308, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_t_9); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error)
      (void)(SdifFrameTypePutComponent(__pyx_v_ft, __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_8), __pyx_t_2));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "pysdif/_pysdif.pyx":307
 *         if isinstance(component, Component):
 *             SdifFrameTypePutComponent(ft, str2sig(component.signature), component.name)
 *         elif isinstance(component, tuple):             # <<<<<<<<<<<<<<
 *             SdifFrameTypePutComponent(ft, str2sig(asbytes(component[0])), asbytes(component[1]))
 *         elif isinstance(component, (str, bytes)):
 */
      goto __pyx_L5;
    }

    /* "pysdif/_pysdif.pyx":309
 *         elif isinstance(component, tuple):
 *             SdifFrameTypePutComponent(ft, str2sig(asbytes(component[0])), asbytes(component[1]))
 *         elif isinstance(component, (str, bytes)):             # <<<<<<<<<<<<<<
 *             component_b = asbytes(component)
 *             component_sig, component_name = component_b.split()
 */
    __pyx_t_6 = PyString_Check(__pyx_v_component); 
    __pyx_t_10 = (__pyx_t_6 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_5 = __pyx_t_10;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_10 = PyBytes_Check(__pyx_v_component); 
    __pyx_t_6 = (__pyx_t_10 != 0);
    __pyx_t_5 = __pyx_t_6;
    __pyx_L6_bool_binop_done:;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pysdif/_pysdif.pyx":310
 *             SdifFrameTypePutComponent(ft, str2sig(asbytes(component[0])), asbytes(component[1]))
 *         elif isinstance(component, (str, bytes)):
 *             component_b = asbytes(component)             # <<<<<<<<<<<<<<
 *             component_sig, component_name = component_b.split()
 *             SdifFrameTypePutComponent(ft, str2sig(component_sig), component_name)
 */
      __pyx_t_9 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_component); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF_SET(__pyx_v_component_b, ((PyObject*)__pyx_t_9));
      __pyx_t_9 = 0;

      /* "pysdif/_pysdif.pyx":311
 *         elif isinstance(component, (str, bytes)):
 *             component_b = asbytes(component)
 *             component_sig, component_name = component_b.split()             # <<<<<<<<<<<<<<
 *             SdifFrameTypePutComponent(ft, str2sig(component_sig), component_name)
 *         else:
 */
      __pyx_t_9 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyBytes_Type_split, __pyx_v_component_b); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
        PyObject* sequence = __pyx_t_9;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 311, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 311, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_component_sig, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_component_name, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "pysdif/_pysdif.pyx":312
 *             component_b = asbytes(component)
 *             component_sig, component_name = component_b.split()
 *             SdifFrameTypePutComponent(ft, str2sig(component_sig), component_name)             # <<<<<<<<<<<<<<
 *         else:
 *             logger.error("components should be a seq. of Components"
 */
      __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_component_sig); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_component_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
      (void)(SdifFrameTypePutComponent(__pyx_v_ft, __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_2), __pyx_t_8));

      /* "pysdif/_pysdif.pyx":309
 *         elif isinstance(component, tuple):
 *             SdifFrameTypePutComponent(ft, str2sig(asbytes(component[0])), asbytes(component[1]))
 *         elif isinstance(component, (str, bytes)):             # <<<<<<<<<<<<<<
 *             component_b = asbytes(component)
 *             component_sig, component_name = component_b.split()
 */
      goto __pyx_L5;
    }

    /* "pysdif/_pysdif.pyx":314
 *             SdifFrameTypePutComponent(ft, str2sig(component_sig), component_name)
 *         else:
 *             logger.error("components should be a seq. of Components"             # <<<<<<<<<<<<<<
 *                          "or tuples(signature, name), but got: %s" % components)
 *             return NULL
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "pysdif/_pysdif.pyx":315
 *         else:
 *             logger.error("components should be a seq. of Components"
 *                          "or tuples(signature, name), but got: %s" % components)             # <<<<<<<<<<<<<<
 *             return NULL
 *     return ft
 */
      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_components_should_be_a_seq_of_Co, __pyx_v_components); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "pysdif/_pysdif.pyx":316
 *             logger.error("components should be a seq. of Components"
 *                          "or tuples(signature, name), but got: %s" % components)
 *             return NULL             # <<<<<<<<<<<<<<
 *     return ft
 * 
 */
      __pyx_r = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __pyx_L5:;

    /* "pysdif/_pysdif.pyx":304
 *     cdef SdifSignature sig = str2sig(asbytes(signature))
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 *     for component in components:             # <<<<<<<<<<<<<<
 *         if isinstance(component, Component):
 *             SdifFrameTypePutComponent(ft, str2sig(component.signature), component.name)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":317
 *                          "or tuples(signature, name), but got: %s" % components)
 *             return NULL
 *     return ft             # <<<<<<<<<<<<<<
 * 
 * cdef inline bytes asbytes(s):
 */
  __pyx_r = __pyx_v_ft;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":292
 * 
 * 
 * cdef SdifFrameTypeT *FrameType_create(signature, list components):             # <<<<<<<<<<<<<<
 *     """
 *     Create a SdifFrameType with a given signature
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_WriteUnraisable("pysdif._pysdif.FrameType_create", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_component);
  __Pyx_XDECREF(__pyx_v_component_b);
  __Pyx_XDECREF(__pyx_v_component_sig);
  __Pyx_XDECREF(__pyx_v_component_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":319
 *     return ft
 * 
 * cdef inline bytes asbytes(s):             # <<<<<<<<<<<<<<
 *     if isinstance(s, bytes):
 *         return s
 */

static CYTHON_INLINE PyObject *__pyx_f_6pysdif_7_pysdif_asbytes(PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asbytes", 0);

  /* "pysdif/_pysdif.pyx":320
 * 
 * cdef inline bytes asbytes(s):
 *     if isinstance(s, bytes):             # <<<<<<<<<<<<<<
 *         return s
 *     elif isinstance(s, str):
 */
  __pyx_t_1 = PyBytes_Check(__pyx_v_s); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pysdif/_pysdif.pyx":321
 * cdef inline bytes asbytes(s):
 *     if isinstance(s, bytes):
 *         return s             # <<<<<<<<<<<<<<
 *     elif isinstance(s, str):
 *         return s.encode("ascii")
 */
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_s);
    __pyx_r = ((PyObject*)__pyx_v_s);
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":320
 * 
 * cdef inline bytes asbytes(s):
 *     if isinstance(s, bytes):             # <<<<<<<<<<<<<<
 *         return s
 *     elif isinstance(s, str):
 */
  }

  /* "pysdif/_pysdif.pyx":322
 *     if isinstance(s, bytes):
 *         return s
 *     elif isinstance(s, str):             # <<<<<<<<<<<<<<
 *         return s.encode("ascii")
 *     else:
 */
  __pyx_t_2 = PyString_Check(__pyx_v_s); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":323
 *         return s
 *     elif isinstance(s, str):
 *         return s.encode("ascii")             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError("s should be either a str or bytes, got {}".format(type(s)))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_ascii);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 323, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":322
 *     if isinstance(s, bytes):
 *         return s
 *     elif isinstance(s, str):             # <<<<<<<<<<<<<<
 *         return s.encode("ascii")
 *     else:
 */
  }

  /* "pysdif/_pysdif.pyx":325
 *         return s.encode("ascii")
 *     else:
 *         raise TypeError("s should be either a str or bytes, got {}".format(type(s)))             # <<<<<<<<<<<<<<
 * 
 * cdef class MatrixTypeDefinition:
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_s_should_be_either_a_str_or_byte, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_s))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_s)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 325, __pyx_L1_error)
  }

  /* "pysdif/_pysdif.pyx":319
 *     return ft
 * 
 * cdef inline bytes asbytes(s):             # <<<<<<<<<<<<<<
 *     if isinstance(s, bytes):
 *         return s
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.asbytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":331
 *     cdef public list column_names
 * 
 *     def __init__(self, signature, list column_names):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_20MatrixTypeDefinition___init__[] = "\n        Args:\n            signature (str): A 4 char signature\n            column_names: list[str] - A list of column names, [\"Col1\", \"Col2\", \"Col3\", ...]\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_6pysdif_7_pysdif_20MatrixTypeDefinition___init__;
#endif
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_column_names = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signature,&__pyx_n_s_column_names,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signature)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column_names)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 331, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 331, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_signature = values[0];
    __pyx_v_column_names = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 331, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_column_names), (&PyList_Type), 1, "column_names", 1))) __PYX_ERR(0, 331, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___init__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self), __pyx_v_signature, __pyx_v_column_names);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___init__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_column_names) {
  PyObject *__pyx_v_name = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pysdif/_pysdif.pyx":337
 *             column_names: list[str] - A list of column names, ["Col1", "Col2", "Col3", ...]
 *         """
 *         self.signature = asbytes(signature)             # <<<<<<<<<<<<<<
 *         self.column_names = [asbytes(name).strip() for name in column_names]
 * 
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->signature);
  __Pyx_DECREF(__pyx_v_self->signature);
  __pyx_v_self->signature = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":338
 *         """
 *         self.signature = asbytes(signature)
 *         self.column_names = [asbytes(name).strip() for name in column_names]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_v_column_names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 338, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_v_column_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->column_names);
  __Pyx_DECREF(__pyx_v_self->column_names);
  __pyx_v_self->column_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":331
 *     cdef public list column_names
 * 
 *     def __init__(self, signature, list column_names):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":340
 *         self.column_names = [asbytes(name).strip() for name in column_names]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, self.column_names)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_2__repr__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_2__repr__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pysdif/_pysdif.pyx":341
 * 
 *     def __repr__(self):
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, self.column_names)             # <<<<<<<<<<<<<<
 * 
 *     cdef SdifMatrixTypeT *toSdifMatrixType(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->signature);
  __Pyx_GIVEREF(__pyx_v_self->signature);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->signature);
  __Pyx_INCREF(__pyx_v_self->column_names);
  __Pyx_GIVEREF(__pyx_v_self->column_names);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->column_names);
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_1MTD_signature_s_column_names_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":340
 *         self.column_names = [asbytes(name).strip() for name in column_names]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, self.column_names)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":343
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, self.column_names)
 * 
 *     cdef SdifMatrixTypeT *toSdifMatrixType(self):             # <<<<<<<<<<<<<<
 *         return MatrixType_create(self.signature, self.column_names)
 * 
 */

static SdifMatrixTypeT *__pyx_f_6pysdif_7_pysdif_20MatrixTypeDefinition_toSdifMatrixType(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self) {
  SdifMatrixTypeT *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("toSdifMatrixType", 0);

  /* "pysdif/_pysdif.pyx":344
 * 
 *     cdef SdifMatrixTypeT *toSdifMatrixType(self):
 *         return MatrixType_create(self.signature, self.column_names)             # <<<<<<<<<<<<<<
 * 
 * cdef MatrixTypesTable_to_list(SdifHashTableT *t):
 */
  __pyx_t_1 = __pyx_v_self->signature;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_self->column_names;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_r = __pyx_f_6pysdif_7_pysdif_MatrixType_create(__pyx_t_1, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":343
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, self.column_names)
 * 
 *     cdef SdifMatrixTypeT *toSdifMatrixType(self):             # <<<<<<<<<<<<<<
 *         return MatrixType_create(self.signature, self.column_names)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":328
 * 
 * cdef class MatrixTypeDefinition:
 *     cdef public bytes signature             # <<<<<<<<<<<<<<
 *     cdef public list column_names
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->signature);
  __pyx_r = __pyx_v_self->signature;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_2__set__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_2__set__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyBytes_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 328, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->signature);
  __Pyx_DECREF(__pyx_v_self->signature);
  __pyx_v_self->signature = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.signature.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_4__del__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_4__del__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->signature);
  __Pyx_DECREF(__pyx_v_self->signature);
  __pyx_v_self->signature = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":329
 * cdef class MatrixTypeDefinition:
 *     cdef public bytes signature
 *     cdef public list column_names             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, signature, list column_names):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___get__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___get__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->column_names);
  __pyx_r = __pyx_v_self->column_names;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_2__set__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_2__set__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 329, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->column_names);
  __Pyx_DECREF(__pyx_v_self->column_names);
  __pyx_v_self->column_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.column_names.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_4__del__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_4__del__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->column_names);
  __Pyx_DECREF(__pyx_v_self->column_names);
  __pyx_v_self->column_names = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_20MatrixTypeDefinition_4__reduce_cython__[] = "MatrixTypeDefinition.__reduce_cython__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_20MatrixTypeDefinition_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_5__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_20MatrixTypeDefinition_4__reduce_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_4__reduce_cython__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_4__reduce_cython__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.column_names, self.signature)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->column_names);
  __Pyx_GIVEREF(__pyx_v_self->column_names);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->column_names);
  __Pyx_INCREF(__pyx_v_self->signature);
  __Pyx_GIVEREF(__pyx_v_self->signature);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->signature);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.column_names, self.signature)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.column_names, self.signature)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.column_names is not None or self.signature is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.column_names, self.signature)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.column_names is not None or self.signature is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, None), state
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->column_names != ((PyObject*)Py_None));
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->signature != ((PyObject*)Py_None));
    __pyx_t_2 = (__pyx_t_5 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.column_names is not None or self.signature is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.column_names is not None or self.signature is not None
 *     if use_setstate:
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_MatrixTypeDefinit); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_66826235);
    __Pyx_GIVEREF(__pyx_int_66826235);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_66826235);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.column_names is not None or self.signature is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, None), state
 *     else:
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_MatrixTypeDefinition__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_MatrixTypeDefinit); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_66826235);
    __Pyx_GIVEREF(__pyx_int_66826235);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_66826235);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_MatrixTypeDefinition__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_20MatrixTypeDefinition_6__setstate_cython__[] = "MatrixTypeDefinition.__setstate_cython__(self, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_20MatrixTypeDefinition_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_7__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_20MatrixTypeDefinition_6__setstate_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_6__setstate_cython__(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_6__setstate_cython__(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_MatrixTypeDefinition__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif___pyx_unpickle_MatrixTypeDefinition__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_MatrixTypeDefinition__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":346
 *         return MatrixType_create(self.signature, self.column_names)
 * 
 * cdef MatrixTypesTable_to_list(SdifHashTableT *t):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pName
 */

static PyObject *__pyx_f_6pysdif_7_pysdif_MatrixTypesTable_to_list(SdifHashTableT *__pyx_v_t) {
  unsigned int __pyx_v_i;
  SdifHashNT *__pyx_v_pName;
  SdifMatrixTypeT *__pyx_v_matrix;
  SdifColumnDefT *__pyx_v_column_def;
  PyObject *__pyx_v_out = 0;
  PyObject *__pyx_v_column_names = 0;
  PyObject *__pyx_v_signature = 0;
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  SdifHashNT *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("MatrixTypesTable_to_list", 0);

  /* "pysdif/_pysdif.pyx":351
 *     cdef SdifMatrixTypeT *matrix
 *     cdef SdifColumnDefT *column_def
 *     cdef list out = []             # <<<<<<<<<<<<<<
 *     cdef list column_names
 *     cdef bytes signature
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":354
 *     cdef list column_names
 *     cdef bytes signature
 *     for i in range(t.HashSize):             # <<<<<<<<<<<<<<
 *         pName = t.Table[i]
 *         while pName:
 */
  __pyx_t_2 = __pyx_v_t->HashSize;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pysdif/_pysdif.pyx":355
 *     cdef bytes signature
 *     for i in range(t.HashSize):
 *         pName = t.Table[i]             # <<<<<<<<<<<<<<
 *         while pName:
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 */
    __pyx_v_pName = (__pyx_v_t->Table[__pyx_v_i]);

    /* "pysdif/_pysdif.pyx":356
 *     for i in range(t.HashSize):
 *         pName = t.Table[i]
 *         while pName:             # <<<<<<<<<<<<<<
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 *             if not SdifListIsEmpty(matrix.ColumnUserList):
 */
    while (1) {
      __pyx_t_5 = (__pyx_v_pName != 0);
      if (!__pyx_t_5) break;

      /* "pysdif/_pysdif.pyx":357
 *         pName = t.Table[i]
 *         while pName:
 *             matrix = <SdifMatrixTypeT *>(pName.Data)             # <<<<<<<<<<<<<<
 *             if not SdifListIsEmpty(matrix.ColumnUserList):
 *                 signature = sig2str(matrix.Signature)
 */
      __pyx_v_matrix = ((SdifMatrixTypeT *)__pyx_v_pName->Data);

      /* "pysdif/_pysdif.pyx":358
 *         while pName:
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 *             if not SdifListIsEmpty(matrix.ColumnUserList):             # <<<<<<<<<<<<<<
 *                 signature = sig2str(matrix.Signature)
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 */
      __pyx_t_5 = ((!(SdifListIsEmpty(__pyx_v_matrix->ColumnUserList) != 0)) != 0);
      if (__pyx_t_5) {

        /* "pysdif/_pysdif.pyx":359
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 *             if not SdifListIsEmpty(matrix.ColumnUserList):
 *                 signature = sig2str(matrix.Signature)             # <<<<<<<<<<<<<<
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 *                 column_names = []
 */
        __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_matrix->Signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_signature, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "pysdif/_pysdif.pyx":360
 *             if not SdifListIsEmpty(matrix.ColumnUserList):
 *                 signature = sig2str(matrix.Signature)
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)             # <<<<<<<<<<<<<<
 *                 column_names = []
 *                 column_names.append(bytes(column_def.Name))
 */
        __pyx_v_column_def = ((SdifColumnDefT *)SdifListGetHead(__pyx_v_matrix->ColumnUserList));

        /* "pysdif/_pysdif.pyx":361
 *                 signature = sig2str(matrix.Signature)
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 *                 column_names = []             # <<<<<<<<<<<<<<
 *                 column_names.append(bytes(column_def.Name))
 *                 while SdifListIsNext(matrix.ColumnUserList):
 */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_column_names, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "pysdif/_pysdif.pyx":362
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 *                 column_names = []
 *                 column_names.append(bytes(column_def.Name))             # <<<<<<<<<<<<<<
 *                 while SdifListIsNext(matrix.ColumnUserList):
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))
 */
        __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_column_def->Name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_column_names, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 362, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "pysdif/_pysdif.pyx":363
 *                 column_names = []
 *                 column_names.append(bytes(column_def.Name))
 *                 while SdifListIsNext(matrix.ColumnUserList):             # <<<<<<<<<<<<<<
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))
 *                     column_names.append(bytes(column_def.Name))
 */
        while (1) {
          __pyx_t_5 = (SdifListIsNext(__pyx_v_matrix->ColumnUserList) != 0);
          if (!__pyx_t_5) break;

          /* "pysdif/_pysdif.pyx":364
 *                 column_names.append(bytes(column_def.Name))
 *                 while SdifListIsNext(matrix.ColumnUserList):
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))             # <<<<<<<<<<<<<<
 *                     column_names.append(bytes(column_def.Name))
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)
 */
          __pyx_v_column_def = ((SdifColumnDefT *)SdifListGetNext(__pyx_v_matrix->ColumnUserList));

          /* "pysdif/_pysdif.pyx":365
 *                 while SdifListIsNext(matrix.ColumnUserList):
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))
 *                     column_names.append(bytes(column_def.Name))             # <<<<<<<<<<<<<<
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)
 *                 out.append(row)
 */
          __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_column_def->Name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_column_names, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 365, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }

        /* "pysdif/_pysdif.pyx":366
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))
 *                     column_names.append(bytes(column_def.Name))
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)             # <<<<<<<<<<<<<<
 *                 out.append(row)
 *             pName = pName.Next
 */
        __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_signature, __pyx_v_signature) < 0) __PYX_ERR(0, 366, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_column_names, __pyx_v_column_names) < 0) __PYX_ERR(0, 366, __pyx_L1_error)
        __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_row, ((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_t_6));
        __pyx_t_6 = 0;

        /* "pysdif/_pysdif.pyx":367
 *                     column_names.append(bytes(column_def.Name))
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)
 *                 out.append(row)             # <<<<<<<<<<<<<<
 *             pName = pName.Next
 *     return out
 */
        __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_out, ((PyObject *)__pyx_v_row)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 367, __pyx_L1_error)

        /* "pysdif/_pysdif.pyx":358
 *         while pName:
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 *             if not SdifListIsEmpty(matrix.ColumnUserList):             # <<<<<<<<<<<<<<
 *                 signature = sig2str(matrix.Signature)
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 */
      }

      /* "pysdif/_pysdif.pyx":368
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)
 *                 out.append(row)
 *             pName = pName.Next             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
      __pyx_t_8 = __pyx_v_pName->Next;
      __pyx_v_pName = __pyx_t_8;
    }
  }

  /* "pysdif/_pysdif.pyx":369
 *                 out.append(row)
 *             pName = pName.Next
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef class Component:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":346
 *         return MatrixType_create(self.signature, self.column_names)
 * 
 * cdef MatrixTypesTable_to_list(SdifHashTableT *t):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pName
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypesTable_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_column_names);
  __Pyx_XDECREF(__pyx_v_signature);
  __Pyx_XDECREF((PyObject *)__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":376
 *     cdef readonly unsigned int num
 * 
 *     def __init__(self, signature, name, num=0):             # <<<<<<<<<<<<<<
 *         self.signature = asbytes(signature)
 *         self.name = asbytes(name)
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_9Component_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_9Component_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_num = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signature,&__pyx_n_s_name,&__pyx_n_s_num,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signature)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 376, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 376, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_signature = values[0];
    __pyx_v_name = values[1];
    __pyx_v_num = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 376, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.Component.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_9Component___init__(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self), __pyx_v_signature, __pyx_v_name, __pyx_v_num);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_9Component___init__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_name, PyObject *__pyx_v_num) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pysdif/_pysdif.pyx":377
 * 
 *     def __init__(self, signature, name, num=0):
 *         self.signature = asbytes(signature)             # <<<<<<<<<<<<<<
 *         self.name = asbytes(name)
 *         self.num = num
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->signature);
  __Pyx_DECREF(__pyx_v_self->signature);
  __pyx_v_self->signature = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":378
 *     def __init__(self, signature, name, num=0):
 *         self.signature = asbytes(signature)
 *         self.name = asbytes(name)             # <<<<<<<<<<<<<<
 *         self.num = num
 * 
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":379
 *         self.signature = asbytes(signature)
 *         self.name = asbytes(name)
 *         self.num = num             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_v_num); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
  __pyx_v_self->num = __pyx_t_2;

  /* "pysdif/_pysdif.pyx":376
 *     cdef readonly unsigned int num
 * 
 *     def __init__(self, signature, name, num=0):             # <<<<<<<<<<<<<<
 *         self.signature = asbytes(signature)
 *         self.name = asbytes(name)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.Component.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":381
 *         self.num = num
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Component(signature=%s, name=%s, num=%d)" % (
 *                self.signature, self.name, self.num)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_9Component_2__repr__(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_2__repr__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pysdif/_pysdif.pyx":382
 * 
 *     def __repr__(self):
 *         return "Component(signature=%s, name=%s, num=%d)" % (             # <<<<<<<<<<<<<<
 *                self.signature, self.name, self.num)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pysdif/_pysdif.pyx":383
 *     def __repr__(self):
 *         return "Component(signature=%s, name=%s, num=%d)" % (
 *                self.signature, self.name, self.num)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->signature);
  __Pyx_GIVEREF(__pyx_v_self->signature);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->signature);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":382
 * 
 *     def __repr__(self):
 *         return "Component(signature=%s, name=%s, num=%d)" % (             # <<<<<<<<<<<<<<
 *                self.signature, self.name, self.num)
 * 
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Component_signature_s_name_s_num, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":381
 *         self.num = num
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Component(signature=%s, name=%s, num=%d)" % (
 *                self.signature, self.name, self.num)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Component.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":372
 * 
 * cdef class Component:
 *     cdef readonly bytes signature             # <<<<<<<<<<<<<<
 *     cdef readonly bytes name
 *     cdef readonly unsigned int num
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_9signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_9signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_9Component_9signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->signature);
  __pyx_r = __pyx_v_self->signature;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":373
 * cdef class Component:
 *     cdef readonly bytes signature
 *     cdef readonly bytes name             # <<<<<<<<<<<<<<
 *     cdef readonly unsigned int num
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_9Component_4name___get__(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_4name___get__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":374
 *     cdef readonly bytes signature
 *     cdef readonly bytes name
 *     cdef readonly unsigned int num             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, signature, name, num=0):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_3num_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_3num_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_9Component_3num___get__(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_3num___get__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.Component.num.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_9Component_4__reduce_cython__[] = "Component.__reduce_cython__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_9Component_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_9Component_5__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_9Component_4__reduce_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_9Component_4__reduce_cython__(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_4__reduce_cython__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.name, self.num, self.signature)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->num); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->signature);
  __Pyx_GIVEREF(__pyx_v_self->signature);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_self->signature);
  __pyx_t_1 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.name, self.num, self.signature)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v__dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":7
 *     state = (self.name, self.num, self.signature)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.name is not None or self.signature is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.name, self.num, self.signature)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.name is not None or self.signature is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, None), state
 */
  /*else*/ {
    __pyx_t_3 = (__pyx_v_self->name != ((PyObject*)Py_None));
    __pyx_t_5 = (__pyx_t_3 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->signature != ((PyObject*)Py_None));
    __pyx_t_3 = (__pyx_t_5 != 0);
    __pyx_t_4 = __pyx_t_3;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_4;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None or self.signature is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, None), state
 *     else:
 */
  __pyx_t_4 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_4) {

    /* "(tree fragment)":13
 *         use_setstate = self.name is not None or self.signature is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_Component); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_20897590);
    __Pyx_GIVEREF(__pyx_int_20897590);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_20897590);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None or self.signature is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, None), state
 *     else:
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Component__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_Component); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_20897590);
    __Pyx_GIVEREF(__pyx_int_20897590);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_20897590);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.Component.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Component__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_9Component_6__setstate_cython__[] = "Component.__setstate_cython__(self, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_9Component_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_9Component_7__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_9Component_6__setstate_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_9Component_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_9Component_6__setstate_cython__(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component_6__setstate_cython__(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Component__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif___pyx_unpickle_Component__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Component__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.Component.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":386
 * 
 * 
 * cdef Component Component_from_SdifComponent(SdifComponentT *c):             # <<<<<<<<<<<<<<
 *     cdef Component out = Component(sig2str(c.MtrxS), bytes(c.Name), c.Num)
 *     return out
 */

static struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_f_6pysdif_7_pysdif_Component_from_SdifComponent(SdifComponentT *__pyx_v_c) {
  struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_out = 0;
  struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Component_from_SdifComponent", 0);

  /* "pysdif/_pysdif.pyx":387
 * 
 * cdef Component Component_from_SdifComponent(SdifComponentT *c):
 *     cdef Component out = Component(sig2str(c.MtrxS), bytes(c.Name), c.Num)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_c->MtrxS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c->Name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_c->Num); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_Component), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_out = ((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":388
 * cdef Component Component_from_SdifComponent(SdifComponentT *c):
 *     cdef Component out = Component(sig2str(c.MtrxS), bytes(c.Name), c.Num)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef FrameTypesTable_to_list(SdifHashTableT *t):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":386
 * 
 * 
 * cdef Component Component_from_SdifComponent(SdifComponentT *c):             # <<<<<<<<<<<<<<
 *     cdef Component out = Component(sig2str(c.MtrxS), bytes(c.Name), c.Num)
 *     return out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.Component_from_SdifComponent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":390
 *     return out
 * 
 * cdef FrameTypesTable_to_list(SdifHashTableT *t):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pName
 */

static PyObject *__pyx_f_6pysdif_7_pysdif_FrameTypesTable_to_list(SdifHashTableT *__pyx_v_t) {
  unsigned int __pyx_v_i;
  SdifHashNT *__pyx_v_pName;
  SdifFrameTypeT *__pyx_v_frame;
  PyObject *__pyx_v_out = 0;
  PyObject *__pyx_v_components = NULL;
  PyObject *__pyx_v_signature = NULL;
  long __pyx_v_j;
  struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_component = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  SdifHashNT *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("FrameTypesTable_to_list", 0);

  /* "pysdif/_pysdif.pyx":394
 *     cdef SdifHashNT *pName
 *     cdef SdifFrameTypeT *frame
 *     cdef list out = []             # <<<<<<<<<<<<<<
 * 
 *     for i in range(t.HashSize):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":396
 *     cdef list out = []
 * 
 *     for i in range(t.HashSize):             # <<<<<<<<<<<<<<
 *         pName = t.Table[i]
 *         while pName:
 */
  __pyx_t_2 = __pyx_v_t->HashSize;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pysdif/_pysdif.pyx":397
 * 
 *     for i in range(t.HashSize):
 *         pName = t.Table[i]             # <<<<<<<<<<<<<<
 *         while pName:
 *             frame = <SdifFrameTypeT *>(pName.Data)
 */
    __pyx_v_pName = (__pyx_v_t->Table[__pyx_v_i]);

    /* "pysdif/_pysdif.pyx":398
 *     for i in range(t.HashSize):
 *         pName = t.Table[i]
 *         while pName:             # <<<<<<<<<<<<<<
 *             frame = <SdifFrameTypeT *>(pName.Data)
 *             if frame.NbComponentUse > 0:
 */
    while (1) {
      __pyx_t_5 = (__pyx_v_pName != 0);
      if (!__pyx_t_5) break;

      /* "pysdif/_pysdif.pyx":399
 *         pName = t.Table[i]
 *         while pName:
 *             frame = <SdifFrameTypeT *>(pName.Data)             # <<<<<<<<<<<<<<
 *             if frame.NbComponentUse > 0:
 *                 components = []
 */
      __pyx_v_frame = ((SdifFrameTypeT *)__pyx_v_pName->Data);

      /* "pysdif/_pysdif.pyx":400
 *         while pName:
 *             frame = <SdifFrameTypeT *>(pName.Data)
 *             if frame.NbComponentUse > 0:             # <<<<<<<<<<<<<<
 *                 components = []
 *                 signature = sig2str(frame.Signature)
 */
      __pyx_t_5 = ((__pyx_v_frame->NbComponentUse > 0) != 0);
      if (__pyx_t_5) {

        /* "pysdif/_pysdif.pyx":401
 *             frame = <SdifFrameTypeT *>(pName.Data)
 *             if frame.NbComponentUse > 0:
 *                 components = []             # <<<<<<<<<<<<<<
 *                 signature = sig2str(frame.Signature)
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):
 */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_components, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "pysdif/_pysdif.pyx":402
 *             if frame.NbComponentUse > 0:
 *                 components = []
 *                 signature = sig2str(frame.Signature)             # <<<<<<<<<<<<<<
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))
 */
        __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_frame->Signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_signature, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "pysdif/_pysdif.pyx":403
 *                 components = []
 *                 signature = sig2str(frame.Signature)
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):             # <<<<<<<<<<<<<<
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))
 *                     components.append(component)
 */
        __pyx_t_6 = (__pyx_v_frame->NbComponent + 1);
        __pyx_t_7 = __pyx_t_6;
        for (__pyx_t_8 = ((__pyx_v_frame->NbComponent - __pyx_v_frame->NbComponentUse) + 1); __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
          __pyx_v_j = __pyx_t_8;

          /* "pysdif/_pysdif.pyx":404
 *                 signature = sig2str(frame.Signature)
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))             # <<<<<<<<<<<<<<
 *                     components.append(component)
 *                 out.append(FrameTypeDefinition(signature, components))
 */
          __pyx_t_1 = ((PyObject *)__pyx_f_6pysdif_7_pysdif_Component_from_SdifComponent(SdifFrameTypeGetNthComponent(__pyx_v_frame, __pyx_v_j))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_XDECREF_SET(__pyx_v_component, ((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_t_1));
          __pyx_t_1 = 0;

          /* "pysdif/_pysdif.pyx":405
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))
 *                     components.append(component)             # <<<<<<<<<<<<<<
 *                 out.append(FrameTypeDefinition(signature, components))
 *             pName = pName.Next
 */
          __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_components, ((PyObject *)__pyx_v_component)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 405, __pyx_L1_error)
        }

        /* "pysdif/_pysdif.pyx":406
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))
 *                     components.append(component)
 *                 out.append(FrameTypeDefinition(signature, components))             # <<<<<<<<<<<<<<
 *             pName = pName.Next
 *     return out
 */
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_signature);
        __Pyx_GIVEREF(__pyx_v_signature);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_signature);
        __Pyx_INCREF(__pyx_v_components);
        __Pyx_GIVEREF(__pyx_v_components);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_components);
        __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition), __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_out, __pyx_t_10); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 406, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "pysdif/_pysdif.pyx":400
 *         while pName:
 *             frame = <SdifFrameTypeT *>(pName.Data)
 *             if frame.NbComponentUse > 0:             # <<<<<<<<<<<<<<
 *                 components = []
 *                 signature = sig2str(frame.Signature)
 */
      }

      /* "pysdif/_pysdif.pyx":407
 *                     components.append(component)
 *                 out.append(FrameTypeDefinition(signature, components))
 *             pName = pName.Next             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
      __pyx_t_11 = __pyx_v_pName->Next;
      __pyx_v_pName = __pyx_t_11;
    }
  }

  /* "pysdif/_pysdif.pyx":408
 *                 out.append(FrameTypeDefinition(signature, components))
 *             pName = pName.Next
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef class FrameTypeDefinition:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":390
 *     return out
 * 
 * cdef FrameTypesTable_to_list(SdifHashTableT *t):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pName
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypesTable_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_components);
  __Pyx_XDECREF(__pyx_v_signature);
  __Pyx_XDECREF((PyObject *)__pyx_v_component);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":414
 *     cdef readonly list components
 * 
 *     def __init__(self, signature, components):             # <<<<<<<<<<<<<<
 *         """
 *         Object representing a 1FTD
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_19FrameTypeDefinition___init__[] = "\n        Object representing a 1FTD\n\n        Args:\n            signature (str):  The signature of the frame\n            components: list[Component] - A list of components\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_6pysdif_7_pysdif_19FrameTypeDefinition___init__;
#endif
static int __pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_components = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signature,&__pyx_n_s_components,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signature)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 414, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 414, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_signature = values[0];
    __pyx_v_components = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 414, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___init__(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self), __pyx_v_signature, __pyx_v_components);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6pysdif_7_pysdif_19FrameTypeDefinition_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pysdif/_pysdif.pyx":425
 *         assert len(signature) == 4
 *         assert isinstance(components, list)
 *         assert all(isinstance(c, Component) for c in components)             # <<<<<<<<<<<<<<
 *         self.signature = asbytes(signature)
 *         self.components = components
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr(__pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 425, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6pysdif_7_pysdif_19FrameTypeDefinition_8__init___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_pysdif__pysdif); if (unlikely(!gen)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__init__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6pysdif_7_pysdif_19FrameTypeDefinition_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 425, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_components)) { __Pyx_RaiseClosureNameError("components"); __PYX_ERR(0, 425, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_components)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_components)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_components; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 425, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_TypeCheck(__pyx_cur_scope->__pyx_v_c, __pyx_ptype_6pysdif_7_pysdif_Component); 
    __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":414
 *     cdef readonly list components
 * 
 *     def __init__(self, signature, components):             # <<<<<<<<<<<<<<
 *         """
 *         Object representing a 1FTD
 */

static int __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___init__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_components) {
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *__pyx_cur_scope;
  PyObject *__pyx_gb_6pysdif_7_pysdif_19FrameTypeDefinition_8__init___2generator = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *)__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct____init__(__pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct____init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 414, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_components = __pyx_v_components;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_components);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_components);

  /* "pysdif/_pysdif.pyx":422
 *             components: list[Component] - A list of components
 *         """
 *         assert isinstance(signature, (str, bytes))             # <<<<<<<<<<<<<<
 *         assert len(signature) == 4
 *         assert isinstance(components, list)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyString_Check(__pyx_v_signature); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_3 = PyBytes_Check(__pyx_v_signature); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 422, __pyx_L1_error)
    }
  }
  #endif

  /* "pysdif/_pysdif.pyx":423
 *         """
 *         assert isinstance(signature, (str, bytes))
 *         assert len(signature) == 4             # <<<<<<<<<<<<<<
 *         assert isinstance(components, list)
 *         assert all(isinstance(c, Component) for c in components)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_4 = PyObject_Length(__pyx_v_signature); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 423, __pyx_L1_error)
    if (unlikely(!((__pyx_t_4 == 4) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 423, __pyx_L1_error)
    }
  }
  #endif

  /* "pysdif/_pysdif.pyx":424
 *         assert isinstance(signature, (str, bytes))
 *         assert len(signature) == 4
 *         assert isinstance(components, list)             # <<<<<<<<<<<<<<
 *         assert all(isinstance(c, Component) for c in components)
 *         self.signature = asbytes(signature)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_5 = __pyx_cur_scope->__pyx_v_components;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_1 = PyList_Check(__pyx_t_5); 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 424, __pyx_L1_error)
    }
  }
  #endif

  /* "pysdif/_pysdif.pyx":425
 *         assert len(signature) == 4
 *         assert isinstance(components, list)
 *         assert all(isinstance(c, Component) for c in components)             # <<<<<<<<<<<<<<
 *         self.signature = asbytes(signature)
 *         self.components = components
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_5 = __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 425, __pyx_L1_error)
    }
  }
  #endif

  /* "pysdif/_pysdif.pyx":426
 *         assert isinstance(components, list)
 *         assert all(isinstance(c, Component) for c in components)
 *         self.signature = asbytes(signature)             # <<<<<<<<<<<<<<
 *         self.components = components
 * 
 */
  __pyx_t_6 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->signature);
  __Pyx_DECREF(__pyx_v_self->signature);
  __pyx_v_self->signature = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pysdif/_pysdif.pyx":427
 *         assert all(isinstance(c, Component) for c in components)
 *         self.signature = asbytes(signature)
 *         self.components = components             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  if (!(likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_components))||((__pyx_cur_scope->__pyx_v_components) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_cur_scope->__pyx_v_components)->tp_name), 0))) __PYX_ERR(0, 427, __pyx_L1_error)
  __pyx_t_6 = __pyx_cur_scope->__pyx_v_components;
  __Pyx_INCREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->components);
  __Pyx_DECREF(__pyx_v_self->components);
  __pyx_v_self->components = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pysdif/_pysdif.pyx":414
 *     cdef readonly list components
 * 
 *     def __init__(self, signature, components):             # <<<<<<<<<<<<<<
 *         """
 *         Object representing a 1FTD
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_6pysdif_7_pysdif_19FrameTypeDefinition_8__init___2generator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":429
 *         self.components = components
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "1FTD(signature='%s', components=%s)" % (self.signature, self.components)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_2__repr__(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_2__repr__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pysdif/_pysdif.pyx":430
 * 
 *     def __repr__(self):
 *         return "1FTD(signature='%s', components=%s)" % (self.signature, self.components)             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->signature);
  __Pyx_GIVEREF(__pyx_v_self->signature);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->signature);
  __Pyx_INCREF(__pyx_v_self->components);
  __Pyx_GIVEREF(__pyx_v_self->components);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->components);
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_1FTD_signature_s_components_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":429
 *         self.components = components
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "1FTD(signature='%s', components=%s)" % (self.signature, self.components)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":411
 * 
 * cdef class FrameTypeDefinition:
 *     cdef readonly bytes signature             # <<<<<<<<<<<<<<
 *     cdef readonly list components
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_9signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_9signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->signature);
  __pyx_r = __pyx_v_self->signature;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":412
 * cdef class FrameTypeDefinition:
 *     cdef readonly bytes signature
 *     cdef readonly list components             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, signature, components):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_10components_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_10components_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->components);
  __pyx_r = __pyx_v_self->components;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_19FrameTypeDefinition_4__reduce_cython__[] = "FrameTypeDefinition.__reduce_cython__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_19FrameTypeDefinition_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_5__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_19FrameTypeDefinition_4__reduce_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_4__reduce_cython__(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_4__reduce_cython__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.components, self.signature)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->components);
  __Pyx_GIVEREF(__pyx_v_self->components);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->components);
  __Pyx_INCREF(__pyx_v_self->signature);
  __Pyx_GIVEREF(__pyx_v_self->signature);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->signature);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.components, self.signature)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.components, self.signature)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.components is not None or self.signature is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.components, self.signature)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.components is not None or self.signature is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, None), state
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->components != ((PyObject*)Py_None));
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->signature != ((PyObject*)Py_None));
    __pyx_t_2 = (__pyx_t_5 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.components is not None or self.signature is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.components is not None or self.signature is not None
 *     if use_setstate:
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_FrameTypeDefiniti); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_57246580);
    __Pyx_GIVEREF(__pyx_int_57246580);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_57246580);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.components is not None or self.signature is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, None), state
 *     else:
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FrameTypeDefinition__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_FrameTypeDefiniti); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_57246580);
    __Pyx_GIVEREF(__pyx_int_57246580);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_57246580);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FrameTypeDefinition__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_19FrameTypeDefinition_6__setstate_cython__[] = "FrameTypeDefinition.__setstate_cython__(self, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_19FrameTypeDefinition_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_7__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_19FrameTypeDefinition_6__setstate_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_6__setstate_cython__(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_6__setstate_cython__(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FrameTypeDefinition__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif___pyx_unpickle_FrameTypeDefinition__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FrameTypeDefinition__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":443
 * }
 * 
 * def read_sdiftypes():             # <<<<<<<<<<<<<<
 *     """
 *     Retrieves predefined types definitions parsed from SdifTypes.STYP
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_5read_sdiftypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_4read_sdiftypes[] = "read_sdiftypes()\n\n    Retrieves predefined types definitions parsed from SdifTypes.STYP\n\n    Returns: \n        a tuple (frametypes, matrixtypes)\n    ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_5read_sdiftypes = {"read_sdiftypes", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_5read_sdiftypes, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_4read_sdiftypes};
static PyObject *__pyx_pw_6pysdif_7_pysdif_5read_sdiftypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_sdiftypes (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_4read_sdiftypes(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_4read_sdiftypes(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_frametypes = NULL;
  PyObject *__pyx_v_matrixtypes = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_sdiftypes", 0);

  /* "pysdif/_pysdif.pyx":450
 *         a tuple (frametypes, matrixtypes)
 *     """
 *     sdif_init()             # <<<<<<<<<<<<<<
 *     frametypes = FrameTypesTable_to_list(gSdifPredefinedTypes.FrameTypesTable)
 *     matrixtypes = MatrixTypesTable_to_list(gSdifPredefinedTypes.MatrixTypesTable)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sdif_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":451
 *     """
 *     sdif_init()
 *     frametypes = FrameTypesTable_to_list(gSdifPredefinedTypes.FrameTypesTable)             # <<<<<<<<<<<<<<
 *     matrixtypes = MatrixTypesTable_to_list(gSdifPredefinedTypes.MatrixTypesTable)
 *     return frametypes, matrixtypes
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_FrameTypesTable_to_list(gSdifPredefinedTypes->FrameTypesTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_frametypes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":452
 *     sdif_init()
 *     frametypes = FrameTypesTable_to_list(gSdifPredefinedTypes.FrameTypesTable)
 *     matrixtypes = MatrixTypesTable_to_list(gSdifPredefinedTypes.MatrixTypesTable)             # <<<<<<<<<<<<<<
 *     return frametypes, matrixtypes
 * 
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_MatrixTypesTable_to_list(gSdifPredefinedTypes->MatrixTypesTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_matrixtypes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":453
 *     frametypes = FrameTypesTable_to_list(gSdifPredefinedTypes.FrameTypesTable)
 *     matrixtypes = MatrixTypesTable_to_list(gSdifPredefinedTypes.MatrixTypesTable)
 *     return frametypes, matrixtypes             # <<<<<<<<<<<<<<
 * 
 * def _frametypes_populate():
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_frametypes);
  __Pyx_GIVEREF(__pyx_v_frametypes);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_frametypes);
  __Pyx_INCREF(__pyx_v_matrixtypes);
  __Pyx_GIVEREF(__pyx_v_matrixtypes);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_matrixtypes);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":443
 * }
 * 
 * def read_sdiftypes():             # <<<<<<<<<<<<<<
 *     """
 *     Retrieves predefined types definitions parsed from SdifTypes.STYP
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.read_sdiftypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_frametypes);
  __Pyx_XDECREF(__pyx_v_matrixtypes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":455
 *     return frametypes, matrixtypes
 * 
 * def _frametypes_populate():             # <<<<<<<<<<<<<<
 *     frametypeslist, matrixtypeslist = read_sdiftypes()
 *     frametypes = {f.signature: f.components for f in frametypeslist}
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_7_frametypes_populate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6_frametypes_populate[] = "_frametypes_populate()";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_7_frametypes_populate = {"_frametypes_populate", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_7_frametypes_populate, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6_frametypes_populate};
static PyObject *__pyx_pw_6pysdif_7_pysdif_7_frametypes_populate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_frametypes_populate (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6_frametypes_populate(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6_frametypes_populate(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_frametypeslist = NULL;
  PyObject *__pyx_v_matrixtypeslist = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_frametypes = NULL;
  PyObject *__pyx_v_matrixtypes = NULL;
  PyObject *__pyx_v_allframetypes = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_components = NULL;
  PyObject *__pyx_v_allmatrixtypes = NULL;
  PyObject *__pyx_v_matrixsig = NULL;
  PyObject *__pyx_v_column_names = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_f = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_m = NULL;
  PyObject *__pyx_v_comp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_frametypes_populate", 0);

  /* "pysdif/_pysdif.pyx":456
 * 
 * def _frametypes_populate():
 *     frametypeslist, matrixtypeslist = read_sdiftypes()             # <<<<<<<<<<<<<<
 *     frametypes = {f.signature: f.components for f in frametypeslist}
 *     matrixtypes = {m.signature: m.column_names for m in matrixtypeslist}
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_read_sdiftypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 456, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 456, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_frametypeslist = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_matrixtypeslist = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":457
 * def _frametypes_populate():
 *     frametypeslist, matrixtypeslist = read_sdiftypes()
 *     frametypes = {f.signature: f.components for f in frametypeslist}             # <<<<<<<<<<<<<<
 *     matrixtypes = {m.signature: m.column_names for m in matrixtypeslist}
 *     allframetypes = SDIF_PREDEFINEDTYPES['frametypes']
 */
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_frametypeslist)) || PyTuple_CheckExact(__pyx_v_frametypeslist)) {
      __pyx_t_3 = __pyx_v_frametypeslist; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_frametypeslist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L7_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 457, __pyx_L7_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 457, __pyx_L7_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 457, __pyx_L7_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_f, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_f, __pyx_n_s_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_f, __pyx_n_s_components); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 457, __pyx_L7_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_f); __pyx_8genexpr1__pyx_v_f = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L7_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_f); __pyx_8genexpr1__pyx_v_f = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_v_frametypes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":458
 *     frametypeslist, matrixtypeslist = read_sdiftypes()
 *     frametypes = {f.signature: f.components for f in frametypeslist}
 *     matrixtypes = {m.signature: m.column_names for m in matrixtypeslist}             # <<<<<<<<<<<<<<
 *     allframetypes = SDIF_PREDEFINEDTYPES['frametypes']
 *     for f in frametypeslist:
 */
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L13_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_matrixtypeslist)) || PyTuple_CheckExact(__pyx_v_matrixtypeslist)) {
      __pyx_t_3 = __pyx_v_matrixtypeslist; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_matrixtypeslist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L13_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 458, __pyx_L13_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 458, __pyx_L13_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 458, __pyx_L13_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_m, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_m, __pyx_n_s_signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_m, __pyx_n_s_column_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 458, __pyx_L13_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m); __pyx_8genexpr2__pyx_v_m = 0;
    goto __pyx_L16_exit_scope;
    __pyx_L13_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m); __pyx_8genexpr2__pyx_v_m = 0;
    goto __pyx_L1_error;
    __pyx_L16_exit_scope:;
  } /* exit inner scope */
  __pyx_v_matrixtypes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":459
 *     frametypes = {f.signature: f.components for f in frametypeslist}
 *     matrixtypes = {m.signature: m.column_names for m in matrixtypeslist}
 *     allframetypes = SDIF_PREDEFINEDTYPES['frametypes']             # <<<<<<<<<<<<<<
 *     for f in frametypeslist:
 *         components = [b" ".join((comp.signature, comp.name)) for comp in f.components]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SDIF_PREDEFINEDTYPES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_frametypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_allframetypes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":460
 *     matrixtypes = {m.signature: m.column_names for m in matrixtypeslist}
 *     allframetypes = SDIF_PREDEFINEDTYPES['frametypes']
 *     for f in frametypeslist:             # <<<<<<<<<<<<<<
 *         components = [b" ".join((comp.signature, comp.name)) for comp in f.components]
 *         allframetypes[asbytes(f.signature)] = components
 */
  if (likely(PyList_CheckExact(__pyx_v_frametypeslist)) || PyTuple_CheckExact(__pyx_v_frametypeslist)) {
    __pyx_t_3 = __pyx_v_frametypeslist; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_frametypeslist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 460, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 460, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 460, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":461
 *     allframetypes = SDIF_PREDEFINEDTYPES['frametypes']
 *     for f in frametypeslist:
 *         components = [b" ".join((comp.signature, comp.name)) for comp in f.components]             # <<<<<<<<<<<<<<
 *         allframetypes[asbytes(f.signature)] = components
 *     allmatrixtypes = SDIF_PREDEFINEDTYPES['matrixtypes']
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_components); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 461, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_9(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 461, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_comp, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_comp, __pyx_n_s_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_comp, __pyx_n_s_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
      __pyx_t_2 = 0;
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyBytes_Join(__pyx_kp_b__4, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_components, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":462
 *     for f in frametypeslist:
 *         components = [b" ".join((comp.signature, comp.name)) for comp in f.components]
 *         allframetypes[asbytes(f.signature)] = components             # <<<<<<<<<<<<<<
 *     allmatrixtypes = SDIF_PREDEFINEDTYPES['matrixtypes']
 *     for matrixsig, column_names in matrixtypes.items():
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_allframetypes, __pyx_t_4, __pyx_v_components) < 0)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":460
 *     matrixtypes = {m.signature: m.column_names for m in matrixtypeslist}
 *     allframetypes = SDIF_PREDEFINEDTYPES['frametypes']
 *     for f in frametypeslist:             # <<<<<<<<<<<<<<
 *         components = [b" ".join((comp.signature, comp.name)) for comp in f.components]
 *         allframetypes[asbytes(f.signature)] = components
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":463
 *         components = [b" ".join((comp.signature, comp.name)) for comp in f.components]
 *         allframetypes[asbytes(f.signature)] = components
 *     allmatrixtypes = SDIF_PREDEFINEDTYPES['matrixtypes']             # <<<<<<<<<<<<<<
 *     for matrixsig, column_names in matrixtypes.items():
 *         allmatrixtypes[asbytes(matrixsig)] = b", ".join(column_names)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SDIF_PREDEFINEDTYPES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_matrixtypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_allmatrixtypes = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pysdif/_pysdif.pyx":464
 *         allframetypes[asbytes(f.signature)] = components
 *     allmatrixtypes = SDIF_PREDEFINEDTYPES['matrixtypes']
 *     for matrixsig, column_names in matrixtypes.items():             # <<<<<<<<<<<<<<
 *         allmatrixtypes[asbytes(matrixsig)] = b", ".join(column_names)
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_Items(__pyx_v_matrixtypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 464, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 464, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = Py_TYPE(__pyx_t_11)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L23_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_10 = __pyx_t_5(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L23_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_11), 2) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
      __pyx_t_5 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L24_unpacking_done;
      __pyx_L23_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_5 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 464, __pyx_L1_error)
      __pyx_L24_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_matrixsig, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_column_names, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "pysdif/_pysdif.pyx":465
 *     allmatrixtypes = SDIF_PREDEFINEDTYPES['matrixtypes']
 *     for matrixsig, column_names in matrixtypes.items():
 *         allmatrixtypes[asbytes(matrixsig)] = b", ".join(column_names)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_kp_b__5, __pyx_v_column_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_matrixsig); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (unlikely(PyObject_SetItem(__pyx_v_allmatrixtypes, __pyx_t_10, __pyx_t_4) < 0)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":464
 *         allframetypes[asbytes(f.signature)] = components
 *     allmatrixtypes = SDIF_PREDEFINEDTYPES['matrixtypes']
 *     for matrixsig, column_names in matrixtypes.items():             # <<<<<<<<<<<<<<
 *         allmatrixtypes[asbytes(matrixsig)] = b", ".join(column_names)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":455
 *     return frametypes, matrixtypes
 * 
 * def _frametypes_populate():             # <<<<<<<<<<<<<<
 *     frametypeslist, matrixtypeslist = read_sdiftypes()
 *     frametypes = {f.signature: f.components for f in frametypeslist}
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pysdif._pysdif._frametypes_populate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_frametypeslist);
  __Pyx_XDECREF(__pyx_v_matrixtypeslist);
  __Pyx_XDECREF(__pyx_v_frametypes);
  __Pyx_XDECREF(__pyx_v_matrixtypes);
  __Pyx_XDECREF(__pyx_v_allframetypes);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_components);
  __Pyx_XDECREF(__pyx_v_allmatrixtypes);
  __Pyx_XDECREF(__pyx_v_matrixsig);
  __Pyx_XDECREF(__pyx_v_column_names);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_f);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_comp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":468
 * 
 * 
 * def predefined_frametypes():             # <<<<<<<<<<<<<<
 *     """
 *     Returns a dict of predefined sdif frame types
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_9predefined_frametypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8predefined_frametypes[] = "predefined_frametypes()\n\n    Returns a dict of predefined sdif frame types\n\n    Returns:\n        (dict[str: list[str]]) A dict (framesig: components)\n    ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_9predefined_frametypes = {"predefined_frametypes", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_9predefined_frametypes, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8predefined_frametypes};
static PyObject *__pyx_pw_6pysdif_7_pysdif_9predefined_frametypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("predefined_frametypes (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8predefined_frametypes(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8predefined_frametypes(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("predefined_frametypes", 0);

  /* "pysdif/_pysdif.pyx":475
 *         (dict[str: list[str]]) A dict (framesig: components)
 *     """
 *     return SDIF_PREDEFINEDTYPES['frametypes']             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SDIF_PREDEFINEDTYPES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_frametypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":468
 * 
 * 
 * def predefined_frametypes():             # <<<<<<<<<<<<<<
 *     """
 *     Returns a dict of predefined sdif frame types
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.predefined_frametypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":478
 * 
 * 
 * def predefined_matrixtypes():             # <<<<<<<<<<<<<<
 *     """
 *     Returns a list of predefined sdif matrix types
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_11predefined_matrixtypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_10predefined_matrixtypes[] = "predefined_matrixtypes()\n\n    Returns a list of predefined sdif matrix types\n\n    Returns:\n        (dict[str, list[str]) A dict (matrisig: column_names)\n    ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_11predefined_matrixtypes = {"predefined_matrixtypes", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_11predefined_matrixtypes, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_10predefined_matrixtypes};
static PyObject *__pyx_pw_6pysdif_7_pysdif_11predefined_matrixtypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("predefined_matrixtypes (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_10predefined_matrixtypes(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_10predefined_matrixtypes(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("predefined_matrixtypes", 0);

  /* "pysdif/_pysdif.pyx":485
 *         (dict[str, list[str]) A dict (matrisig: column_names)
 *     """
 *     return SDIF_PREDEFINEDTYPES['matrixtypes']             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SDIF_PREDEFINEDTYPES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_matrixtypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":478
 * 
 * 
 * def predefined_matrixtypes():             # <<<<<<<<<<<<<<
 *     """
 *     Returns a list of predefined sdif matrix types
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.predefined_matrixtypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":489
 * # ----------------------------------------------------------------------
 * 
 * def _find_sdiftypes():             # <<<<<<<<<<<<<<
 * 
 *     def get_packaged_sdiftypes():
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_13_find_sdiftypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_12_find_sdiftypes[] = "_find_sdiftypes()";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_13_find_sdiftypes = {"_find_sdiftypes", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_13_find_sdiftypes, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_12_find_sdiftypes};
static PyObject *__pyx_pw_6pysdif_7_pysdif_13_find_sdiftypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_sdiftypes (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_12_find_sdiftypes(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":491
 * def _find_sdiftypes():
 * 
 *     def get_packaged_sdiftypes():             # <<<<<<<<<<<<<<
 *         try:
 *             thisfile = __file__
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_15_find_sdiftypes_1get_packaged_sdiftypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_15_find_sdiftypes_1get_packaged_sdiftypes = {"get_packaged_sdiftypes", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_15_find_sdiftypes_1get_packaged_sdiftypes, METH_NOARGS, 0};
static PyObject *__pyx_pw_6pysdif_7_pysdif_15_find_sdiftypes_1get_packaged_sdiftypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_packaged_sdiftypes (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_15_find_sdiftypes_get_packaged_sdiftypes(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_15_find_sdiftypes_get_packaged_sdiftypes(CYTHON_UNUSED PyObject *__pyx_self) {
  CYTHON_UNUSED PyObject *__pyx_v_thisfile = NULL;
  PyObject *__pyx_v_datadir = NULL;
  PyObject *__pyx_v_sdiftypes_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_packaged_sdiftypes", 0);

  /* "pysdif/_pysdif.pyx":492
 * 
 *     def get_packaged_sdiftypes():
 *         try:             # <<<<<<<<<<<<<<
 *             thisfile = __file__
 *         except NameError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pysdif/_pysdif.pyx":493
 *     def get_packaged_sdiftypes():
 *         try:
 *             thisfile = __file__             # <<<<<<<<<<<<<<
 *         except NameError:
 *             return None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_thisfile = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pysdif/_pysdif.pyx":492
 * 
 *     def get_packaged_sdiftypes():
 *         try:             # <<<<<<<<<<<<<<
 *             thisfile = __file__
 *         except NameError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":494
 *         try:
 *             thisfile = __file__
 *         except NameError:             # <<<<<<<<<<<<<<
 *             return None
 *         datadir = os.path.join(os.path.split(__file__)[0], "data")
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("pysdif._pysdif._find_sdiftypes.get_packaged_sdiftypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 494, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pysdif/_pysdif.pyx":495
 *             thisfile = __file__
 *         except NameError:
 *             return None             # <<<<<<<<<<<<<<
 *         datadir = os.path.join(os.path.split(__file__)[0], "data")
 *         sdiftypes_data = os.path.join(datadir, "SdifTypes.STYP")
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pysdif/_pysdif.pyx":492
 * 
 *     def get_packaged_sdiftypes():
 *         try:             # <<<<<<<<<<<<<<
 *             thisfile = __file__
 *         except NameError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pysdif/_pysdif.pyx":496
 *         except NameError:
 *             return None
 *         datadir = os.path.join(os.path.split(__file__)[0], "data")             # <<<<<<<<<<<<<<
 *         sdiftypes_data = os.path.join(datadir, "SdifTypes.STYP")
 *         if os.path.exists(sdiftypes_data):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_file); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_n_s_data};
    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_n_s_data};
    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_8);
    __Pyx_INCREF(__pyx_n_s_data);
    __Pyx_GIVEREF(__pyx_n_s_data);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_n_s_data);
    __pyx_t_8 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_datadir = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pysdif/_pysdif.pyx":497
 *             return None
 *         datadir = os.path.join(os.path.split(__file__)[0], "data")
 *         sdiftypes_data = os.path.join(datadir, "SdifTypes.STYP")             # <<<<<<<<<<<<<<
 *         if os.path.exists(sdiftypes_data):
 *             return sdiftypes_data
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_datadir, __pyx_kp_s_SdifTypes_STYP};
    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_datadir, __pyx_kp_s_SdifTypes_STYP};
    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_INCREF(__pyx_v_datadir);
    __Pyx_GIVEREF(__pyx_v_datadir);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_v_datadir);
    __Pyx_INCREF(__pyx_kp_s_SdifTypes_STYP);
    __Pyx_GIVEREF(__pyx_kp_s_SdifTypes_STYP);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_kp_s_SdifTypes_STYP);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_sdiftypes_data = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pysdif/_pysdif.pyx":498
 *         datadir = os.path.join(os.path.split(__file__)[0], "data")
 *         sdiftypes_data = os.path.join(datadir, "SdifTypes.STYP")
 *         if os.path.exists(sdiftypes_data):             # <<<<<<<<<<<<<<
 *             return sdiftypes_data
 *         return None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exists); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_sdiftypes_data) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_sdiftypes_data);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_11) {

    /* "pysdif/_pysdif.pyx":499
 *         sdiftypes_data = os.path.join(datadir, "SdifTypes.STYP")
 *         if os.path.exists(sdiftypes_data):
 *             return sdiftypes_data             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_sdiftypes_data);
    __pyx_r = __pyx_v_sdiftypes_data;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":498
 *         datadir = os.path.join(os.path.split(__file__)[0], "data")
 *         sdiftypes_data = os.path.join(datadir, "SdifTypes.STYP")
 *         if os.path.exists(sdiftypes_data):             # <<<<<<<<<<<<<<
 *             return sdiftypes_data
 *         return None
 */
  }

  /* "pysdif/_pysdif.pyx":500
 *         if os.path.exists(sdiftypes_data):
 *             return sdiftypes_data
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     pl = platform.system()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":491
 * def _find_sdiftypes():
 * 
 *     def get_packaged_sdiftypes():             # <<<<<<<<<<<<<<
 *         try:
 *             thisfile = __file__
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pysdif._pysdif._find_sdiftypes.get_packaged_sdiftypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_thisfile);
  __Pyx_XDECREF(__pyx_v_datadir);
  __Pyx_XDECREF(__pyx_v_sdiftypes_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":489
 * # ----------------------------------------------------------------------
 * 
 * def _find_sdiftypes():             # <<<<<<<<<<<<<<
 * 
 *     def get_packaged_sdiftypes():
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_12_find_sdiftypes(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_get_packaged_sdiftypes = 0;
  PyObject *__pyx_v_pl = NULL;
  PyObject *__pyx_v_paths = NULL;
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_p2 = NULL;
  PyObject *__pyx_v_packaged_sdiftypes = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_find_sdiftypes", 0);

  /* "pysdif/_pysdif.pyx":491
 * def _find_sdiftypes():
 * 
 *     def get_packaged_sdiftypes():             # <<<<<<<<<<<<<<
 *         try:
 *             thisfile = __file__
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_15_find_sdiftypes_1get_packaged_sdiftypes, 0, __pyx_n_s_find_sdiftypes_locals_get_packa, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_get_packaged_sdiftypes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":502
 *         return None
 * 
 *     pl = platform.system()             # <<<<<<<<<<<<<<
 *     if pl == "Linux":
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_system); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_pl = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":503
 * 
 *     pl = platform.system()
 *     if pl == "Linux":             # <<<<<<<<<<<<<<
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 *     elif pl == "Windows":
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_pl, __pyx_n_s_Linux, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 503, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pysdif/_pysdif.pyx":504
 *     pl = platform.system()
 *     if pl == "Linux":
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]             # <<<<<<<<<<<<<<
 *     elif pl == "Windows":
 *         paths = ["."]
 */
    __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_kp_s__8);
    __Pyx_GIVEREF(__pyx_kp_s__8);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s__8);
    __Pyx_INCREF(__pyx_kp_s_usr_local_share);
    __Pyx_GIVEREF(__pyx_kp_s_usr_local_share);
    PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_usr_local_share);
    __Pyx_INCREF(__pyx_kp_s_usr_share);
    __Pyx_GIVEREF(__pyx_kp_s_usr_share);
    PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_s_usr_share);
    __Pyx_INCREF(__pyx_kp_s_local_share);
    __Pyx_GIVEREF(__pyx_kp_s_local_share);
    PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_s_local_share);
    __pyx_v_paths = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":503
 * 
 *     pl = platform.system()
 *     if pl == "Linux":             # <<<<<<<<<<<<<<
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 *     elif pl == "Windows":
 */
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":505
 *     if pl == "Linux":
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 *     elif pl == "Windows":             # <<<<<<<<<<<<<<
 *         paths = ["."]
 *     elif pl == "Darwin":
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_pl, __pyx_n_s_Windows, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 505, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pysdif/_pysdif.pyx":506
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 *     elif pl == "Windows":
 *         paths = ["."]             # <<<<<<<<<<<<<<
 *     elif pl == "Darwin":
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_kp_s__8);
    __Pyx_GIVEREF(__pyx_kp_s__8);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s__8);
    __pyx_v_paths = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":505
 *     if pl == "Linux":
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 *     elif pl == "Windows":             # <<<<<<<<<<<<<<
 *         paths = ["."]
 *     elif pl == "Darwin":
 */
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":507
 *     elif pl == "Windows":
 *         paths = ["."]
 *     elif pl == "Darwin":             # <<<<<<<<<<<<<<
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 *     else:
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_pl, __pyx_n_s_Darwin, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pysdif/_pysdif.pyx":508
 *         paths = ["."]
 *     elif pl == "Darwin":
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]             # <<<<<<<<<<<<<<
 *     else:
 *         import warnings
 */
    __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_kp_s__8);
    __Pyx_GIVEREF(__pyx_kp_s__8);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s__8);
    __Pyx_INCREF(__pyx_kp_s_usr_local_share);
    __Pyx_GIVEREF(__pyx_kp_s_usr_local_share);
    PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_usr_local_share);
    __Pyx_INCREF(__pyx_kp_s_usr_share);
    __Pyx_GIVEREF(__pyx_kp_s_usr_share);
    PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_s_usr_share);
    __Pyx_INCREF(__pyx_kp_s_local_share);
    __Pyx_GIVEREF(__pyx_kp_s_local_share);
    PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_s_local_share);
    __pyx_v_paths = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":507
 *     elif pl == "Windows":
 *         paths = ["."]
 *     elif pl == "Darwin":             # <<<<<<<<<<<<<<
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":510
 *         paths = [".", "/usr/local/share", "/usr/share", "~/.local/share"]
 *     else:
 *         import warnings             # <<<<<<<<<<<<<<
 *         warnings.warn("Platform unknown")
 *         return ""
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_warnings = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":511
 *     else:
 *         import warnings
 *         warnings.warn("Platform unknown")             # <<<<<<<<<<<<<<
 *         return ""
 *     paths = [os.path.abspath(os.path.expanduser(p)) for p in paths]
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s_Platform_unknown) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Platform_unknown);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":512
 *         import warnings
 *         warnings.warn("Platform unknown")
 *         return ""             # <<<<<<<<<<<<<<
 *     paths = [os.path.abspath(os.path.expanduser(p)) for p in paths]
 *     for p in paths:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_s__9);
    __pyx_r = __pyx_kp_s__9;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "pysdif/_pysdif.pyx":513
 *         warnings.warn("Platform unknown")
 *         return ""
 *     paths = [os.path.abspath(os.path.expanduser(p)) for p in paths]             # <<<<<<<<<<<<<<
 *     for p in paths:
 *         p2 = os.path.join(p, "SdifTypes.STYP")
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_v_paths; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_abspath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_p);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_paths, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":514
 *         return ""
 *     paths = [os.path.abspath(os.path.expanduser(p)) for p in paths]
 *     for p in paths:             # <<<<<<<<<<<<<<
 *         p2 = os.path.join(p, "SdifTypes.STYP")
 *         if os.path.exists(p2):
 */
  __pyx_t_1 = __pyx_v_paths; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 514, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":515
 *     paths = [os.path.abspath(os.path.expanduser(p)) for p in paths]
 *     for p in paths:
 *         p2 = os.path.join(p, "SdifTypes.STYP")             # <<<<<<<<<<<<<<
 *         if os.path.exists(p2):
 *             return p2
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_p, __pyx_kp_s_SdifTypes_STYP};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_p, __pyx_kp_s_SdifTypes_STYP};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_p);
      __Pyx_GIVEREF(__pyx_v_p);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_p);
      __Pyx_INCREF(__pyx_kp_s_SdifTypes_STYP);
      __Pyx_GIVEREF(__pyx_kp_s_SdifTypes_STYP);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_kp_s_SdifTypes_STYP);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_p2, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":516
 *     for p in paths:
 *         p2 = os.path.join(p, "SdifTypes.STYP")
 *         if os.path.exists(p2):             # <<<<<<<<<<<<<<
 *             return p2
 *     else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_v_p2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_p2);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "pysdif/_pysdif.pyx":517
 *         p2 = os.path.join(p, "SdifTypes.STYP")
 *         if os.path.exists(p2):
 *             return p2             # <<<<<<<<<<<<<<
 *     else:
 *         packaged_sdiftypes = get_packaged_sdiftypes()
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_p2);
      __pyx_r = __pyx_v_p2;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "pysdif/_pysdif.pyx":516
 *     for p in paths:
 *         p2 = os.path.join(p, "SdifTypes.STYP")
 *         if os.path.exists(p2):             # <<<<<<<<<<<<<<
 *             return p2
 *     else:
 */
    }

    /* "pysdif/_pysdif.pyx":514
 *         return ""
 *     paths = [os.path.abspath(os.path.expanduser(p)) for p in paths]
 *     for p in paths:             # <<<<<<<<<<<<<<
 *         p2 = os.path.join(p, "SdifTypes.STYP")
 *         if os.path.exists(p2):
 */
  }
  /*else*/ {

    /* "pysdif/_pysdif.pyx":519
 *             return p2
 *     else:
 *         packaged_sdiftypes = get_packaged_sdiftypes()             # <<<<<<<<<<<<<<
 *         if packaged_sdiftypes is not None:
 *             return packaged_sdiftypes
 */
    __pyx_t_3 = __pyx_pf_6pysdif_7_pysdif_15_find_sdiftypes_get_packaged_sdiftypes(__pyx_v_get_packaged_sdiftypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_packaged_sdiftypes = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":520
 *     else:
 *         packaged_sdiftypes = get_packaged_sdiftypes()
 *         if packaged_sdiftypes is not None:             # <<<<<<<<<<<<<<
 *             return packaged_sdiftypes
 *     return ""
 */
    __pyx_t_4 = (__pyx_v_packaged_sdiftypes != Py_None);
    __pyx_t_11 = (__pyx_t_4 != 0);
    if (__pyx_t_11) {

      /* "pysdif/_pysdif.pyx":521
 *         packaged_sdiftypes = get_packaged_sdiftypes()
 *         if packaged_sdiftypes is not None:
 *             return packaged_sdiftypes             # <<<<<<<<<<<<<<
 *     return ""
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_packaged_sdiftypes);
      __pyx_r = __pyx_v_packaged_sdiftypes;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "pysdif/_pysdif.pyx":520
 *     else:
 *         packaged_sdiftypes = get_packaged_sdiftypes()
 *         if packaged_sdiftypes is not None:             # <<<<<<<<<<<<<<
 *             return packaged_sdiftypes
 *     return ""
 */
    }
  }

  /* "pysdif/_pysdif.pyx":514
 *         return ""
 *     paths = [os.path.abspath(os.path.expanduser(p)) for p in paths]
 *     for p in paths:             # <<<<<<<<<<<<<<
 *         p2 = os.path.join(p, "SdifTypes.STYP")
 *         if os.path.exists(p2):
 */
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":522
 *         if packaged_sdiftypes is not None:
 *             return packaged_sdiftypes
 *     return ""             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_kp_s__9);
  __pyx_r = __pyx_kp_s__9;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":489
 * # ----------------------------------------------------------------------
 * 
 * def _find_sdiftypes():             # <<<<<<<<<<<<<<
 * 
 *     def get_packaged_sdiftypes():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysdif._pysdif._find_sdiftypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_get_packaged_sdiftypes);
  __Pyx_XDECREF(__pyx_v_pl);
  __Pyx_XDECREF(__pyx_v_paths);
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_p2);
  __Pyx_XDECREF(__pyx_v_packaged_sdiftypes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":525
 * 
 * 
 * def sdif_init(sdiftypes_path=None):             # <<<<<<<<<<<<<<
 *     """
 *     Initialize the sdif library
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_15sdif_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_14sdif_init[] = "sdif_init(sdiftypes_path=None)\n\n    Initialize the sdif library \n\n    This function is called automatically whenever an instance of\n    SdifFile is created. Calling this function explicitely only has an\n    effect if done previous to any usage of the `pysdif` library, to \n    point the library to a `SdifTypes.STYP` file. This file is used\n    by the underlying code as a library for known SDIF frames and matrix\n    definitions. \n\n    If called without arguments, the default paths will be searched. If an empty \n    string is given, no `SdifTypes.STYP` will be used\n\n    Args:\n        sdiftypes_path (str): The path to `SdifTypes.STYP`, or None to search\n            in default paths\n\n    Returns:\n       (bool) True if the library was initialized, False if it was already \n       initialized. In such a case, the path passed will not have any effect\n    ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_15sdif_init = {"sdif_init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_15sdif_init, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_14sdif_init};
static PyObject *__pyx_pw_6pysdif_7_pysdif_15sdif_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sdiftypes_path = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sdif_init (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sdiftypes_path,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sdiftypes_path);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sdif_init") < 0)) __PYX_ERR(0, 525, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sdiftypes_path = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sdif_init", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 525, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.sdif_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_14sdif_init(__pyx_self, __pyx_v_sdiftypes_path);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_14sdif_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sdiftypes_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  const char* __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sdif_init", 0);
  __Pyx_INCREF(__pyx_v_sdiftypes_path);

  /* "pysdif/_pysdif.pyx":548
 *     """
 *     global _g_sdif_initiated
 *     import_array()             # <<<<<<<<<<<<<<
 *     if _g_sdif_initiated == 0:
 *         _g_sdif_initiated = 1
 */
  import_array();

  /* "pysdif/_pysdif.pyx":549
 *     global _g_sdif_initiated
 *     import_array()
 *     if _g_sdif_initiated == 0:             # <<<<<<<<<<<<<<
 *         _g_sdif_initiated = 1
 *         if sdiftypes_path is None:
 */
  __pyx_t_1 = ((__pyx_v_6pysdif_7_pysdif__g_sdif_initiated == 0) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":550
 *     import_array()
 *     if _g_sdif_initiated == 0:
 *         _g_sdif_initiated = 1             # <<<<<<<<<<<<<<
 *         if sdiftypes_path is None:
 *             sdiftypes_path = _find_sdiftypes()
 */
    __pyx_v_6pysdif_7_pysdif__g_sdif_initiated = 1;

    /* "pysdif/_pysdif.pyx":551
 *     if _g_sdif_initiated == 0:
 *         _g_sdif_initiated = 1
 *         if sdiftypes_path is None:             # <<<<<<<<<<<<<<
 *             sdiftypes_path = _find_sdiftypes()
 *         if os.path.exists(sdiftypes_path):
 */
    __pyx_t_1 = (__pyx_v_sdiftypes_path == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pysdif/_pysdif.pyx":552
 *         _g_sdif_initiated = 1
 *         if sdiftypes_path is None:
 *             sdiftypes_path = _find_sdiftypes()             # <<<<<<<<<<<<<<
 *         if os.path.exists(sdiftypes_path):
 *             SdifGenInitCond(asbytes(sdiftypes_path))
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_find_sdiftypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_sdiftypes_path, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pysdif/_pysdif.pyx":551
 *     if _g_sdif_initiated == 0:
 *         _g_sdif_initiated = 1
 *         if sdiftypes_path is None:             # <<<<<<<<<<<<<<
 *             sdiftypes_path = _find_sdiftypes()
 *         if os.path.exists(sdiftypes_path):
 */
    }

    /* "pysdif/_pysdif.pyx":553
 *         if sdiftypes_path is None:
 *             sdiftypes_path = _find_sdiftypes()
 *         if os.path.exists(sdiftypes_path):             # <<<<<<<<<<<<<<
 *             SdifGenInitCond(asbytes(sdiftypes_path))
 *             logger.info("Sdif initialized using path: %s" % sdiftypes_path)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_sdiftypes_path) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_sdiftypes_path);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "pysdif/_pysdif.pyx":554
 *             sdiftypes_path = _find_sdiftypes()
 *         if os.path.exists(sdiftypes_path):
 *             SdifGenInitCond(asbytes(sdiftypes_path))             # <<<<<<<<<<<<<<
 *             logger.info("Sdif initialized using path: %s" % sdiftypes_path)
 *         else:
 */
      __pyx_t_3 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_sdiftypes_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__pyx_t_3 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
        __PYX_ERR(0, 554, __pyx_L1_error)
      }
      __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_3); if (unlikely((__pyx_t_6 == ((const char*)NULL)) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L1_error)
      SdifGenInitCond(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pysdif/_pysdif.pyx":555
 *         if os.path.exists(sdiftypes_path):
 *             SdifGenInitCond(asbytes(sdiftypes_path))
 *             logger.info("Sdif initialized using path: %s" % sdiftypes_path)             # <<<<<<<<<<<<<<
 *         else:
 *             SdifGenInitCond(b"")
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Sdif_initialized_using_path_s, __pyx_v_sdiftypes_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pysdif/_pysdif.pyx":553
 *         if sdiftypes_path is None:
 *             sdiftypes_path = _find_sdiftypes()
 *         if os.path.exists(sdiftypes_path):             # <<<<<<<<<<<<<<
 *             SdifGenInitCond(asbytes(sdiftypes_path))
 *             logger.info("Sdif initialized using path: %s" % sdiftypes_path)
 */
      goto __pyx_L5;
    }

    /* "pysdif/_pysdif.pyx":557
 *             logger.info("Sdif initialized using path: %s" % sdiftypes_path)
 *         else:
 *             SdifGenInitCond(b"")             # <<<<<<<<<<<<<<
 *             logger.info("Sdif initialized without SdifTypes.")
 *         _frametypes_populate()
 */
    /*else*/ {
      SdifGenInitCond(((const char*)""));

      /* "pysdif/_pysdif.pyx":558
 *         else:
 *             SdifGenInitCond(b"")
 *             logger.info("Sdif initialized without SdifTypes.")             # <<<<<<<<<<<<<<
 *         _frametypes_populate()
 *     return bool(_g_sdif_initiated)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_Sdif_initialized_without_SdifTyp) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_Sdif_initialized_without_SdifTyp);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L5:;

    /* "pysdif/_pysdif.pyx":559
 *             SdifGenInitCond(b"")
 *             logger.info("Sdif initialized without SdifTypes.")
 *         _frametypes_populate()             # <<<<<<<<<<<<<<
 *     return bool(_g_sdif_initiated)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frametypes_populate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":549
 *     global _g_sdif_initiated
 *     import_array()
 *     if _g_sdif_initiated == 0:             # <<<<<<<<<<<<<<
 *         _g_sdif_initiated = 1
 *         if sdiftypes_path is None:
 */
  }

  /* "pysdif/_pysdif.pyx":560
 *             logger.info("Sdif initialized without SdifTypes.")
 *         _frametypes_populate()
 *     return bool(_g_sdif_initiated)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_6pysdif_7_pysdif__g_sdif_initiated); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":525
 * 
 * 
 * def sdif_init(sdiftypes_path=None):             # <<<<<<<<<<<<<<
 *     """
 *     Initialize the sdif library
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysdif._pysdif.sdif_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sdiftypes_path);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":563
 * 
 * 
 * def sdif_cleanup():             # <<<<<<<<<<<<<<
 *     SdifGenKill()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_17sdif_cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_16sdif_cleanup[] = "sdif_cleanup()";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_17sdif_cleanup = {"sdif_cleanup", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_17sdif_cleanup, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_16sdif_cleanup};
static PyObject *__pyx_pw_6pysdif_7_pysdif_17sdif_cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sdif_cleanup (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_16sdif_cleanup(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_16sdif_cleanup(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sdif_cleanup", 0);

  /* "pysdif/_pysdif.pyx":564
 * 
 * def sdif_cleanup():
 *     SdifGenKill()             # <<<<<<<<<<<<<<
 * 
 * # Forward declarations
 */
  SdifGenKill();

  /* "pysdif/_pysdif.pyx":563
 * 
 * 
 * def sdif_cleanup():             # <<<<<<<<<<<<<<
 *     SdifGenKill()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":606
 * )
 * 
 * def framestatus2str(int status):             # <<<<<<<<<<<<<<
 *     if 0 <= status < 6:
 *         return _framestatus2str[status]
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_19framestatus2str(PyObject *__pyx_self, PyObject *__pyx_arg_status); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_18framestatus2str[] = "framestatus2str(int status)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_19framestatus2str = {"framestatus2str", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_19framestatus2str, METH_O, __pyx_doc_6pysdif_7_pysdif_18framestatus2str};
static PyObject *__pyx_pw_6pysdif_7_pysdif_19framestatus2str(PyObject *__pyx_self, PyObject *__pyx_arg_status) {
  int __pyx_v_status;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("framestatus2str (wrapper)", 0);
  assert(__pyx_arg_status); {
    __pyx_v_status = __Pyx_PyInt_As_int(__pyx_arg_status); if (unlikely((__pyx_v_status == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 606, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.framestatus2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_18framestatus2str(__pyx_self, ((int)__pyx_v_status));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_18framestatus2str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_status) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("framestatus2str", 0);

  /* "pysdif/_pysdif.pyx":607
 * 
 * def framestatus2str(int status):
 *     if 0 <= status < 6:             # <<<<<<<<<<<<<<
 *         return _framestatus2str[status]
 *     return None
 */
  __pyx_t_1 = (0 <= __pyx_v_status);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_status < 6);
  }
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pysdif/_pysdif.pyx":608
 * def framestatus2str(int status):
 *     if 0 <= status < 6:
 *         return _framestatus2str[status]             # <<<<<<<<<<<<<<
 *     return None
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_6pysdif_7_pysdif__framestatus2str == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 608, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_6pysdif_7_pysdif__framestatus2str, __pyx_v_status, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":607
 * 
 * def framestatus2str(int status):
 *     if 0 <= status < 6:             # <<<<<<<<<<<<<<
 *         return _framestatus2str[status]
 *     return None
 */
  }

  /* "pysdif/_pysdif.pyx":609
 *     if 0 <= status < 6:
 *         return _framestatus2str[status]
 *     return None             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _matrixstatus2str = (
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":606
 * )
 * 
 * def framestatus2str(int status):             # <<<<<<<<<<<<<<
 *     if 0 <= status < 6:
 *         return _framestatus2str[status]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.framestatus2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":620
 * )
 * 
 * def matrixstatus2str(int status):             # <<<<<<<<<<<<<<
 *     """
 *     Return a string identifier for a matrix status.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_21matrixstatus2str(PyObject *__pyx_self, PyObject *__pyx_arg_status); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_20matrixstatus2str[] = "matrixstatus2str(int status)\n\n    Return a string identifier for a matrix status. \n\n    Args:\n        status (int): The matrix status \n\n    Returns:\n        (str) A corresponding string identifier\n\n    ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_21matrixstatus2str = {"matrixstatus2str", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_21matrixstatus2str, METH_O, __pyx_doc_6pysdif_7_pysdif_20matrixstatus2str};
static PyObject *__pyx_pw_6pysdif_7_pysdif_21matrixstatus2str(PyObject *__pyx_self, PyObject *__pyx_arg_status) {
  int __pyx_v_status;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrixstatus2str (wrapper)", 0);
  assert(__pyx_arg_status); {
    __pyx_v_status = __Pyx_PyInt_As_int(__pyx_arg_status); if (unlikely((__pyx_v_status == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.matrixstatus2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_20matrixstatus2str(__pyx_self, ((int)__pyx_v_status));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_20matrixstatus2str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_status) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrixstatus2str", 0);

  /* "pysdif/_pysdif.pyx":631
 * 
 *     """
 *     if 0 <= status < 6:             # <<<<<<<<<<<<<<
 *         return _matrixstatus2str[status]
 *     return None
 */
  __pyx_t_1 = (0 <= __pyx_v_status);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_status < 6);
  }
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pysdif/_pysdif.pyx":632
 *     """
 *     if 0 <= status < 6:
 *         return _matrixstatus2str[status]             # <<<<<<<<<<<<<<
 *     return None
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_6pysdif_7_pysdif__matrixstatus2str == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 632, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_6pysdif_7_pysdif__matrixstatus2str, __pyx_v_status, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":631
 * 
 *     """
 *     if 0 <= status < 6:             # <<<<<<<<<<<<<<
 *         return _matrixstatus2str[status]
 *     return None
 */
  }

  /* "pysdif/_pysdif.pyx":633
 *     if 0 <= status < 6:
 *         return _matrixstatus2str[status]
 *     return None             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":620
 * )
 * 
 * def matrixstatus2str(int status):             # <<<<<<<<<<<<<<
 *     """
 *     Return a string identifier for a matrix status.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.matrixstatus2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":671
 *     cdef int _valid
 * 
 *     def __cinit__(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         if source is not None:
 *             self.source = source
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_6Matrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_6Matrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 671, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 671, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) __PYX_ERR(0, 671, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix___cinit__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self), __pyx_v_source);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_6Matrix___cinit__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  SdifFileT *__pyx_t_3;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pysdif/_pysdif.pyx":672
 * 
 *     def __cinit__(self, SdifFile source):
 *         if source is not None:             # <<<<<<<<<<<<<<
 *             self.source = source
 *             self.source_this = source.this
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_source) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pysdif/_pysdif.pyx":673
 *     def __cinit__(self, SdifFile source):
 *         if source is not None:
 *             self.source = source             # <<<<<<<<<<<<<<
 *             self.source_this = source.this
 *             self.data = None
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_source));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_source));
    __Pyx_GOTREF(__pyx_v_self->source);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->source));
    __pyx_v_self->source = __pyx_v_source;

    /* "pysdif/_pysdif.pyx":674
 *         if source is not None:
 *             self.source = source
 *             self.source_this = source.this             # <<<<<<<<<<<<<<
 *             self.data = None
 *             self._signature = 0
 */
    __pyx_t_3 = __pyx_v_source->this;
    __pyx_v_self->source_this = __pyx_t_3;

    /* "pysdif/_pysdif.pyx":675
 *             self.source = source
 *             self.source_this = source.this
 *             self.data = None             # <<<<<<<<<<<<<<
 *             self._signature = 0
 *             self._status = eMatrixHeaderRead
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->data);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->data));
    __pyx_v_self->data = ((PyArrayObject *)Py_None);

    /* "pysdif/_pysdif.pyx":676
 *             self.source_this = source.this
 *             self.data = None
 *             self._signature = 0             # <<<<<<<<<<<<<<
 *             self._status = eMatrixHeaderRead
 *         else:
 */
    __pyx_v_self->_signature = 0;

    /* "pysdif/_pysdif.pyx":677
 *             self.data = None
 *             self._signature = 0
 *             self._status = eMatrixHeaderRead             # <<<<<<<<<<<<<<
 *         else:
 *             self.source_this = NULL
 */
    __pyx_v_self->_status = __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead;

    /* "pysdif/_pysdif.pyx":672
 * 
 *     def __cinit__(self, SdifFile source):
 *         if source is not None:             # <<<<<<<<<<<<<<
 *             self.source = source
 *             self.source_this = source.this
 */
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":679
 *             self._status = eMatrixHeaderRead
 *         else:
 *             self.source_this = NULL             # <<<<<<<<<<<<<<
 *             self._status = eMatrixOffline
 * 
 */
  /*else*/ {
    __pyx_v_self->source_this = NULL;

    /* "pysdif/_pysdif.pyx":680
 *         else:
 *             self.source_this = NULL
 *             self._status = eMatrixOffline             # <<<<<<<<<<<<<<
 * 
 *     property rows:
 */
    __pyx_v_self->_status = __pyx_e_6pysdif_7_pysdif_eMatrixOffline;
  }
  __pyx_L3:;

  /* "pysdif/_pysdif.pyx":671
 *     cdef int _valid
 * 
 *     def __cinit__(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         if source is not None:
 *             self.source = source
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":683
 * 
 *     property rows:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this:
 *                 return self.source_this.CurrMtrxH.NbRow
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_4rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_4rows___get__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4rows___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":684
 *     property rows:
 *         def __get__(self):
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return self.source_this.CurrMtrxH.NbRow
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->source_this != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":685
 *         def __get__(self):
 *             if self.source_this:
 *                 return self.source_this.CurrMtrxH.NbRow             # <<<<<<<<<<<<<<
 *             else:
 *                 return len(self.data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->source_this->CurrMtrxH->NbRow); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":684
 *     property rows:
 *         def __get__(self):
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return self.source_this.CurrMtrxH.NbRow
 *             else:
 */
  }

  /* "pysdif/_pysdif.pyx":687
 *                 return self.source_this.CurrMtrxH.NbRow
 *             else:
 *                 return len(self.data)             # <<<<<<<<<<<<<<
 * 
 *     property cols:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_v_self->data);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pysdif/_pysdif.pyx":683
 * 
 *     property rows:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this:
 *                 return self.source_this.CurrMtrxH.NbRow
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":690
 * 
 *     property cols:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this:
 *                 return self.source_this.CurrMtrxH.NbCol
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_4cols_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_4cols___get__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4cols___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":691
 *     property cols:
 *         def __get__(self):
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return self.source_this.CurrMtrxH.NbCol
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->source_this != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":692
 *         def __get__(self):
 *             if self.source_this:
 *                 return self.source_this.CurrMtrxH.NbCol             # <<<<<<<<<<<<<<
 *             else:
 *                 return len(self.data[0])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->source_this->CurrMtrxH->NbCol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":691
 *     property cols:
 *         def __get__(self):
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return self.source_this.CurrMtrxH.NbCol
 *             else:
 */
  }

  /* "pysdif/_pysdif.pyx":694
 *                 return self.source_this.CurrMtrxH.NbCol
 *             else:
 *                 return len(self.data[0])             # <<<<<<<<<<<<<<
 * 
 *     property dtype:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->data), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pysdif/_pysdif.pyx":690
 * 
 *     property cols:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this:
 *                 return self.source_this.CurrMtrxH.NbCol
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.cols.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":697
 * 
 *     property dtype:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this:
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_5dtype_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_5dtype___get__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_5dtype___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":698
 *     property dtype:
 *         def __get__(self):
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->source_this != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":699
 *         def __get__(self):
 *             if self.source_this:
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.data.dtype
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 699, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_enum__SdifDataTypeE(__pyx_v_self->source_this->CurrMtrxH->DataType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":698
 *     property dtype:
 *         def __get__(self):
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]
 *             else:
 */
  }

  /* "pysdif/_pysdif.pyx":701
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]
 *             else:
 *                 return self.data.dtype             # <<<<<<<<<<<<<<
 * 
 *     property signature:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pysdif/_pysdif.pyx":697
 * 
 *     property dtype:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this:
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.dtype.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":704
 * 
 *     property signature:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this:
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_9signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_9signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_9signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":705
 *     property signature:
 *         def __get__(self):
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->source_this != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":706
 *         def __get__(self):
 *             if self.source_this:
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)             # <<<<<<<<<<<<<<
 *             else:
 *                 return sig2str(self._signature)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_self->source_this->CurrMtrxH->Signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":705
 *     property signature:
 *         def __get__(self):
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)
 *             else:
 */
  }

  /* "pysdif/_pysdif.pyx":708
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)
 *             else:
 *                 return sig2str(self._signature)             # <<<<<<<<<<<<<<
 * 
 *     property numerical_signature:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_self->_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pysdif/_pysdif.pyx":704
 * 
 *     property signature:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this:
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.signature.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":711
 * 
 *     property numerical_signature:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             #if self.header:
 *             if self.source_this:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_19numerical_signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_19numerical_signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_19numerical_signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_19numerical_signature___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":713
 *         def __get__(self):
 *             #if self.header:
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return self.source_this.CurrMtrxH.Signature
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->source_this != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":714
 *             #if self.header:
 *             if self.source_this:
 *                 return self.source_this.CurrMtrxH.Signature             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._signature
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->source_this->CurrMtrxH->Signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":713
 *         def __get__(self):
 *             #if self.header:
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return self.source_this.CurrMtrxH.Signature
 *             else:
 */
  }

  /* "pysdif/_pysdif.pyx":716
 *                 return self.source_this.CurrMtrxH.Signature
 *             else:
 *                 return self._signature             # <<<<<<<<<<<<<<
 * 
 *     def get_data(self, copy=True):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pysdif/_pysdif.pyx":711
 * 
 *     property numerical_signature:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             #if self.header:
 *             if self.source_this:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.numerical_signature.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":718
 *                 return self._signature
 * 
 *     def get_data(self, copy=True):             # <<<<<<<<<<<<<<
 *         """
 *         Read the data from the matrix as a numpy array
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_3get_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6Matrix_2get_data[] = "Matrix.get_data(self, copy=True)\n\n        Read the data from the matrix as a numpy array\n        \n        !!! note\n\n            If copy is False, the data is not copied to the array. \n            The array is only a 'view' of this data and does not own it,\n            so it is only valid until you read a new matrix. \n        \n            If you want to keep the data, do get_data(copy=True) or call\n            .copy() on the resulting numpy array \n       \n        Args:\n            copy (bool): if True, the returned data is a copy of the data read\n                and will not be invalidated\n\n        Returns:\n            (numpy.array) The data as a numpy.array. If copy==False, this data\n            is a view on the decoded data and will be invalidated when a new\n            matrix is read\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6Matrix_3get_data = {"get_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_6Matrix_3get_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_6Matrix_2get_data};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_3get_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_copy = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copy);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_data") < 0)) __PYX_ERR(0, 718, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_copy = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_data", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 718, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_2get_data(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self), __pyx_v_copy);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_2get_data(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self, PyObject *__pyx_v_copy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data", 0);

  /* "pysdif/_pysdif.pyx":740
 *             matrix is read
 *         """
 *         if self.source.matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             self.source._matrix_read_data()
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->source->matrix_status == __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":741
 *         """
 *         if self.source.matrix_status == eMatrixHeaderRead:
 *             self.source._matrix_read_data()             # <<<<<<<<<<<<<<
 * 
 *         if copy:
 */
    (void)(__pyx_f_6pysdif_7_pysdif_8SdifFile__matrix_read_data(__pyx_v_self->source));

    /* "pysdif/_pysdif.pyx":740
 *             matrix is read
 *         """
 *         if self.source.matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             self.source._matrix_read_data()
 * 
 */
  }

  /* "pysdif/_pysdif.pyx":743
 *             self.source._matrix_read_data()
 * 
 *         if copy:             # <<<<<<<<<<<<<<
 *             return _array_from_matrix_data_copy(self.source_this.CurrMtrxData)
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_copy); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 743, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":744
 * 
 *         if copy:
 *             return _array_from_matrix_data_copy(self.source_this.CurrMtrxData)             # <<<<<<<<<<<<<<
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_copy(__pyx_v_self->source_this->CurrMtrxData)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":743
 *             self.source._matrix_read_data()
 * 
 *         if copy:             # <<<<<<<<<<<<<<
 *             return _array_from_matrix_data_copy(self.source_this.CurrMtrxData)
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 */
  }

  /* "pysdif/_pysdif.pyx":745
 *         if copy:
 *             return _array_from_matrix_data_copy(self.source_this.CurrMtrxData)
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)             # <<<<<<<<<<<<<<
 * 
 *     def column_names(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(__pyx_v_self->source_this->CurrMtrxData)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":718
 *                 return self._signature
 * 
 *     def get_data(self, copy=True):             # <<<<<<<<<<<<<<
 *         """
 *         Read the data from the matrix as a numpy array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":747
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 * 
 *     def column_names(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of column names for the current matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_5column_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6Matrix_4column_names[] = "Matrix.column_names(self)\n\n        Returns a list of column names for the current matrix\n\n        Returns:\n            (list[str]) Column names\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6Matrix_5column_names = {"column_names", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6Matrix_5column_names, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6Matrix_4column_names};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_5column_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("column_names (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_4column_names(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4column_names(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_v_sig = 0;
  PyObject *__pyx_v_matrixtypes = NULL;
  PyObject *__pyx_v_colnames = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_mtd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("column_names", 0);

  /* "pysdif/_pysdif.pyx":754
 *             (list[str]) Column names
 *         """
 *         cdef bytes sig = self.signature             # <<<<<<<<<<<<<<
 *         matrixtypes = {mtd.signaturesture: mtd.column_names for mtd in self.source.get_matrix_types()}
 *         colnames = matrixtypes.get(sig)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 754, __pyx_L1_error)
  __pyx_v_sig = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":755
 *         """
 *         cdef bytes sig = self.signature
 *         matrixtypes = {mtd.signaturesture: mtd.column_names for mtd in self.source.get_matrix_types()}             # <<<<<<<<<<<<<<
 *         colnames = matrixtypes.get(sig)
 *         if colnames is None:
 */
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->source), __pyx_n_s_get_matrix_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 755, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 755, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 755, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 755, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_mtd, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_mtd, __pyx_n_s_signaturesture); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_mtd, __pyx_n_s_column_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 755, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_mtd); __pyx_8genexpr3__pyx_v_mtd = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_mtd); __pyx_8genexpr3__pyx_v_mtd = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_v_matrixtypes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":756
 *         cdef bytes sig = self.signature
 *         matrixtypes = {mtd.signaturesture: mtd.column_names for mtd in self.source.get_matrix_types()}
 *         colnames = matrixtypes.get(sig)             # <<<<<<<<<<<<<<
 *         if colnames is None:
 *             raise KeyError("This matrix type ({sig}) does not seem to be defined!".format(sig=sig))
 */
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_matrixtypes, __pyx_v_sig, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_colnames = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":757
 *         matrixtypes = {mtd.signaturesture: mtd.column_names for mtd in self.source.get_matrix_types()}
 *         colnames = matrixtypes.get(sig)
 *         if colnames is None:             # <<<<<<<<<<<<<<
 *             raise KeyError("This matrix type ({sig}) does not seem to be defined!".format(sig=sig))
 *         return colnames
 */
  __pyx_t_7 = (__pyx_v_colnames == Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (unlikely(__pyx_t_8)) {

    /* "pysdif/_pysdif.pyx":758
 *         colnames = matrixtypes.get(sig)
 *         if colnames is None:
 *             raise KeyError("This matrix type ({sig}) does not seem to be defined!".format(sig=sig))             # <<<<<<<<<<<<<<
 *         return colnames
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_This_matrix_type_sig_does_not_se, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sig, __pyx_v_sig) < 0) __PYX_ERR(0, 758, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 758, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":757
 *         matrixtypes = {mtd.signaturesture: mtd.column_names for mtd in self.source.get_matrix_types()}
 *         colnames = matrixtypes.get(sig)
 *         if colnames is None:             # <<<<<<<<<<<<<<
 *             raise KeyError("This matrix type ({sig}) does not seem to be defined!".format(sig=sig))
 *         return colnames
 */
  }

  /* "pysdif/_pysdif.pyx":759
 *         if colnames is None:
 *             raise KeyError("This matrix type ({sig}) does not seem to be defined!".format(sig=sig))
 *         return colnames             # <<<<<<<<<<<<<<
 * 
 *     def skip(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_colnames);
  __pyx_r = __pyx_v_colnames;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":747
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 * 
 *     def column_names(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of column names for the current matrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.column_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XDECREF(__pyx_v_matrixtypes);
  __Pyx_XDECREF(__pyx_v_colnames);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_mtd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":761
 *         return colnames
 * 
 *     def skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skip reading the data
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_7skip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6Matrix_6skip[] = "Matrix.skip(self)\n\n        Skip reading the data \n\n        This method can only be called if the data was not already read\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6Matrix_7skip = {"skip", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6Matrix_7skip, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6Matrix_6skip};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_7skip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("skip (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_6skip(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_6skip(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("skip", 0);

  /* "pysdif/_pysdif.pyx":767
 *         This method can only be called if the data was not already read
 *         """
 *         if self.status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             self.source.matrix_skip_data()
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_MatrixStatusE(__pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(__pyx_t_4)) {

    /* "pysdif/_pysdif.pyx":768
 *         """
 *         if self.status == eMatrixHeaderRead:
 *             self.source.matrix_skip_data()             # <<<<<<<<<<<<<<
 *         else:
 *             raise SdifOrderError("Can't skip the matrix, status is %s" % (matrixstatus2str(self._status)))
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->source), __pyx_n_s_matrix_skip_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":767
 *         This method can only be called if the data was not already read
 *         """
 *         if self.status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             self.source.matrix_skip_data()
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":770
 *             self.source.matrix_skip_data()
 *         else:
 *             raise SdifOrderError("Can't skip the matrix, status is %s" % (matrixstatus2str(self._status)))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_matrixstatus2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_MatrixStatusE(__pyx_v_self->_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Can_t_skip_the_matrix_status_is, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 770, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pysdif/_pysdif.pyx":761
 *         return colnames
 * 
 *     def skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skip reading the data
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.skip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":772
 *             raise SdifOrderError("Can't skip the matrix, status is %s" % (matrixstatus2str(self._status)))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)" % (
 *                self.signature, self.rows, self.cols, str(self.dtype))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_9__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_8__repr__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_8__repr__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pysdif/_pysdif.pyx":773
 * 
 *     def __repr__(self):
 *         return "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)" % (             # <<<<<<<<<<<<<<
 *                self.signature, self.rows, self.cols, str(self.dtype))
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pysdif/_pysdif.pyx":774
 *     def __repr__(self):
 *         return "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)" % (
 *                self.signature, self.rows, self.cols, str(self.dtype))             # <<<<<<<<<<<<<<
 * 
 *     property status:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cols); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;

  /* "pysdif/_pysdif.pyx":773
 * 
 *     def __repr__(self):
 *         return "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)" % (             # <<<<<<<<<<<<<<
 *                self.signature, self.rows, self.cols, str(self.dtype))
 * 
 */
  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Matrix_sig_s_rows_d_cols_d_dtype, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":772
 *             raise SdifOrderError("Can't skip the matrix, status is %s" % (matrixstatus2str(self._status)))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)" % (
 *                self.signature, self.rows, self.cols, str(self.dtype))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":777
 * 
 *     property status:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this != NULL:
 *                 return self.source.matrix_status
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_6status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_6status_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_6status___get__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_6status___get__(struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":778
 *     property status:
 *         def __get__(self):
 *             if self.source_this != NULL:             # <<<<<<<<<<<<<<
 *                 return self.source.matrix_status
 *             else:
 */
  __pyx_t_1 = ((__pyx_v_self->source_this != NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":779
 *         def __get__(self):
 *             if self.source_this != NULL:
 *                 return self.source.matrix_status             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._status
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_MatrixStatusE(__pyx_v_self->source->matrix_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":778
 *     property status:
 *         def __get__(self):
 *             if self.source_this != NULL:             # <<<<<<<<<<<<<<
 *                 return self.source.matrix_status
 *             else:
 */
  }

  /* "pysdif/_pysdif.pyx":781
 *                 return self.source.matrix_status
 *             else:
 *                 return self._status             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_MatrixStatusE(__pyx_v_self->_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pysdif/_pysdif.pyx":777
 * 
 *     property status:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.source_this != NULL:
 *                 return self.source.matrix_status
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6Matrix_10__reduce_cython__[] = "Matrix.__reduce_cython__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6Matrix_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6Matrix_11__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6Matrix_10__reduce_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_10__reduce_cython__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6Matrix_12__setstate_cython__[] = "Matrix.__setstate_cython__(self, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6Matrix_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6Matrix_13__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_6Matrix_12__setstate_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6Matrix_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6Matrix_12__setstate_cython__(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":820
 *     cdef SdifFileT *source_this
 * 
 *     def __cinit__(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         self.source = source
 *         self.source_this = source.this
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_6FrameR_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_6FrameR_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 820, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 820, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) __PYX_ERR(0, 820, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR___cinit__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self), __pyx_v_source);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_6FrameR___cinit__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  SdifFileT *__pyx_t_1;
  SdifFrameHeaderT *__pyx_t_2;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pysdif/_pysdif.pyx":821
 * 
 *     def __cinit__(self, SdifFile source):
 *         self.source = source             # <<<<<<<<<<<<<<
 *         self.source_this = source.this
 *         self.header = source.this.CurrFramH
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_source));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_source));
  __Pyx_GOTREF(__pyx_v_self->source);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->source));
  __pyx_v_self->source = __pyx_v_source;

  /* "pysdif/_pysdif.pyx":822
 *     def __cinit__(self, SdifFile source):
 *         self.source = source
 *         self.source_this = source.this             # <<<<<<<<<<<<<<
 *         self.header = source.this.CurrFramH
 * 
 */
  __pyx_t_1 = __pyx_v_source->this;
  __pyx_v_self->source_this = __pyx_t_1;

  /* "pysdif/_pysdif.pyx":823
 *         self.source = source
 *         self.source_this = source.this
 *         self.header = source.this.CurrFramH             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_2 = __pyx_v_source->this->CurrFramH;
  __pyx_v_self->header = __pyx_t_2;

  /* "pysdif/_pysdif.pyx":820
 *     cdef SdifFileT *source_this
 * 
 *     def __cinit__(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         self.source = source
 *         self.source_this = source.this
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":825
 *         self.header = source.this.CurrFramH
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.source = None
 * 
 */

/* Python wrapper */
static void __pyx_pw_6pysdif_7_pysdif_6FrameR_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6pysdif_7_pysdif_6FrameR_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6pysdif_7_pysdif_6FrameR_2__dealloc__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_6pysdif_7_pysdif_6FrameR_2__dealloc__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pysdif/_pysdif.pyx":826
 * 
 *     def __dealloc__(self):
 *         self.source = None             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->source);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->source));
  __pyx_v_self->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None);

  /* "pysdif/_pysdif.pyx":825
 *         self.header = source.this.CurrFramH
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.source = None
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pysdif/_pysdif.pyx":828
 *         self.source = None
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "FrameR(signature={sig}, time={t}, matrices={num}, idx={idx})".format(
 *             sig=self.signature, t=self.time, num=self.num_matrices, idx=self.matrix_idx)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_4__repr__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4__repr__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pysdif/_pysdif.pyx":829
 * 
 *     def __repr__(self):
 *         return "FrameR(signature={sig}, time={t}, matrices={num}, idx={idx})".format(             # <<<<<<<<<<<<<<
 *             sig=self.signature, t=self.time, num=self.num_matrices, idx=self.matrix_idx)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FrameR_signature_sig_time_t_matr, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pysdif/_pysdif.pyx":830
 *     def __repr__(self):
 *         return "FrameR(signature={sig}, time={t}, matrices={num}, idx={idx})".format(
 *             sig=self.signature, t=self.time, num=self.num_matrices, idx=self.matrix_idx)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_signature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sig, __pyx_t_3) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_t, __pyx_t_3) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_matrices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num, __pyx_t_3) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_idx, __pyx_t_3) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":829
 * 
 *     def __repr__(self):
 *         return "FrameR(signature={sig}, time={t}, matrices={num}, idx={idx})".format(             # <<<<<<<<<<<<<<
 *             sig=self.signature, t=self.time, num=self.num_matrices, idx=self.matrix_idx)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":828
 *         self.source = None
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "FrameR(signature={sig}, time={t}, matrices={num}, idx={idx})".format(
 *             sig=self.signature, t=self.time, num=self.num_matrices, idx=self.matrix_idx)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":833
 * 
 *     @property
 *     def signature(self):             # <<<<<<<<<<<<<<
 *         """ (str) The string signature of this frame """
 *         return sig2str(self.source_this.CurrFramH.Signature)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_9signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_9signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_9signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":835
 *     def signature(self):
 *         """ (str) The string signature of this frame """
 *         return sig2str(self.source_this.CurrFramH.Signature)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_self->source_this->CurrFramH->Signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":833
 * 
 *     @property
 *     def signature(self):             # <<<<<<<<<<<<<<
 *         """ (str) The string signature of this frame """
 *         return sig2str(self.source_this.CurrFramH.Signature)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.signature.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":838
 * 
 *     @property
 *     def numerical_signature(self):             # <<<<<<<<<<<<<<
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_19numerical_signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_19numerical_signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_19numerical_signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_19numerical_signature___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":839
 *     @property
 *     def numerical_signature(self):
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Signature
 */
  __pyx_t_1 = ((__pyx_v_self->source_this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":840
 *     def numerical_signature(self):
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")             # <<<<<<<<<<<<<<
 *         return self.source_this.CurrFramH.Signature
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_The_header_of_the_current_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_The_header_of_the_current_frame);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 840, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":839
 *     @property
 *     def numerical_signature(self):
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Signature
 */
  }

  /* "pysdif/_pysdif.pyx":841
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Signature             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->source_this->CurrFramH->Signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":838
 * 
 *     @property
 *     def numerical_signature(self):             # <<<<<<<<<<<<<<
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.numerical_signature.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":844
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         (int) The size of this frame in bytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_4size___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4size___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":848
 *         (int) The size of this frame in bytes
 *         """
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Size
 */
  __pyx_t_1 = ((__pyx_v_self->source_this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":849
 *         """
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")             # <<<<<<<<<<<<<<
 *         return self.source_this.CurrFramH.Size
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_The_header_of_the_current_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_The_header_of_the_current_frame);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 849, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":848
 *         (int) The size of this frame in bytes
 *         """
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Size
 */
  }

  /* "pysdif/_pysdif.pyx":850
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Size             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->source_this->CurrFramH->Size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":844
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         (int) The size of this frame in bytes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":853
 * 
 *     @property
 *     def num_matrices(self):             # <<<<<<<<<<<<<<
 *         """
 *         (int) The number of matrices in this frame
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_12num_matrices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_12num_matrices_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_12num_matrices___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_12num_matrices___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":857
 *         (int) The number of matrices in this frame
 *         """
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.NbMatrix
 */
  __pyx_t_1 = ((__pyx_v_self->source_this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":858
 *         """
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")             # <<<<<<<<<<<<<<
 *         return self.source_this.CurrFramH.NbMatrix
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_The_header_of_the_current_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_The_header_of_the_current_frame);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 858, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":857
 *         (int) The number of matrices in this frame
 *         """
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.NbMatrix
 */
  }

  /* "pysdif/_pysdif.pyx":859
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.NbMatrix             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->source_this->CurrFramH->NbMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":853
 * 
 *     @property
 *     def num_matrices(self):             # <<<<<<<<<<<<<<
 *         """
 *         (int) The number of matrices in this frame
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.num_matrices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":861
 *         return self.source_this.CurrFramH.NbMatrix
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.num_matrices
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_6pysdif_7_pysdif_6FrameR_7__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_6pysdif_7_pysdif_6FrameR_7__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_6__len__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_6pysdif_7_pysdif_6FrameR_6__len__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pysdif/_pysdif.pyx":862
 * 
 *     def __len__(self):
 *         return self.num_matrices             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_matrices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":861
 *         return self.source_this.CurrFramH.NbMatrix
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.num_matrices
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":865
 * 
 *     @property
 *     def id(self):             # <<<<<<<<<<<<<<
 *         """ (int) The id of this frame """
 *         if self.source_this.CurrFramH == NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_2id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_2id___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_2id___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":867
 *     def id(self):
 *         """ (int) The id of this frame """
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.NumID
 */
  __pyx_t_1 = ((__pyx_v_self->source_this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":868
 *         """ (int) The id of this frame """
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")             # <<<<<<<<<<<<<<
 *         return self.source_this.CurrFramH.NumID
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_The_header_of_the_current_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_The_header_of_the_current_frame);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 868, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":867
 *     def id(self):
 *         """ (int) The id of this frame """
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.NumID
 */
  }

  /* "pysdif/_pysdif.pyx":869
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.NumID             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->source_this->CurrFramH->NumID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":865
 * 
 *     @property
 *     def id(self):             # <<<<<<<<<<<<<<
 *         """ (int) The id of this frame """
 *         if self.source_this.CurrFramH == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":872
 * 
 *     @property
 *     def time(self):             # <<<<<<<<<<<<<<
 *         """ (float) The time of this frame """
 *         if self.source_this.CurrFramH == NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_4time_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_4time_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_4time___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4time___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":874
 *     def time(self):
 *         """ (float) The time of this frame """
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Time
 */
  __pyx_t_1 = ((__pyx_v_self->source_this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":875
 *         """ (float) The time of this frame """
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")             # <<<<<<<<<<<<<<
 *         return self.source_this.CurrFramH.Time
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_The_header_of_the_current_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_The_header_of_the_current_frame);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 875, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":874
 *     def time(self):
 *         """ (float) The time of this frame """
 *         if self.source_this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Time
 */
  }

  /* "pysdif/_pysdif.pyx":876
 *         if self.source_this.CurrFramH == NULL:
 *             raise SdifOrderError("The header of the current frame has not been read")
 *         return self.source_this.CurrFramH.Time             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->source_this->CurrFramH->Time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":872
 * 
 *     @property
 *     def time(self):             # <<<<<<<<<<<<<<
 *         """ (float) The time of this frame """
 *         if self.source_this.CurrFramH == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":879
 * 
 *     @property
 *     def matrix_idx(self):             # <<<<<<<<<<<<<<
 *         """The index of the current matrix"""
 *         return self.source.matrix_idx
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_10matrix_idx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_10matrix_idx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_10matrix_idx___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_10matrix_idx___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":881
 *     def matrix_idx(self):
 *         """The index of the current matrix"""
 *         return self.source.matrix_idx             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->source->matrix_idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":879
 * 
 *     @property
 *     def matrix_idx(self):             # <<<<<<<<<<<<<<
 *         """The index of the current matrix"""
 *         return self.source.matrix_idx
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.matrix_idx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":883
 *         return self.source.matrix_idx
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         if self.source.frame_status >= eFrameSomeDataRead:
 *             raise RuntimeError("A Frame can only be iterated once")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_9__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_9__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_8__iter__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_8__iter__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pysdif/_pysdif.pyx":884
 * 
 *     def __iter__(self):
 *         if self.source.frame_status >= eFrameSomeDataRead:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("A Frame can only be iterated once")
 *         self.source.frame_status = eFrameSomeDataRead
 */
  __pyx_t_1 = ((__pyx_v_self->source->frame_status >= __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":885
 *     def __iter__(self):
 *         if self.source.frame_status >= eFrameSomeDataRead:
 *             raise RuntimeError("A Frame can only be iterated once")             # <<<<<<<<<<<<<<
 *         self.source.frame_status = eFrameSomeDataRead
 *         return self
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 885, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":884
 * 
 *     def __iter__(self):
 *         if self.source.frame_status >= eFrameSomeDataRead:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("A Frame can only be iterated once")
 *         self.source.frame_status = eFrameSomeDataRead
 */
  }

  /* "pysdif/_pysdif.pyx":886
 *         if self.source.frame_status >= eFrameSomeDataRead:
 *             raise RuntimeError("A Frame can only be iterated once")
 *         self.source.frame_status = eFrameSomeDataRead             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_v_self->source->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead;

  /* "pysdif/_pysdif.pyx":887
 *             raise RuntimeError("A Frame can only be iterated once")
 *         self.source.frame_status = eFrameSomeDataRead
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":883
 *         return self.source.matrix_idx
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         if self.source.frame_status >= eFrameSomeDataRead:
 *             raise RuntimeError("A Frame can only be iterated once")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":889
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next matrix in this Frame. Raises StopIteration if no more matrices
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_11__next__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameR_10__next__[] = "\n        Read next matrix in this Frame. Raises StopIteration if no more matrices\n\n        Returns:\n            (Matrix) the next matrix in this frame\n\n        !!! note\n\n            Only the header of the matrix will be read, to read the data\n            you must call the method matrix.get_data() on the resulting Matrix\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_6pysdif_7_pysdif_6FrameR_10__next__;
#endif
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_11__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_10__next__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_10__next__(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_v_matrix = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pysdif/_pysdif.pyx":901
 *             you must call the method matrix.get_data() on the resulting Matrix
 *         """
 *         matrix = self.source.next_matrix()             # <<<<<<<<<<<<<<
 *         if matrix is None:
 *             raise StopIteration
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->source), __pyx_n_s_next_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_matrix = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":902
 *         """
 *         matrix = self.source.next_matrix()
 *         if matrix is None:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return matrix
 */
  __pyx_t_4 = (__pyx_v_matrix == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pysdif/_pysdif.pyx":903
 *         matrix = self.source.next_matrix()
 *         if matrix is None:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return matrix
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 903, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":902
 *         """
 *         matrix = self.source.next_matrix()
 *         if matrix is None:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return matrix
 */
  }

  /* "pysdif/_pysdif.pyx":904
 *         if matrix is None:
 *             raise StopIteration
 *         return matrix             # <<<<<<<<<<<<<<
 * 
 *     def get_matrix(self, copy=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_matrix);
  __pyx_r = __pyx_v_matrix;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":889
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next matrix in this Frame. Raises StopIteration if no more matrices
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":906
 *         return matrix
 * 
 *     def get_matrix(self, copy=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reads the next matrix entirely, returns (matrixsig, data)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_13get_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameR_12get_matrix[] = "FrameR.get_matrix(self, copy=True)\n\n        Reads the next matrix entirely, returns (matrixsig, data)\n\n        !!! note\n\n            Raises `StopIteration` when there are no more matrices\n\n        Args:\n            copy: return a copy of the data. If copy==False, then the data\n                is only valid as long as no other matrix is read. This is \n                done to avoid allocating new memory for each new matrix\n                for the cases where the data is not preversed but transformed\n                within a streaming procees.\n        \n        Returns:\n            (tuple[str, numpy.array]) A tuple (string signature, matrix data)\n\n        ## Example\n\n        ```python\n\n        frame = next(sdiffile)\n        while True:\n            sig, data = frame.get_matrix()\n            print(data)\n\n        ```\n\n        This is the same as:\n\n        ```python\n        frame = next(sdiffile)\n        for matrix in frame:\n            print(matrix.get_data())\n        ```\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameR_13get_matrix = {"get_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_6FrameR_13get_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_6FrameR_12get_matrix};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_13get_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_copy = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copy);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_matrix") < 0)) __PYX_ERR(0, 906, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_copy = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_matrix", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 906, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.get_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_12get_matrix(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self), __pyx_v_copy);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_12get_matrix(struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self, PyObject *__pyx_v_copy) {
  PyObject *__pyx_v_matrix = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_matrix", 0);

  /* "pysdif/_pysdif.pyx":943
 *         ```
 *         """
 *         matrix = self.__next__()             # <<<<<<<<<<<<<<
 *         return matrix.signature, matrix.get_data(copy=copy)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_matrix = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":944
 *         """
 *         matrix = self.__next__()
 *         return matrix.signature, matrix.get_data(copy=copy)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_matrix, __pyx_n_s_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_matrix, __pyx_n_s_get_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, __pyx_v_copy) < 0) __PYX_ERR(0, 944, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":906
 *         return matrix
 * 
 *     def get_matrix(self, copy=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reads the next matrix entirely, returns (matrixsig, data)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.get_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameR_14__reduce_cython__[] = "FrameR.__reduce_cython__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameR_15__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameR_15__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6FrameR_14__reduce_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_14__reduce_cython__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __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)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameR_16__setstate_cython__[] = "FrameR.__setstate_cython__(self, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameR_17__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameR_17__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_6FrameR_16__setstate_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameR_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameR_16__setstate_cython__(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_FrameR *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __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)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":987
 *     cdef int _written
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "FrameW(signature=%s, time=%f, streamID=%d, written=%s)" % (
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameW___repr__(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW___repr__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pysdif/_pysdif.pyx":988
 * 
 *     def __repr__(self):
 *         return "FrameW(signature=%s, time=%f, streamID=%d, written=%s)" % (             # <<<<<<<<<<<<<<
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pysdif/_pysdif.pyx":989
 *     def __repr__(self):
 *         return "FrameW(signature=%s, time=%f, streamID=%d, written=%s)" % (
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_self->signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->streamID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->_written); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_5))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "pysdif/_pysdif.pyx":988
 * 
 *     def __repr__(self):
 *         return "FrameW(signature=%s, time=%f, streamID=%d, written=%s)" % (             # <<<<<<<<<<<<<<
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))
 * 
 */
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_FrameW_signature_s_time_f_stream, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":987
 *     cdef int _written
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "FrameW(signature=%s, time=%f, streamID=%d, written=%s)" % (
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":991
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameW_2__enter__[] = "FrameW.__enter__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameW_3__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameW_3__enter__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6FrameW_2__enter__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameW_2__enter__(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_2__enter__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pysdif/_pysdif.pyx":992
 * 
 *     def __enter__(self):
 *         if self._written:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Frame has already been written!")
 *         return self
 */
  __pyx_t_1 = (__pyx_v_self->_written != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":993
 *     def __enter__(self):
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 993, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":992
 * 
 *     def __enter__(self):
 *         if self._written:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Frame has already been written!")
 *         return self
 */
  }

  /* "pysdif/_pysdif.pyx":994
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exception_type, exception_value, traceback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":991
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":996
 *         return self
 * 
 *     def __exit__(self, exception_type, exception_value, traceback):             # <<<<<<<<<<<<<<
 *         if self.num_matrices == 0:
 *             raise RuntimeError("No matrices were added! Frame not written")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameW_4__exit__[] = "FrameW.__exit__(self, exception_type, exception_value, traceback)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameW_5__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_6FrameW_5__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_6FrameW_4__exit__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exception_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exception_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception_type,&__pyx_n_s_exception_value,&__pyx_n_s_traceback,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 996, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 996, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exception_type = values[0];
    __pyx_v_exception_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 996, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameW_4__exit__(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self), __pyx_v_exception_type, __pyx_v_exception_value, __pyx_v_traceback);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_4__exit__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exception_type, CYTHON_UNUSED PyObject *__pyx_v_exception_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pysdif/_pysdif.pyx":997
 * 
 *     def __exit__(self, exception_type, exception_value, traceback):
 *         if self.num_matrices == 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("No matrices were added! Frame not written")
 *         self.write()
 */
  __pyx_t_1 = ((__pyx_v_self->num_matrices == 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":998
 *     def __exit__(self, exception_type, exception_value, traceback):
 *         if self.num_matrices == 0:
 *             raise RuntimeError("No matrices were added! Frame not written")             # <<<<<<<<<<<<<<
 *         self.write()
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 998, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":997
 * 
 *     def __exit__(self, exception_type, exception_value, traceback):
 *         if self.num_matrices == 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("No matrices were added! Frame not written")
 *         self.write()
 */
  }

  /* "pysdif/_pysdif.pyx":999
 *         if self.num_matrices == 0:
 *             raise RuntimeError("No matrices were added! Frame not written")
 *         self.write()             # <<<<<<<<<<<<<<
 * 
 *     property written:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":996
 *         return self
 * 
 *     def __exit__(self, exception_type, exception_value, traceback):             # <<<<<<<<<<<<<<
 *         if self.num_matrices == 0:
 *             raise RuntimeError("No matrices were added! Frame not written")
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1002
 * 
 *     property written:
 *         def __get__(self): return bool(self._written)             # <<<<<<<<<<<<<<
 * 
 *     def add_matrix(self, str signature, c_numpy.ndarray data_array):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_7written_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_7written_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameW_7written___get__(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_7written___get__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_written); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.written.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1004
 *         def __get__(self): return bool(self._written)
 * 
 *     def add_matrix(self, str signature, c_numpy.ndarray data_array):             # <<<<<<<<<<<<<<
 *         """
 *         Add a matrix to this Frame
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_7add_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameW_6add_matrix[] = "FrameW.add_matrix(self, str signature, ndarray data_array)\n\n        Add a matrix to this Frame\n\n        Args:\n            signature (str): the signature of the matrix\n            data_array (numpy.array): the data of the matrix, a 2D array\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameW_7add_matrix = {"add_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_6FrameW_7add_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_6FrameW_6add_matrix};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_7add_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyArrayObject *__pyx_v_data_array = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signature,&__pyx_n_s_data_array,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signature)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data_array)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_matrix", 1, 2, 2, 1); __PYX_ERR(0, 1004, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_matrix") < 0)) __PYX_ERR(0, 1004, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_signature = ((PyObject*)values[0]);
    __pyx_v_data_array = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_matrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1004, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.add_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signature), (&PyString_Type), 1, "signature", 1))) __PYX_ERR(0, 1004, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data_array), __pyx_ptype_5numpy_ndarray, 1, "data_array", 0))) __PYX_ERR(0, 1004, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameW_6add_matrix(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self), __pyx_v_signature, __pyx_v_data_array);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_6add_matrix(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self, PyObject *__pyx_v_signature, PyArrayObject *__pyx_v_data_array) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_matrix", 0);

  /* "pysdif/_pysdif.pyx":1012
 *             data_array (numpy.array): the data of the matrix, a 2D array
 *         """
 *         if self._written:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Frame has already been written!")
 *         if data_array.ndim == 1:
 */
  __pyx_t_1 = (__pyx_v_self->_written != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1013
 *         """
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")             # <<<<<<<<<<<<<<
 *         if data_array.ndim == 1:
 *             data_array.resize((data_array.shape[0], 1))
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1013, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1012
 *             data_array (numpy.array): the data of the matrix, a 2D array
 *         """
 *         if self._written:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Frame has already been written!")
 *         if data_array.ndim == 1:
 */
  }

  /* "pysdif/_pysdif.pyx":1014
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")
 *         if data_array.ndim == 1:             # <<<<<<<<<<<<<<
 *             data_array.resize((data_array.shape[0], 1))
 *         self.signatures.append(asbytes(signature))
 */
  __pyx_t_1 = ((__pyx_v_data_array->nd == 1) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1015
 *             raise RuntimeError("Frame has already been written!")
 *         if data_array.ndim == 1:
 *             data_array.resize((data_array.shape[0], 1))             # <<<<<<<<<<<<<<
 *         self.signatures.append(asbytes(signature))
 *         self.matrices.append(np.ascontiguousarray(data_array))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data_array), __pyx_n_s_resize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_data_array->dimensions[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_1);
    __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1014
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")
 *         if data_array.ndim == 1:             # <<<<<<<<<<<<<<
 *             data_array.resize((data_array.shape[0], 1))
 *         self.signatures.append(asbytes(signature))
 */
  }

  /* "pysdif/_pysdif.pyx":1016
 *         if data_array.ndim == 1:
 *             data_array.resize((data_array.shape[0], 1))
 *         self.signatures.append(asbytes(signature))             # <<<<<<<<<<<<<<
 *         self.matrices.append(np.ascontiguousarray(data_array))
 *         self.num_matrices += 1
 */
  if (unlikely(__pyx_v_self->signatures == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 1016, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->signatures, __pyx_t_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":1017
 *             data_array.resize((data_array.shape[0], 1))
 *         self.signatures.append(asbytes(signature))
 *         self.matrices.append(np.ascontiguousarray(data_array))             # <<<<<<<<<<<<<<
 *         self.num_matrices += 1
 *         self.frame_size += SdifSizeOfMatrix(
 */
  if (unlikely(__pyx_v_self->matrices == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 1017, __pyx_L1_error)
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_data_array)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_data_array));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->matrices, __pyx_t_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":1018
 *         self.signatures.append(asbytes(signature))
 *         self.matrices.append(np.ascontiguousarray(data_array))
 *         self.num_matrices += 1             # <<<<<<<<<<<<<<
 *         self.frame_size += SdifSizeOfMatrix(
 *             <SdifDataTypeET>(dtype_numpy2sdif(data_array.descr.type_num)),
 */
  __pyx_v_self->num_matrices = (__pyx_v_self->num_matrices + 1);

  /* "pysdif/_pysdif.pyx":1019
 *         self.matrices.append(np.ascontiguousarray(data_array))
 *         self.num_matrices += 1
 *         self.frame_size += SdifSizeOfMatrix(             # <<<<<<<<<<<<<<
 *             <SdifDataTypeET>(dtype_numpy2sdif(data_array.descr.type_num)),
 *             data_array.shape[0], data_array.shape[1]) # rows, cols
 */
  __pyx_v_self->frame_size = (__pyx_v_self->frame_size + SdifSizeOfMatrix(((SdifDataTypeET)__pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(__pyx_v_data_array->descr->type_num)), (__pyx_v_data_array->dimensions[0]), (__pyx_v_data_array->dimensions[1])));

  /* "pysdif/_pysdif.pyx":1004
 *         def __get__(self): return bool(self._written)
 * 
 *     def add_matrix(self, str signature, c_numpy.ndarray data_array):             # <<<<<<<<<<<<<<
 *         """
 *         Add a matrix to this Frame
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.add_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1023
 *             data_array.shape[0], data_array.shape[1]) # rows, cols
 * 
 *     def write(self):             # <<<<<<<<<<<<<<
 *         """
 *         Write the current frame to disk.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_9write(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameW_8write[] = "FrameW.write(self)\n\n        Write the current frame to disk. \n\n        This function is called after add_matrix has been called (if there \n        are any matrices in the current frame). The frame is written all at once. \n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameW_9write = {"write", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameW_9write, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6FrameW_8write};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_9write(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameW_8write(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_8write(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self) {
  SdifUInt4 __pyx_v_fsz;
  SdifSignature __pyx_v_matrix_sig;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_v_matrix = 0;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  SdifUInt4 __pyx_t_3;
  SdifUInt4 __pyx_t_4;
  int __pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pysdif/_pysdif.pyx":1030
 *         are any matrices in the current frame). The frame is written all at once.
 *         """
 *         if self._written:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Frame has already been written!")
 *         cdef SdifUInt4 fsz
 */
  __pyx_t_1 = (__pyx_v_self->_written != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1031
 *         """
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")             # <<<<<<<<<<<<<<
 *         cdef SdifUInt4 fsz
 *         cdef SdifSignature matrix_sig
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1031, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1030
 *         are any matrices in the current frame). The frame is written all at once.
 *         """
 *         if self._written:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Frame has already been written!")
 *         cdef SdifUInt4 fsz
 */
  }

  /* "pysdif/_pysdif.pyx":1037
 *         cdef c_numpy.ndarray matrix
 *         cdef int i
 *         SdifFSetCurrFrameHeader(self.sdiffile.this, self.signature, self.frame_size,             # <<<<<<<<<<<<<<
 *                                 self.num_matrices, self.streamID, self.time)
 *         fsz = SdifFWriteFrameHeader(self.sdiffile.this)
 */
  (void)(SdifFSetCurrFrameHeader(__pyx_v_self->sdiffile->this, __pyx_v_self->signature, __pyx_v_self->frame_size, __pyx_v_self->num_matrices, __pyx_v_self->streamID, __pyx_v_self->time));

  /* "pysdif/_pysdif.pyx":1039
 *         SdifFSetCurrFrameHeader(self.sdiffile.this, self.signature, self.frame_size,
 *                                 self.num_matrices, self.streamID, self.time)
 *         fsz = SdifFWriteFrameHeader(self.sdiffile.this)             # <<<<<<<<<<<<<<
 *         for i in range(self.num_matrices):
 *             matrix_sig = str2sig(self.signatures[i])
 */
  __pyx_v_fsz = SdifFWriteFrameHeader(__pyx_v_self->sdiffile->this);

  /* "pysdif/_pysdif.pyx":1040
 *                                 self.num_matrices, self.streamID, self.time)
 *         fsz = SdifFWriteFrameHeader(self.sdiffile.this)
 *         for i in range(self.num_matrices):             # <<<<<<<<<<<<<<
 *             matrix_sig = str2sig(self.signatures[i])
 *             matrix = self.matrices[i]
 */
  __pyx_t_3 = __pyx_v_self->num_matrices;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pysdif/_pysdif.pyx":1041
 *         fsz = SdifFWriteFrameHeader(self.sdiffile.this)
 *         for i in range(self.num_matrices):
 *             matrix_sig = str2sig(self.signatures[i])             # <<<<<<<<<<<<<<
 *             matrix = self.matrices[i]
 *             dtype = dtype_numpy2sdif(matrix.descr.type_num)
 */
    if (unlikely(__pyx_v_self->signatures == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1041, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->signatures, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L1_error)
    __pyx_v_matrix_sig = __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1042
 *         for i in range(self.num_matrices):
 *             matrix_sig = str2sig(self.signatures[i])
 *             matrix = self.matrices[i]             # <<<<<<<<<<<<<<
 *             dtype = dtype_numpy2sdif(matrix.descr.type_num)
 *             fsz += SdifFWriteMatrix(self.sdiffile.this, matrix_sig,
 */
    if (unlikely(__pyx_v_self->matrices == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1042, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->matrices, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1042, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_matrix, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1043
 *             matrix_sig = str2sig(self.signatures[i])
 *             matrix = self.matrices[i]
 *             dtype = dtype_numpy2sdif(matrix.descr.type_num)             # <<<<<<<<<<<<<<
 *             fsz += SdifFWriteMatrix(self.sdiffile.this, matrix_sig,
 *                                     <SdifDataTypeET>dtype,
 */
    __pyx_v_dtype = __pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(__pyx_v_matrix->descr->type_num);

    /* "pysdif/_pysdif.pyx":1044
 *             matrix = self.matrices[i]
 *             dtype = dtype_numpy2sdif(matrix.descr.type_num)
 *             fsz += SdifFWriteMatrix(self.sdiffile.this, matrix_sig,             # <<<<<<<<<<<<<<
 *                                     <SdifDataTypeET>dtype,
 *                                     matrix.shape[0], matrix.shape[1],   # rows, cols
 */
    __pyx_v_fsz = (__pyx_v_fsz + SdifFWriteMatrix(__pyx_v_self->sdiffile->this, __pyx_v_matrix_sig, ((SdifDataTypeET)__pyx_v_dtype), (__pyx_v_matrix->dimensions[0]), (__pyx_v_matrix->dimensions[1]), __pyx_v_matrix->data));
  }

  /* "pysdif/_pysdif.pyx":1048
 *                                     matrix.shape[0], matrix.shape[1],   # rows, cols
 *                                     matrix.data)
 *         self._written = 1             # <<<<<<<<<<<<<<
 *         self.sdiffile.write_status = eSdifMatrixData
 * 
 */
  __pyx_v_self->_written = 1;

  /* "pysdif/_pysdif.pyx":1049
 *                                     matrix.data)
 *         self._written = 1
 *         self.sdiffile.write_status = eSdifMatrixData             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->sdiffile->write_status = __pyx_e_6pysdif_7_pysdif_eSdifMatrixData;

  /* "pysdif/_pysdif.pyx":1023
 *             data_array.shape[0], data_array.shape[1]) # rows, cols
 * 
 *     def write(self):             # <<<<<<<<<<<<<<
 *         """
 *         Write the current frame to disk.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameW_10__reduce_cython__[] = "FrameW.__reduce_cython__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameW_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameW_11__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6FrameW_10__reduce_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameW_10__reduce_cython__(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_10__reduce_cython__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._written, self.frame_size, self.matrices, self.num_matrices, self.sdiffile, self.signature, self.signatures, self.streamID, self.time)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_written); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->frame_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->num_matrices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->streamID); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->time); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->matrices);
  __Pyx_GIVEREF(__pyx_v_self->matrices);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_self->matrices);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->sdiffile));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->sdiffile));
  PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_v_self->sdiffile));
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->signatures);
  __Pyx_GIVEREF(__pyx_v_self->signatures);
  PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_v_self->signatures);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._written, self.frame_size, self.matrices, self.num_matrices, self.sdiffile, self.signature, self.signatures, self.streamID, self.time)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v__dict = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "(tree fragment)":7
 *     state = (self._written, self.frame_size, self.matrices, self.num_matrices, self.sdiffile, self.signature, self.signatures, self.streamID, self.time)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_8 = (__pyx_v__dict != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.matrices is not None or self.sdiffile is not None or self.signatures is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._written, self.frame_size, self.matrices, self.num_matrices, self.sdiffile, self.signature, self.signatures, self.streamID, self.time)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.matrices is not None or self.sdiffile is not None or self.signatures is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, None), state
 */
  /*else*/ {
    __pyx_t_8 = (__pyx_v_self->matrices != ((PyObject*)Py_None));
    __pyx_t_10 = (__pyx_t_8 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_9 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (((PyObject *)__pyx_v_self->sdiffile) != Py_None);
    __pyx_t_8 = (__pyx_t_10 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_9 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->signatures != ((PyObject*)Py_None));
    __pyx_t_10 = (__pyx_t_8 != 0);
    __pyx_t_9 = __pyx_t_10;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_9;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.matrices is not None or self.sdiffile is not None or self.signatures is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, None), state
 *     else:
 */
  __pyx_t_9 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_9) {

    /* "(tree fragment)":13
 *         use_setstate = self.matrices is not None or self.sdiffile is not None or self.signatures is not None
 *     if use_setstate:
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_FrameW); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_13398827);
    __Pyx_GIVEREF(__pyx_int_13398827);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_13398827);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.matrices is not None or self.sdiffile is not None or self.signatures is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, None), state
 *     else:
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FrameW__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_FrameW); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_13398827);
    __Pyx_GIVEREF(__pyx_int_13398827);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_13398827);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FrameW__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameW_12__setstate_cython__[] = "FrameW.__setstate_cython__(self, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_6FrameW_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameW_13__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_6FrameW_12__setstate_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_6FrameW_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_6FrameW_12__setstate_cython__(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_12__setstate_cython__(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FrameW__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif___pyx_unpickle_FrameW__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FrameW__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1052
 * 
 * 
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig,             # <<<<<<<<<<<<<<
 *                        SdifFloat8 time, SdifUInt4 streamID=0):
 *     cdef FrameW f = FrameW()
 */

static struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_f_6pysdif_7_pysdif_FrameW_new(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_sdiffile, SdifSignature __pyx_v_sig, SdifFloat8 __pyx_v_time, struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new *__pyx_optional_args) {
  SdifUInt4 __pyx_v_streamID = ((SdifUInt4)0);
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_f = 0;
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("FrameW_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_streamID = __pyx_optional_args->streamID;
    }
  }

  /* "pysdif/_pysdif.pyx":1054
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig,
 *                        SdifFloat8 time, SdifUInt4 streamID=0):
 *     cdef FrameW f = FrameW()             # <<<<<<<<<<<<<<
 *     f.sdiffile = sdiffile
 *     f.signature = sig
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameW)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_f = ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1055
 *                        SdifFloat8 time, SdifUInt4 streamID=0):
 *     cdef FrameW f = FrameW()
 *     f.sdiffile = sdiffile             # <<<<<<<<<<<<<<
 *     f.signature = sig
 *     f.time = time
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_sdiffile));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_sdiffile));
  __Pyx_GOTREF(__pyx_v_f->sdiffile);
  __Pyx_DECREF(((PyObject *)__pyx_v_f->sdiffile));
  __pyx_v_f->sdiffile = __pyx_v_sdiffile;

  /* "pysdif/_pysdif.pyx":1056
 *     cdef FrameW f = FrameW()
 *     f.sdiffile = sdiffile
 *     f.signature = sig             # <<<<<<<<<<<<<<
 *     f.time = time
 *     f.streamID = streamID
 */
  __pyx_v_f->signature = __pyx_v_sig;

  /* "pysdif/_pysdif.pyx":1057
 *     f.sdiffile = sdiffile
 *     f.signature = sig
 *     f.time = time             # <<<<<<<<<<<<<<
 *     f.streamID = streamID
 *     f.matrices = []
 */
  __pyx_v_f->time = __pyx_v_time;

  /* "pysdif/_pysdif.pyx":1058
 *     f.signature = sig
 *     f.time = time
 *     f.streamID = streamID             # <<<<<<<<<<<<<<
 *     f.matrices = []
 *     f.signatures = []
 */
  __pyx_v_f->streamID = __pyx_v_streamID;

  /* "pysdif/_pysdif.pyx":1059
 *     f.time = time
 *     f.streamID = streamID
 *     f.matrices = []             # <<<<<<<<<<<<<<
 *     f.signatures = []
 *     f.frame_size = SdifSizeOfFrameHeader()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_f->matrices);
  __Pyx_DECREF(__pyx_v_f->matrices);
  __pyx_v_f->matrices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1060
 *     f.streamID = streamID
 *     f.matrices = []
 *     f.signatures = []             # <<<<<<<<<<<<<<
 *     f.frame_size = SdifSizeOfFrameHeader()
 *     f.num_matrices = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_f->signatures);
  __Pyx_DECREF(__pyx_v_f->signatures);
  __pyx_v_f->signatures = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1061
 *     f.matrices = []
 *     f.signatures = []
 *     f.frame_size = SdifSizeOfFrameHeader()             # <<<<<<<<<<<<<<
 *     f.num_matrices = 0
 *     f._written = 0
 */
  __pyx_v_f->frame_size = SdifSizeOfFrameHeader();

  /* "pysdif/_pysdif.pyx":1062
 *     f.signatures = []
 *     f.frame_size = SdifSizeOfFrameHeader()
 *     f.num_matrices = 0             # <<<<<<<<<<<<<<
 *     f._written = 0
 *     return f
 */
  __pyx_v_f->num_matrices = 0;

  /* "pysdif/_pysdif.pyx":1063
 *     f.frame_size = SdifSizeOfFrameHeader()
 *     f.num_matrices = 0
 *     f._written = 0             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
  __pyx_v_f->_written = 0;

  /* "pysdif/_pysdif.pyx":1064
 *     f.num_matrices = 0
 *     f._written = 0
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_f));
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1052
 * 
 * 
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig,             # <<<<<<<<<<<<<<
 *                        SdifFloat8 time, SdifUInt4 streamID=0):
 *     cdef FrameW f = FrameW()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_f);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1144
 *     cdef set _matrixtypes_defined  # a set of byte signatures
 * 
 *     def __cinit__(self, filename, mode="r", predefined_type=None):             # <<<<<<<<<<<<<<
 *         sdif_init()
 *         self.this = NULL
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_8SdifFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_8SdifFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_mode = 0;
  CYTHON_UNUSED PyObject *__pyx_v_predefined_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_mode,&__pyx_n_s_predefined_type,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_s_r);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_predefined_type);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1144, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_predefined_type = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1144, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile___cinit__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_mode, __pyx_v_predefined_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_8SdifFile___cinit__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, CYTHON_UNUSED PyObject *__pyx_v_predefined_type) {
  PyObject *__pyx_v_errormsg = NULL;
  PyObject *__pyx_v_path = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  const char* __pyx_t_8;
  SdifFileModeET __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_filename);

  /* "pysdif/_pysdif.pyx":1145
 * 
 *     def __cinit__(self, filename, mode="r", predefined_type=None):
 *         sdif_init()             # <<<<<<<<<<<<<<
 *         self.this = NULL
 *         errormsg = None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sdif_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1146
 *     def __cinit__(self, filename, mode="r", predefined_type=None):
 *         sdif_init()
 *         self.this = NULL             # <<<<<<<<<<<<<<
 *         errormsg = None
 *         filename = asbytes(filename)
 */
  __pyx_v_self->this = NULL;

  /* "pysdif/_pysdif.pyx":1147
 *         sdif_init()
 *         self.this = NULL
 *         errormsg = None             # <<<<<<<<<<<<<<
 *         filename = asbytes(filename)
 *         if mode == "r" or mode == "rw":
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_errormsg = Py_None;

  /* "pysdif/_pysdif.pyx":1148
 *         self.this = NULL
 *         errormsg = None
 *         filename = asbytes(filename)             # <<<<<<<<<<<<<<
 *         if mode == "r" or mode == "rw":
 *             if not os.path.exists(filename):
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1149
 *         errormsg = None
 *         filename = asbytes(filename)
 *         if mode == "r" or mode == "rw":             # <<<<<<<<<<<<<<
 *             if not os.path.exists(filename):
 *                 errormsg = "path not found, cannot open sdif file for reading"
 */
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1149, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_rw, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1149, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pysdif/_pysdif.pyx":1150
 *         filename = asbytes(filename)
 *         if mode == "r" or mode == "rw":
 *             if not os.path.exists(filename):             # <<<<<<<<<<<<<<
 *                 errormsg = "path not found, cannot open sdif file for reading"
 *         elif mode == "w":
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = ((!__pyx_t_4) != 0);
    if (__pyx_t_5) {

      /* "pysdif/_pysdif.pyx":1151
 *         if mode == "r" or mode == "rw":
 *             if not os.path.exists(filename):
 *                 errormsg = "path not found, cannot open sdif file for reading"             # <<<<<<<<<<<<<<
 *         elif mode == "w":
 *             path = os.path.split(os.path.abspath(filename))[0]
 */
      __Pyx_INCREF(__pyx_kp_s_path_not_found_cannot_open_sdif);
      __Pyx_DECREF_SET(__pyx_v_errormsg, __pyx_kp_s_path_not_found_cannot_open_sdif);

      /* "pysdif/_pysdif.pyx":1150
 *         filename = asbytes(filename)
 *         if mode == "r" or mode == "rw":
 *             if not os.path.exists(filename):             # <<<<<<<<<<<<<<
 *                 errormsg = "path not found, cannot open sdif file for reading"
 *         elif mode == "w":
 */
    }

    /* "pysdif/_pysdif.pyx":1149
 *         errormsg = None
 *         filename = asbytes(filename)
 *         if mode == "r" or mode == "rw":             # <<<<<<<<<<<<<<
 *             if not os.path.exists(filename):
 *                 errormsg = "path not found, cannot open sdif file for reading"
 */
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":1152
 *             if not os.path.exists(filename):
 *                 errormsg = "path not found, cannot open sdif file for reading"
 *         elif mode == "w":             # <<<<<<<<<<<<<<
 *             path = os.path.split(os.path.abspath(filename))[0]
 *             if not os.path.exists(path):
 */
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1152, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "pysdif/_pysdif.pyx":1153
 *                 errormsg = "path not found, cannot open sdif file for reading"
 *         elif mode == "w":
 *             path = os.path.split(os.path.abspath(filename))[0]             # <<<<<<<<<<<<<<
 *             if not os.path.exists(path):
 *                 errormsg = "Path %s does not exist, can't create a file" % path
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_abspath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_path = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1154
 *         elif mode == "w":
 *             path = os.path.split(os.path.abspath(filename))[0]
 *             if not os.path.exists(path):             # <<<<<<<<<<<<<<
 *                 errormsg = "Path %s does not exist, can't create a file" % path
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_path);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = ((!__pyx_t_5) != 0);
    if (__pyx_t_4) {

      /* "pysdif/_pysdif.pyx":1155
 *             path = os.path.split(os.path.abspath(filename))[0]
 *             if not os.path.exists(path):
 *                 errormsg = "Path %s does not exist, can't create a file" % path             # <<<<<<<<<<<<<<
 *         else:
 *             errormsg = "mode should be on of 'r', 'w', 'rw'"
 */
      __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Path_s_does_not_exist_can_t_crea, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_errormsg, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pysdif/_pysdif.pyx":1154
 *         elif mode == "w":
 *             path = os.path.split(os.path.abspath(filename))[0]
 *             if not os.path.exists(path):             # <<<<<<<<<<<<<<
 *                 errormsg = "Path %s does not exist, can't create a file" % path
 *         else:
 */
    }

    /* "pysdif/_pysdif.pyx":1152
 *             if not os.path.exists(filename):
 *                 errormsg = "path not found, cannot open sdif file for reading"
 *         elif mode == "w":             # <<<<<<<<<<<<<<
 *             path = os.path.split(os.path.abspath(filename))[0]
 *             if not os.path.exists(path):
 */
    goto __pyx_L3;
  }

  /* "pysdif/_pysdif.pyx":1157
 *                 errormsg = "Path %s does not exist, can't create a file" % path
 *         else:
 *             errormsg = "mode should be on of 'r', 'w', 'rw'"             # <<<<<<<<<<<<<<
 * 
 *         if errormsg is not None:
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_s_mode_should_be_on_of_r_w_rw);
    __Pyx_DECREF_SET(__pyx_v_errormsg, __pyx_kp_s_mode_should_be_on_of_r_w_rw);
  }
  __pyx_L3:;

  /* "pysdif/_pysdif.pyx":1159
 *             errormsg = "mode should be on of 'r', 'w', 'rw'"
 * 
 *         if errormsg is not None:             # <<<<<<<<<<<<<<
 *             self.eof = SDIF_CLOSED
 *             print(errormsg)
 */
  __pyx_t_4 = (__pyx_v_errormsg != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pysdif/_pysdif.pyx":1160
 * 
 *         if errormsg is not None:
 *             self.eof = SDIF_CLOSED             # <<<<<<<<<<<<<<
 *             print(errormsg)
 *             logger.error(errormsg)
 */
    __pyx_v_self->eof = __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED;

    /* "pysdif/_pysdif.pyx":1161
 *         if errormsg is not None:
 *             self.eof = SDIF_CLOSED
 *             print(errormsg)             # <<<<<<<<<<<<<<
 *             logger.error(errormsg)
 *         else:
 */
    if (__Pyx_PrintOne(0, __pyx_v_errormsg) < 0) __PYX_ERR(0, 1161, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1162
 *             self.eof = SDIF_CLOSED
 *             print(errormsg)
 *             logger.error(errormsg)             # <<<<<<<<<<<<<<
 *         else:
 *             self.this = SdifFOpen(asbytes(filename), FILEMODE_STR2MODE[mode])
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_errormsg) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_errormsg);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1159
 *             errormsg = "mode should be on of 'r', 'w', 'rw'"
 * 
 *         if errormsg is not None:             # <<<<<<<<<<<<<<
 *             self.eof = SDIF_CLOSED
 *             print(errormsg)
 */
    goto __pyx_L8;
  }

  /* "pysdif/_pysdif.pyx":1164
 *             logger.error(errormsg)
 *         else:
 *             self.this = SdifFOpen(asbytes(filename), FILEMODE_STR2MODE[mode])             # <<<<<<<<<<<<<<
 *             self.eof = 0
 *             self.matrix_idx = 0
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_t_2 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
      __PYX_ERR(0, 1164, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_t_2); if (unlikely((__pyx_t_8 == ((const char*)NULL)) && PyErr_Occurred())) __PYX_ERR(0, 1164, __pyx_L1_error)
    if (unlikely(__pyx_v_6pysdif_7_pysdif_FILEMODE_STR2MODE == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1164, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_6pysdif_7_pysdif_FILEMODE_STR2MODE, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = ((enum SdifFileModeE)__Pyx_PyInt_As_enum__SdifFileModeE(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_self->this = SdifFOpen(__pyx_t_8, __pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1165
 *         else:
 *             self.this = SdifFOpen(asbytes(filename), FILEMODE_STR2MODE[mode])
 *             self.eof = 0             # <<<<<<<<<<<<<<
 *             self.matrix_idx = 0
 * 
 */
    __pyx_v_self->eof = 0;

    /* "pysdif/_pysdif.pyx":1166
 *             self.this = SdifFOpen(asbytes(filename), FILEMODE_STR2MODE[mode])
 *             self.eof = 0
 *             self.matrix_idx = 0             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, str filename, mode="r"):
 */
    __pyx_v_self->matrix_idx = 0;
  }
  __pyx_L8:;

  /* "pysdif/_pysdif.pyx":1144
 *     cdef set _matrixtypes_defined  # a set of byte signatures
 * 
 *     def __cinit__(self, filename, mode="r", predefined_type=None):             # <<<<<<<<<<<<<<
 *         sdif_init()
 *         self.this = NULL
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_errormsg);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1168
 *             self.matrix_idx = 0
 * 
 *     def __init__(self, str filename, mode="r"):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_8SdifFile_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_2__init__[] = "\n        Args:\n            filename (str): the sdif file to open\n            mode (str): r=read, w=write\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_6pysdif_7_pysdif_8SdifFile_2__init__;
#endif
static int __pyx_pw_6pysdif_7_pysdif_8SdifFile_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  CYTHON_UNUSED PyObject *__pyx_v_mode = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_s_r);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1168, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = ((PyObject*)values[0]);
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1168, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filename), (&PyString_Type), 1, "filename", 1))) __PYX_ERR(0, 1168, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_2__init__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_mode);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_8SdifFile_2__init__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_filename, CYTHON_UNUSED PyObject *__pyx_v_mode) {
  PyObject *__pyx_v_sigs = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_ftd = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pysdif/_pysdif.pyx":1174
 *             mode (str): r=read, w=write
 *         """
 *         if self.eof == SDIF_CLOSED or self.this == NULL:             # <<<<<<<<<<<<<<
 *             logger.debug("error opening file")
 *             raise IOError("Could not open %s" % filename)
 */
  __pyx_t_2 = ((__pyx_v_self->eof == __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_self->this == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1175
 *         """
 *         if self.eof == SDIF_CLOSED or self.this == NULL:
 *             logger.debug("error opening file")             # <<<<<<<<<<<<<<
 *             raise IOError("Could not open %s" % filename)
 *         logger.debug("SdifFile.__init__")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_debug); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_kp_s_error_opening_file) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_error_opening_file);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":1176
 *         if self.eof == SDIF_CLOSED or self.this == NULL:
 *             logger.debug("error opening file")
 *             raise IOError("Could not open %s" % filename)             # <<<<<<<<<<<<<<
 *         logger.debug("SdifFile.__init__")
 *         if self.this.Mode == eReadFile:
 */
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Could_not_open_s, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1176, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1174
 *             mode (str): r=read, w=write
 *         """
 *         if self.eof == SDIF_CLOSED or self.this == NULL:             # <<<<<<<<<<<<<<
 *             logger.debug("error opening file")
 *             raise IOError("Could not open %s" % filename)
 */
  }

  /* "pysdif/_pysdif.pyx":1177
 *             logger.debug("error opening file")
 *             raise IOError("Could not open %s" % filename)
 *         logger.debug("SdifFile.__init__")             # <<<<<<<<<<<<<<
 *         if self.this.Mode == eReadFile:
 *             self.init_read()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s_SdifFile___init) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_SdifFile___init);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pysdif/_pysdif.pyx":1178
 *             raise IOError("Could not open %s" % filename)
 *         logger.debug("SdifFile.__init__")
 *         if self.this.Mode == eReadFile:             # <<<<<<<<<<<<<<
 *             self.init_read()
 *             sigs = {ftd.signature for ftd in self.get_frame_types()}
 */
  switch (__pyx_v_self->this->Mode) {
    case eReadFile:

    /* "pysdif/_pysdif.pyx":1179
 *         logger.debug("SdifFile.__init__")
 *         if self.this.Mode == eReadFile:
 *             self.init_read()             # <<<<<<<<<<<<<<
 *             sigs = {ftd.signature for ftd in self.get_frame_types()}
 *             if self.signature not in sigs:
 */
    ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->init_read(__pyx_v_self);

    /* "pysdif/_pysdif.pyx":1180
 *         if self.this.Mode == eReadFile:
 *             self.init_read()
 *             sigs = {ftd.signature for ftd in self.get_frame_types()}             # <<<<<<<<<<<<<<
 *             if self.signature not in sigs:
 *                 if self.signature in predefined_frametypes():
 */
    { /* enter inner scope */
      __pyx_t_5 = PySet_New(NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1180, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_frame_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L8_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1180, __pyx_L8_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1180, __pyx_L8_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_3);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1180, __pyx_L8_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_ftd, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr4__pyx_v_ftd, __pyx_n_s_signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(PySet_Add(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1180, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_ftd); __pyx_8genexpr4__pyx_v_ftd = 0;
      goto __pyx_L11_exit_scope;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_ftd); __pyx_8genexpr4__pyx_v_ftd = 0;
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */
    __pyx_v_sigs = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pysdif/_pysdif.pyx":1181
 *             self.init_read()
 *             sigs = {ftd.signature for ftd in self.get_frame_types()}
 *             if self.signature not in sigs:             # <<<<<<<<<<<<<<
 *                 if self.signature in predefined_frametypes():
 *                     self.add_predefined_frametype(self.signature)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_signature); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_sigs, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1181, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pysdif/_pysdif.pyx":1182
 *             sigs = {ftd.signature for ftd in self.get_frame_types()}
 *             if self.signature not in sigs:
 *                 if self.signature in predefined_frametypes():             # <<<<<<<<<<<<<<
 *                     self.add_predefined_frametype(self.signature)
 *                 else:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_signature); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_predefined_frametypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "pysdif/_pysdif.pyx":1183
 *             if self.signature not in sigs:
 *                 if self.signature in predefined_frametypes():
 *                     self.add_predefined_frametype(self.signature)             # <<<<<<<<<<<<<<
 *                 else:
 *                     logger.error("Undefined frametype: {sig}.\n"
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_predefined_frametype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "pysdif/_pysdif.pyx":1182
 *             sigs = {ftd.signature for ftd in self.get_frame_types()}
 *             if self.signature not in sigs:
 *                 if self.signature in predefined_frametypes():             # <<<<<<<<<<<<<<
 *                     self.add_predefined_frametype(self.signature)
 *                 else:
 */
        goto __pyx_L13;
      }

      /* "pysdif/_pysdif.pyx":1185
 *                     self.add_predefined_frametype(self.signature)
 *                 else:
 *                     logger.error("Undefined frametype: {sig}.\n"             # <<<<<<<<<<<<<<
 *                                  "You must add the frametype definition and the"
 *                                  "corresponding matrix definitions before reading"
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "pysdif/_pysdif.pyx":1188
 *                                  "You must add the frametype definition and the"
 *                                  "corresponding matrix definitions before reading"
 *                                  "".format(sig=self.signature))             # <<<<<<<<<<<<<<
 *         elif self.this.Mode == eWriteFile:
 *             self.init_write()
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Undefined_frametype_sig_You_must, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_signature); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_sig, __pyx_t_9) < 0) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_L13:;

      /* "pysdif/_pysdif.pyx":1181
 *             self.init_read()
 *             sigs = {ftd.signature for ftd in self.get_frame_types()}
 *             if self.signature not in sigs:             # <<<<<<<<<<<<<<
 *                 if self.signature in predefined_frametypes():
 *                     self.add_predefined_frametype(self.signature)
 */
    }

    /* "pysdif/_pysdif.pyx":1178
 *             raise IOError("Could not open %s" % filename)
 *         logger.debug("SdifFile.__init__")
 *         if self.this.Mode == eReadFile:             # <<<<<<<<<<<<<<
 *             self.init_read()
 *             sigs = {ftd.signature for ftd in self.get_frame_types()}
 */
    break;
    case eWriteFile:

    /* "pysdif/_pysdif.pyx":1190
 *                                  "".format(sig=self.signature))
 *         elif self.this.Mode == eWriteFile:
 *             self.init_write()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->init_write(__pyx_v_self);

    /* "pysdif/_pysdif.pyx":1189
 *                                  "corresponding matrix definitions before reading"
 *                                  "".format(sig=self.signature))
 *         elif self.this.Mode == eWriteFile:             # <<<<<<<<<<<<<<
 *             self.init_write()
 * 
 */
    break;
    default: break;
  }

  /* "pysdif/_pysdif.pyx":1168
 *             self.matrix_idx = 0
 * 
 *     def __init__(self, str filename, mode="r"):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sigs);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_ftd);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1192
 *             self.init_write()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.this == NULL:
 *             return "SdifFile(NULL)"
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_4__repr__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4__repr__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pysdif/_pysdif.pyx":1193
 * 
 *     def __repr__(self):
 *         if self.this == NULL:             # <<<<<<<<<<<<<<
 *             return "SdifFile(NULL)"
 *         l = []
 */
  __pyx_t_1 = ((__pyx_v_self->this == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1194
 *     def __repr__(self):
 *         if self.this == NULL:
 *             return "SdifFile(NULL)"             # <<<<<<<<<<<<<<
 *         l = []
 *         l.append("SdifFile(name={name}, mode={mode})".format(name=self.name, mode=self.mode))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_s_SdifFile_NULL);
    __pyx_r = __pyx_kp_s_SdifFile_NULL;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1193
 * 
 *     def __repr__(self):
 *         if self.this == NULL:             # <<<<<<<<<<<<<<
 *             return "SdifFile(NULL)"
 *         l = []
 */
  }

  /* "pysdif/_pysdif.pyx":1195
 *         if self.this == NULL:
 *             return "SdifFile(NULL)"
 *         l = []             # <<<<<<<<<<<<<<
 *         l.append("SdifFile(name={name}, mode={mode})".format(name=self.name, mode=self.mode))
 *         if self.mode == 'r' or self.mode == 'rw':
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_l = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":1196
 *             return "SdifFile(NULL)"
 *         l = []
 *         l.append("SdifFile(name={name}, mode={mode})".format(name=self.name, mode=self.mode))             # <<<<<<<<<<<<<<
 *         if self.mode == 'r' or self.mode == 'rw':
 *             l.append("Status: Frame: {frame}  | MatrixIdx: {midx} | Matrix: {matrix}".format(
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_SdifFile_name_name_mode_mode, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_t_4) < 0) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mode, __pyx_t_4) < 0) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_l, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pysdif/_pysdif.pyx":1197
 *         l = []
 *         l.append("SdifFile(name={name}, mode={mode})".format(name=self.name, mode=self.mode))
 *         if self.mode == 'r' or self.mode == 'rw':             # <<<<<<<<<<<<<<
 *             l.append("Status: Frame: {frame}  | MatrixIdx: {midx} | Matrix: {matrix}".format(
 *                 frame=framestatus2str(self.frame_status),
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_rw, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1198
 *         l.append("SdifFile(name={name}, mode={mode})".format(name=self.name, mode=self.mode))
 *         if self.mode == 'r' or self.mode == 'rw':
 *             l.append("Status: Frame: {frame}  | MatrixIdx: {midx} | Matrix: {matrix}".format(             # <<<<<<<<<<<<<<
 *                 frame=framestatus2str(self.frame_status),
 *                 midx=self.matrix_idx,
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Status_Frame_frame_MatrixIdx_mid, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "pysdif/_pysdif.pyx":1199
 *         if self.mode == 'r' or self.mode == 'rw':
 *             l.append("Status: Frame: {frame}  | MatrixIdx: {midx} | Matrix: {matrix}".format(
 *                 frame=framestatus2str(self.frame_status),             # <<<<<<<<<<<<<<
 *                 midx=self.matrix_idx,
 *                 matrix=matrixstatus2str(self.matrix_status))
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_framestatus2str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_FrameStatusE(__pyx_v_self->frame_status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_frame, __pyx_t_2) < 0) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1200
 *             l.append("Status: Frame: {frame}  | MatrixIdx: {midx} | Matrix: {matrix}".format(
 *                 frame=framestatus2str(self.frame_status),
 *                 midx=self.matrix_idx,             # <<<<<<<<<<<<<<
 *                 matrix=matrixstatus2str(self.matrix_status))
 *             )
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->matrix_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_midx, __pyx_t_2) < 0) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1201
 *                 frame=framestatus2str(self.frame_status),
 *                 midx=self.matrix_idx,
 *                 matrix=matrixstatus2str(self.matrix_status))             # <<<<<<<<<<<<<<
 *             )
 *         return "\n".join(l)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_matrixstatus2str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_MatrixStatusE(__pyx_v_self->matrix_status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_matrix, __pyx_t_2) < 0) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1198
 *         l.append("SdifFile(name={name}, mode={mode})".format(name=self.name, mode=self.mode))
 *         if self.mode == 'r' or self.mode == 'rw':
 *             l.append("Status: Frame: {frame}  | MatrixIdx: {midx} | Matrix: {matrix}".format(             # <<<<<<<<<<<<<<
 *                 frame=framestatus2str(self.frame_status),
 *                 midx=self.matrix_idx,
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_l, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1198, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1197
 *         l = []
 *         l.append("SdifFile(name={name}, mode={mode})".format(name=self.name, mode=self.mode))
 *         if self.mode == 'r' or self.mode == 'rw':             # <<<<<<<<<<<<<<
 *             l.append("Status: Frame: {frame}  | MatrixIdx: {midx} | Matrix: {matrix}".format(
 *                 frame=framestatus2str(self.frame_status),
 */
  }

  /* "pysdif/_pysdif.pyx":1203
 *                 matrix=matrixstatus2str(self.matrix_status))
 *             )
 *         return "\n".join(l)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__17, __pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1192
 *             self.init_write()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.this == NULL:
 *             return "SdifFile(NULL)"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1206
 * 
 * 
 *     cdef void init_read(self):             # <<<<<<<<<<<<<<
 *         SdifFReadGeneralHeader (self.this)
 *         SdifFReadAllASCIIChunks(self.this)
 */

static void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_read(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init_read", 0);

  /* "pysdif/_pysdif.pyx":1207
 * 
 *     cdef void init_read(self):
 *         SdifFReadGeneralHeader (self.this)             # <<<<<<<<<<<<<<
 *         SdifFReadAllASCIIChunks(self.this)
 *         self.eof = (self.this.CurrSignature == eEof)
 */
  (void)(SdifFReadGeneralHeader(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":1208
 *     cdef void init_read(self):
 *         SdifFReadGeneralHeader (self.this)
 *         SdifFReadAllASCIIChunks(self.this)             # <<<<<<<<<<<<<<
 *         self.eof = (self.this.CurrSignature == eEof)
 *         self.this.TextStream = stdout  # this is needed by the print functions
 */
  (void)(SdifFReadAllASCIIChunks(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":1209
 *         SdifFReadGeneralHeader (self.this)
 *         SdifFReadAllASCIIChunks(self.this)
 *         self.eof = (self.this.CurrSignature == eEof)             # <<<<<<<<<<<<<<
 *         self.this.TextStream = stdout  # this is needed by the print functions
 *         self.init_containers()
 */
  __pyx_v_self->eof = (__pyx_v_self->this->CurrSignature == eEof);

  /* "pysdif/_pysdif.pyx":1210
 *         SdifFReadAllASCIIChunks(self.this)
 *         self.eof = (self.this.CurrSignature == eEof)
 *         self.this.TextStream = stdout  # this is needed by the print functions             # <<<<<<<<<<<<<<
 *         self.init_containers()
 *         self.frame_status = eFrameNothingRead
 */
  __pyx_v_self->this->TextStream = stdout;

  /* "pysdif/_pysdif.pyx":1211
 *         self.eof = (self.this.CurrSignature == eEof)
 *         self.this.TextStream = stdout  # this is needed by the print functions
 *         self.init_containers()             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameNothingRead
 *         self.matrix_idx = 0
 */
  ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->init_containers(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1212
 *         self.this.TextStream = stdout  # this is needed by the print functions
 *         self.init_containers()
 *         self.frame_status = eFrameNothingRead             # <<<<<<<<<<<<<<
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 */
  __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameNothingRead;

  /* "pysdif/_pysdif.pyx":1213
 *         self.init_containers()
 *         self.frame_status = eFrameNothingRead
 *         self.matrix_idx = 0             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixNothingRead
 * 
 */
  __pyx_v_self->matrix_idx = 0;

  /* "pysdif/_pysdif.pyx":1214
 *         self.frame_status = eFrameNothingRead
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_containers(self):
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead;

  /* "pysdif/_pysdif.pyx":1206
 * 
 * 
 *     cdef void init_read(self):             # <<<<<<<<<<<<<<
 *         SdifFReadGeneralHeader (self.this)
 *         SdifFReadAllASCIIChunks(self.this)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pysdif/_pysdif.pyx":1216
 *         self.matrix_status = eMatrixNothingRead
 * 
 *     cdef void init_containers(self):             # <<<<<<<<<<<<<<
 *         self.frame = FrameR(self)
 *         self.matrix = Matrix(self)
 */

static void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_containers(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_containers", 0);

  /* "pysdif/_pysdif.pyx":1217
 * 
 *     cdef void init_containers(self):
 *         self.frame = FrameR(self)             # <<<<<<<<<<<<<<
 *         self.matrix = Matrix(self)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameR), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->frame);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->frame));
  __pyx_v_self->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1218
 *     cdef void init_containers(self):
 *         self.frame = FrameR(self)
 *         self.matrix = Matrix(self)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_write(self):
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_Matrix), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->matrix);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->matrix));
  __pyx_v_self->matrix = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1216
 *         self.matrix_status = eMatrixNothingRead
 * 
 *     cdef void init_containers(self):             # <<<<<<<<<<<<<<
 *         self.frame = FrameR(self)
 *         self.matrix = Matrix(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile.init_containers", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysdif/_pysdif.pyx":1220
 *         self.matrix = Matrix(self)
 * 
 *     cdef void init_write(self):             # <<<<<<<<<<<<<<
 *         SdifFWriteGeneralHeader(self.this)
 *         self.write_status = eSdifGeneralHeader
 */

static void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_write(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_write", 0);

  /* "pysdif/_pysdif.pyx":1221
 * 
 *     cdef void init_write(self):
 *         SdifFWriteGeneralHeader(self.this)             # <<<<<<<<<<<<<<
 *         self.write_status = eSdifGeneralHeader
 *         self._frametypes_defined = set()
 */
  (void)(SdifFWriteGeneralHeader(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":1222
 *     cdef void init_write(self):
 *         SdifFWriteGeneralHeader(self.this)
 *         self.write_status = eSdifGeneralHeader             # <<<<<<<<<<<<<<
 *         self._frametypes_defined = set()
 *         self._matrixtypes_defined = set()
 */
  __pyx_v_self->write_status = __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader;

  /* "pysdif/_pysdif.pyx":1223
 *         SdifFWriteGeneralHeader(self.this)
 *         self.write_status = eSdifGeneralHeader
 *         self._frametypes_defined = set()             # <<<<<<<<<<<<<<
 *         self._matrixtypes_defined = set()
 * 
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_frametypes_defined);
  __Pyx_DECREF(__pyx_v_self->_frametypes_defined);
  __pyx_v_self->_frametypes_defined = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1224
 *         self.write_status = eSdifGeneralHeader
 *         self._frametypes_defined = set()
 *         self._matrixtypes_defined = set()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_matrixtypes_defined);
  __Pyx_DECREF(__pyx_v_self->_matrixtypes_defined);
  __pyx_v_self->_matrixtypes_defined = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1220
 *         self.matrix = Matrix(self)
 * 
 *     cdef void init_write(self):             # <<<<<<<<<<<<<<
 *         SdifFWriteGeneralHeader(self.this)
 *         self.write_status = eSdifGeneralHeader
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile.init_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysdif/_pysdif.pyx":1226
 *         self._matrixtypes_defined = set()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         logger.debug("SdifFile: dealloc")
 *         self.frame = None
 */

/* Python wrapper */
static void __pyx_pw_6pysdif_7_pysdif_8SdifFile_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6pysdif_7_pysdif_8SdifFile_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6pysdif_7_pysdif_8SdifFile_6__dealloc__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_6pysdif_7_pysdif_8SdifFile_6__dealloc__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pysdif/_pysdif.pyx":1227
 * 
 *     def __dealloc__(self):
 *         logger.debug("SdifFile: dealloc")             # <<<<<<<<<<<<<<
 *         self.frame = None
 *         self.matrix = None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s_SdifFile_dealloc) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_SdifFile_dealloc);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1228
 *     def __dealloc__(self):
 *         logger.debug("SdifFile: dealloc")
 *         self.frame = None             # <<<<<<<<<<<<<<
 *         self.matrix = None
 *         self.close()  # fails silently if already closed
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->frame);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->frame));
  __pyx_v_self->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)Py_None);

  /* "pysdif/_pysdif.pyx":1229
 *         logger.debug("SdifFile: dealloc")
 *         self.frame = None
 *         self.matrix = None             # <<<<<<<<<<<<<<
 *         self.close()  # fails silently if already closed
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->matrix);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->matrix));
  __pyx_v_self->matrix = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)Py_None);

  /* "pysdif/_pysdif.pyx":1230
 *         self.frame = None
 *         self.matrix = None
 *         self.close()  # fails silently if already closed             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1226
 *         self._matrixtypes_defined = set()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         logger.debug("SdifFile: dealloc")
 *         self.frame = None
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysdif/_pysdif.pyx":1232
 *         self.close()  # fails silently if already closed
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close this SdifFile
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_9close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_8close[] = "SdifFile.close(self)\n\n        Close this SdifFile\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_9close = {"close", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_9close, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_8close};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_9close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_8close(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_8close(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pysdif/_pysdif.pyx":1236
 *         Close this SdifFile
 *         """
 *         if self.eof == SDIF_CLOSED:             # <<<<<<<<<<<<<<
 *             logger.debug("close: can't close SdifFile, since it was already closed")
 *             return
 */
  __pyx_t_1 = ((__pyx_v_self->eof == __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1237
 *         """
 *         if self.eof == SDIF_CLOSED:
 *             logger.debug("close: can't close SdifFile, since it was already closed")             # <<<<<<<<<<<<<<
 *             return
 *         elif self.this == NULL:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s_close_can_t_close_SdifFile_since) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_close_can_t_close_SdifFile_since);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1238
 *         if self.eof == SDIF_CLOSED:
 *             logger.debug("close: can't close SdifFile, since it was already closed")
 *             return             # <<<<<<<<<<<<<<
 *         elif self.this == NULL:
 *             logger.debug("close: can't close SdifFile: it is NULL")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1236
 *         Close this SdifFile
 *         """
 *         if self.eof == SDIF_CLOSED:             # <<<<<<<<<<<<<<
 *             logger.debug("close: can't close SdifFile, since it was already closed")
 *             return
 */
  }

  /* "pysdif/_pysdif.pyx":1239
 *             logger.debug("close: can't close SdifFile, since it was already closed")
 *             return
 *         elif self.this == NULL:             # <<<<<<<<<<<<<<
 *             logger.debug("close: can't close SdifFile: it is NULL")
 *         # make sure we write the global header even if no
 */
  __pyx_t_1 = ((__pyx_v_self->this == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1240
 *             return
 *         elif self.this == NULL:
 *             logger.debug("close: can't close SdifFile: it is NULL")             # <<<<<<<<<<<<<<
 *         # make sure we write the global header even if no
 *         # new frames are written (the global chunks are automatically
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_close_can_t_close_SdifFile_it_is) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_close_can_t_close_SdifFile_it_is);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1239
 *             logger.debug("close: can't close SdifFile, since it was already closed")
 *             return
 *         elif self.this == NULL:             # <<<<<<<<<<<<<<
 *             logger.debug("close: can't close SdifFile: it is NULL")
 *         # make sure we write the global header even if no
 */
  }

  /* "pysdif/_pysdif.pyx":1244
 *         # new frames are written (the global chunks are automatically
 *         # written when a new frame is added to the sdiffile)
 *         if self.this.Mode == eWriteFile:             # <<<<<<<<<<<<<<
 *             if self.write_status == eSdifGeneralHeader:
 *                 self.write_all_ascii_chunks()
 */
  __pyx_t_1 = ((__pyx_v_self->this->Mode == eWriteFile) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1245
 *         # written when a new frame is added to the sdiffile)
 *         if self.this.Mode == eWriteFile:
 *             if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *                 self.write_all_ascii_chunks()
 *         SdifFClose(self.this)
 */
    __pyx_t_1 = ((__pyx_v_self->write_status == __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader) != 0);
    if (__pyx_t_1) {

      /* "pysdif/_pysdif.pyx":1246
 *         if self.this.Mode == eWriteFile:
 *             if self.write_status == eSdifGeneralHeader:
 *                 self.write_all_ascii_chunks()             # <<<<<<<<<<<<<<
 *         SdifFClose(self.this)
 *         self.eof = SDIF_CLOSED
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_all_ascii_chunks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pysdif/_pysdif.pyx":1245
 *         # written when a new frame is added to the sdiffile)
 *         if self.this.Mode == eWriteFile:
 *             if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *                 self.write_all_ascii_chunks()
 *         SdifFClose(self.this)
 */
    }

    /* "pysdif/_pysdif.pyx":1244
 *         # new frames are written (the global chunks are automatically
 *         # written when a new frame is added to the sdiffile)
 *         if self.this.Mode == eWriteFile:             # <<<<<<<<<<<<<<
 *             if self.write_status == eSdifGeneralHeader:
 *                 self.write_all_ascii_chunks()
 */
  }

  /* "pysdif/_pysdif.pyx":1247
 *             if self.write_status == eSdifGeneralHeader:
 *                 self.write_all_ascii_chunks()
 *         SdifFClose(self.this)             # <<<<<<<<<<<<<<
 *         self.eof = SDIF_CLOSED
 * 
 */
  SdifFClose(__pyx_v_self->this);

  /* "pysdif/_pysdif.pyx":1248
 *                 self.write_all_ascii_chunks()
 *         SdifFClose(self.this)
 *         self.eof = SDIF_CLOSED             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->eof = __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED;

  /* "pysdif/_pysdif.pyx":1232
 *         self.close()  # fails silently if already closed
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close this SdifFile
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1251
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         return self.this.Name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_4name___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4name___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":1252
 *     @property
 *     def name(self):
 *         return self.this.Name             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->this->Name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1251
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         return self.this.Name
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1255
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         return FILEMODE_MODE2STR[self.this.Mode]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_4mode___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4mode___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":1256
 *     @property
 *     def mode(self):
 *         return FILEMODE_MODE2STR[self.this.Mode]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_6pysdif_7_pysdif_FILEMODE_MODE2STR == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1256, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_From_enum__SdifFileModeE(__pyx_v_self->this->Mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_6pysdif_7_pysdif_FILEMODE_MODE2STR, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1255
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         return FILEMODE_MODE2STR[self.this.Mode]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1259
 * 
 *     @property
 *     def is_seekable(self):             # <<<<<<<<<<<<<<
 *         """
 *         (bool) Is this SdifFile seekable?
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_11is_seekable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_11is_seekable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_11is_seekable___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_11is_seekable___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":1263
 *         (bool) Is this SdifFile seekable?
 *         """
 *         return self.this.isSeekable             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->this->isSeekable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1259
 * 
 *     @property
 *     def is_seekable(self):             # <<<<<<<<<<<<<<
 *         """
 *         (bool) Is this SdifFile seekable?
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.is_seekable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1266
 * 
 *     @property
 *     def numerical_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         (int) Current signature as numerical signature
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_19numerical_signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_19numerical_signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_19numerical_signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_19numerical_signature___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":1270
 *         (int) Current signature as numerical signature
 *         """
 *         return self.this.CurrSignature             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->this->CurrSignature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1266
 * 
 *     @property
 *     def numerical_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         (int) Current signature as numerical signature
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.numerical_signature.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1273
 * 
 *     @property
 *     def signature(self):             # <<<<<<<<<<<<<<
 *         """(str) Current signature as 4-byte string """
 *         return sig2str(self.this.CurrSignature)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_9signature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_9signature_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_9signature___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9signature___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":1275
 *     def signature(self):
 *         """(str) Current signature as 4-byte string """
 *         return sig2str(self.this.CurrSignature)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_self->this->CurrSignature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1273
 * 
 *     @property
 *     def signature(self):             # <<<<<<<<<<<<<<
 *         """(str) Current signature as 4-byte string """
 *         return sig2str(self.this.CurrSignature)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.signature.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1278
 * 
 *     @property
 *     def prev_time(self):             # <<<<<<<<<<<<<<
 *         """(float)"""
 *         return self.this.PrevTime
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_9prev_time_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_9prev_time_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_9prev_time___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9prev_time___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":1280
 *     def prev_time(self):
 *         """(float)"""
 *         return self.this.PrevTime             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->this->PrevTime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1278
 * 
 *     @property
 *     def prev_time(self):             # <<<<<<<<<<<<<<
 *         """(float)"""
 *         return self.this.PrevTime
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.prev_time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1283
 * 
 *     @property
 *     def frame_pos(self):             # <<<<<<<<<<<<<<
 *         return self.this.CurrFramPos
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_9frame_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_9frame_pos_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_9frame_pos___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9frame_pos___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":1284
 *     @property
 *     def frame_pos(self):
 *         return self.this.CurrFramPos             # <<<<<<<<<<<<<<
 * 
 *     def curr_matrix_size(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_SdiffPosT(__pyx_v_self->this->CurrFramPos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1283
 * 
 *     @property
 *     def frame_pos(self):             # <<<<<<<<<<<<<<
 *         return self.this.CurrFramPos
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1286
 *         return self.this.CurrFramPos
 * 
 *     def curr_matrix_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of rows and number of columns in the current matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_11curr_matrix_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_10curr_matrix_size[] = "SdifFile.curr_matrix_size(self)\n\n        Returns the number of rows and number of columns in the current matrix\n\n        This method can be called after reading the matrix header. It does \n        not read the data itself\n\n        Returns:\n            (tuple[int, int]) A tuple (num_rows, num_columns)\n        \n        !!! note \n\n            raises `NoMatrix` if the matrix header has not been read\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_11curr_matrix_size = {"curr_matrix_size", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_11curr_matrix_size, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_10curr_matrix_size};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_11curr_matrix_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("curr_matrix_size (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_10curr_matrix_size(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_10curr_matrix_size(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  SdifMatrixHeaderT *__pyx_v_m;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  SdifMatrixHeaderT *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("curr_matrix_size", 0);

  /* "pysdif/_pysdif.pyx":1300
 *             raises `NoMatrix` if the matrix header has not been read
 *         """
 *         cdef SdifMatrixHeaderT* m = self.this.CurrMtrxH             # <<<<<<<<<<<<<<
 *         if m == NULL:
 *             raise NoMatrix("No current matrix")
 */
  __pyx_t_1 = __pyx_v_self->this->CurrMtrxH;
  __pyx_v_m = __pyx_t_1;

  /* "pysdif/_pysdif.pyx":1301
 *         """
 *         cdef SdifMatrixHeaderT* m = self.this.CurrMtrxH
 *         if m == NULL:             # <<<<<<<<<<<<<<
 *             raise NoMatrix("No current matrix")
 *         return (m.NbRow, m.NbCol)
 */
  __pyx_t_2 = ((__pyx_v_m == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pysdif/_pysdif.pyx":1302
 *         cdef SdifMatrixHeaderT* m = self.this.CurrMtrxH
 *         if m == NULL:
 *             raise NoMatrix("No current matrix")             # <<<<<<<<<<<<<<
 *         return (m.NbRow, m.NbCol)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NoMatrix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_No_current_matrix) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_No_current_matrix);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1302, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1301
 *         """
 *         cdef SdifMatrixHeaderT* m = self.this.CurrMtrxH
 *         if m == NULL:             # <<<<<<<<<<<<<<
 *             raise NoMatrix("No current matrix")
 *         return (m.NbRow, m.NbCol)
 */
  }

  /* "pysdif/_pysdif.pyx":1303
 *         if m == NULL:
 *             raise NoMatrix("No current matrix")
 *         return (m.NbRow, m.NbCol)             # <<<<<<<<<<<<<<
 * 
 *     def curr_matrix_datatype(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_m->NbRow); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_m->NbCol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1286
 *         return self.this.CurrFramPos
 * 
 *     def curr_matrix_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of rows and number of columns in the current matrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.curr_matrix_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1305
 *         return (m.NbRow, m.NbCol)
 * 
 *     def curr_matrix_datatype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the datatype code (an int) or 0 if go current matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_13curr_matrix_datatype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_12curr_matrix_datatype[] = "SdifFile.curr_matrix_datatype(self)\n\n        Returns the datatype code (an int) or 0 if go current matrix\n\n        Returns:\n            (int) the datatype of the current matrix as an int code\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_13curr_matrix_datatype = {"curr_matrix_datatype", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_13curr_matrix_datatype, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_12curr_matrix_datatype};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_13curr_matrix_datatype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("curr_matrix_datatype (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_12curr_matrix_datatype(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_12curr_matrix_datatype(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("curr_matrix_datatype", 0);

  /* "pysdif/_pysdif.pyx":1312
 *             (int) the datatype of the current matrix as an int code
 *         """
 *         if self.this.CurrMtrxH == NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         return self.this.CurrMtrxH.DataType
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrMtrxH == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1313
 *         """
 *         if self.this.CurrMtrxH == NULL:
 *             return 0             # <<<<<<<<<<<<<<
 *         return self.this.CurrMtrxH.DataType
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1312
 *             (int) the datatype of the current matrix as an int code
 *         """
 *         if self.this.CurrMtrxH == NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         return self.this.CurrMtrxH.DataType
 */
  }

  /* "pysdif/_pysdif.pyx":1314
 *         if self.this.CurrMtrxH == NULL:
 *             return 0
 *         return self.this.CurrMtrxH.DataType             # <<<<<<<<<<<<<<
 * 
 *     def curr_signature(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_enum__SdifDataTypeE(__pyx_v_self->this->CurrMtrxH->DataType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1305
 *         return (m.NbRow, m.NbCol)
 * 
 *     def curr_matrix_datatype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the datatype code (an int) or 0 if go current matrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.curr_matrix_datatype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1316
 *         return self.this.CurrMtrxH.DataType
 * 
 *     def curr_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level interface** - Return the current frame's numerical signature
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_15curr_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_14curr_signature[] = "SdifFile.curr_signature(self)\n\n        **Low-level interface** - Return the current frame's numerical signature\n\n        Returns:\n            (int) The current numerical signature\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_15curr_signature = {"curr_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_15curr_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_14curr_signature};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_15curr_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("curr_signature (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_14curr_signature(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_14curr_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("curr_signature", 0);

  /* "pysdif/_pysdif.pyx":1323
 *             (int) The current numerical signature
 *         """
 *         return SdifFCurrSignature(self.this)             # <<<<<<<<<<<<<<
 * 
 *     cdef int curr_matrix_numerical_signature(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_SdifUInt4(SdifFCurrSignature(__pyx_v_self->this)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1316
 *         return self.this.CurrMtrxH.DataType
 * 
 *     def curr_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level interface** - Return the current frame's numerical signature
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.curr_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1325
 *         return SdifFCurrSignature(self.this)
 * 
 *     cdef int curr_matrix_numerical_signature(self):             # <<<<<<<<<<<<<<
 *         if self.this.CurrMtrxH == NULL:
 *             return -1
 */

static int __pyx_f_6pysdif_7_pysdif_8SdifFile_curr_matrix_numerical_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("curr_matrix_numerical_signature", 0);

  /* "pysdif/_pysdif.pyx":1326
 * 
 *     cdef int curr_matrix_numerical_signature(self):
 *         if self.this.CurrMtrxH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrMtrxH.Signature
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrMtrxH == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1327
 *     cdef int curr_matrix_numerical_signature(self):
 *         if self.this.CurrMtrxH == NULL:
 *             return -1             # <<<<<<<<<<<<<<
 *         return self.this.CurrMtrxH.Signature
 * 
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1326
 * 
 *     cdef int curr_matrix_numerical_signature(self):
 *         if self.this.CurrMtrxH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrMtrxH.Signature
 */
  }

  /* "pysdif/_pysdif.pyx":1328
 *         if self.this.CurrMtrxH == NULL:
 *             return -1
 *         return self.this.CurrMtrxH.Signature             # <<<<<<<<<<<<<<
 * 
 *     def curr_matrix_signature(self):
 */
  __pyx_r = __pyx_v_self->this->CurrMtrxH->Signature;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1325
 *         return SdifFCurrSignature(self.this)
 * 
 *     cdef int curr_matrix_numerical_signature(self):             # <<<<<<<<<<<<<<
 *         if self.this.CurrMtrxH == NULL:
 *             return -1
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1330
 *         return self.this.CurrMtrxH.Signature
 * 
 *     def curr_matrix_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the string signature of the current matrix, or None if no current matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_17curr_matrix_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_16curr_matrix_signature[] = "SdifFile.curr_matrix_signature(self)\n\n        Get the string signature of the current matrix, or None if no current matrix\n\n        Returns:\n            (str | None) The 4-byte string signature of the current matrix, \n            or None if no matrix\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_17curr_matrix_signature = {"curr_matrix_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_17curr_matrix_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_16curr_matrix_signature};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_17curr_matrix_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("curr_matrix_signature (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_16curr_matrix_signature(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_16curr_matrix_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_sig;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("curr_matrix_signature", 0);

  /* "pysdif/_pysdif.pyx":1339
 *         """
 * 
 *         cdef int sig = self.curr_matrix_numerical_signature()             # <<<<<<<<<<<<<<
 *         if sig >= 0:
 *             return sig2str(sig)
 */
  __pyx_v_sig = ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->curr_matrix_numerical_signature(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1340
 * 
 *         cdef int sig = self.curr_matrix_numerical_signature()
 *         if sig >= 0:             # <<<<<<<<<<<<<<
 *             return sig2str(sig)
 *         return None
 */
  __pyx_t_1 = ((__pyx_v_sig >= 0) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1341
 *         cdef int sig = self.curr_matrix_numerical_signature()
 *         if sig >= 0:
 *             return sig2str(sig)             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_sig); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1340
 * 
 *         cdef int sig = self.curr_matrix_numerical_signature()
 *         if sig >= 0:             # <<<<<<<<<<<<<<
 *             return sig2str(sig)
 *         return None
 */
  }

  /* "pysdif/_pysdif.pyx":1342
 *         if sig >= 0:
 *             return sig2str(sig)
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def frame_num_matrix(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1330
 *         return self.this.CurrMtrxH.Signature
 * 
 *     def curr_matrix_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the string signature of the current matrix, or None if no current matrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.curr_matrix_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1344
 *         return None
 * 
 *     def frame_num_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of matrices in current frame.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_19frame_num_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_18frame_num_matrix[] = "SdifFile.frame_num_matrix(self)\n\n        Get the number of matrices in current frame.    \n\n        Returns:\n            (int) The number of matrices in the current frame, or -1\n            if no current frame\n\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_19frame_num_matrix = {"frame_num_matrix", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_19frame_num_matrix, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_18frame_num_matrix};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_19frame_num_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_num_matrix (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_18frame_num_matrix(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_18frame_num_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_num_matrix", 0);

  /* "pysdif/_pysdif.pyx":1353
 * 
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrFramH.NbMatrix
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1354
 *         """
 *         if self.this.CurrFramH == NULL:
 *             return -1             # <<<<<<<<<<<<<<
 *         return self.this.CurrFramH.NbMatrix
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1353
 * 
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrFramH.NbMatrix
 */
  }

  /* "pysdif/_pysdif.pyx":1355
 *         if self.this.CurrFramH == NULL:
 *             return -1
 *         return self.this.CurrFramH.NbMatrix             # <<<<<<<<<<<<<<
 * 
 *     def frame_id(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->this->CurrFramH->NbMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1344
 *         return None
 * 
 *     def frame_num_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of matrices in current frame.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_num_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1357
 *         return self.this.CurrFramH.NbMatrix
 * 
 *     def frame_id(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the id of the current frame, or -1 if no current frame
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_21frame_id(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_20frame_id[] = "SdifFile.frame_id(self)\n\n        Get the id of the current frame, or -1 if no current frame\n\n        Returns:\n            (int) The id of the current frame\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_21frame_id = {"frame_id", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_21frame_id, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_20frame_id};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_21frame_id(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_id (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_20frame_id(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_20frame_id(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_id", 0);

  /* "pysdif/_pysdif.pyx":1364
 *             (int) The id of the current frame
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrFramH.NumID
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1365
 *         """
 *         if self.this.CurrFramH == NULL:
 *             return -1             # <<<<<<<<<<<<<<
 *         return self.this.CurrFramH.NumID
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1364
 *             (int) The id of the current frame
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrFramH.NumID
 */
  }

  /* "pysdif/_pysdif.pyx":1366
 *         if self.this.CurrFramH == NULL:
 *             return -1
 *         return self.this.CurrFramH.NumID             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->this->CurrFramH->NumID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1357
 *         return self.this.CurrFramH.NbMatrix
 * 
 *     def frame_id(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the id of the current frame, or -1 if no current frame
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1369
 * 
 *     @property
 *     def pos(self):             # <<<<<<<<<<<<<<
 *         """The last position read"""
 *         cdef SdiffPosT _pos
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_3pos_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  SdiffPosT __pyx_v__pos;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pysdif/_pysdif.pyx":1372
 *         """The last position read"""
 *         cdef SdiffPosT _pos
 *         SdifFGetPos(self.this, &_pos)             # <<<<<<<<<<<<<<
 *         return _pos
 * 
 */
  (void)(SdifFGetPos(__pyx_v_self->this, (&__pyx_v__pos)));

  /* "pysdif/_pysdif.pyx":1373
 *         cdef SdiffPosT _pos
 *         SdifFGetPos(self.this, &_pos)
 *         return _pos             # <<<<<<<<<<<<<<
 * 
 *     @pos.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_SdiffPosT(__pyx_v__pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1369
 * 
 *     @property
 *     def pos(self):             # <<<<<<<<<<<<<<
 *         """The last position read"""
 *         cdef SdiffPosT _pos
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1376
 * 
 *     @pos.setter
 *     def pos(self, long pos):             # <<<<<<<<<<<<<<
 *         """
 *         The position in the file
 */

/* Python wrapper */
static int __pyx_pw_6pysdif_7_pysdif_8SdifFile_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
static int __pyx_pw_6pysdif_7_pysdif_8SdifFile_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos) {
  long __pyx_v_pos;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_pos); {
    __pyx_v_pos = __Pyx_PyInt_As_long(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos_2__set__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), ((long)__pyx_v_pos));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos_2__set__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, long __pyx_v_pos) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pysdif/_pysdif.pyx":1380
 *         The position in the file
 *         """
 *         SdifFSetPos(self.this, &pos)             # <<<<<<<<<<<<<<
 * 
 *     def frame_numerical_signature(self):
 */
  (void)(SdifFSetPos(__pyx_v_self->this, (&__pyx_v_pos)));

  /* "pysdif/_pysdif.pyx":1376
 * 
 *     @pos.setter
 *     def pos(self, long pos):             # <<<<<<<<<<<<<<
 *         """
 *         The position in the file
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1382
 *         SdifFSetPos(self.this, &pos)
 * 
 *     def frame_numerical_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the num. signature of current frame, or -1 if no current frame
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_23frame_numerical_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_22frame_numerical_signature[] = "SdifFile.frame_numerical_signature(self)\n\n        Return the num. signature of current frame, or -1 if no current frame\n\n        Returns:\n            (int) The numerical signature of the current frame, or -1 \n            if no current frame\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_23frame_numerical_signature = {"frame_numerical_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_23frame_numerical_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_22frame_numerical_signature};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_23frame_numerical_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_numerical_signature (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_22frame_numerical_signature(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_22frame_numerical_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_numerical_signature", 0);

  /* "pysdif/_pysdif.pyx":1390
 *             if no current frame
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrFramH.Signature
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1391
 *         """
 *         if self.this.CurrFramH == NULL:
 *             return -1             # <<<<<<<<<<<<<<
 *         return self.this.CurrFramH.Signature
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1390
 *             if no current frame
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrFramH.Signature
 */
  }

  /* "pysdif/_pysdif.pyx":1392
 *         if self.this.CurrFramH == NULL:
 *             return -1
 *         return self.this.CurrFramH.Signature             # <<<<<<<<<<<<<<
 * 
 *     def frame_signature(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_SdifUInt4(__pyx_v_self->this->CurrFramH->Signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1382
 *         SdifFSetPos(self.this, &pos)
 * 
 *     def frame_numerical_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the num. signature of current frame, or -1 if no current frame
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_numerical_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1394
 *         return self.this.CurrFramH.Signature
 * 
 *     def frame_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the str. signature of the current frame, or None if no current frame
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_25frame_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_24frame_signature[] = "SdifFile.frame_signature(self)\n\n        Return the str. signature of the current frame, or None if no current frame\n\n        Returns:\n            (str|None) The current frame signature (4-char string)\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_25frame_signature = {"frame_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_25frame_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_24frame_signature};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_25frame_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_signature (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_24frame_signature(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_24frame_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_signature", 0);

  /* "pysdif/_pysdif.pyx":1401
 *             (str|None) The current frame signature (4-char string)
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return sig2str(self.this.CurrFramH.Signature)
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1402
 *         """
 *         if self.this.CurrFramH == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return sig2str(self.this.CurrFramH.Signature)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1401
 *             (str|None) The current frame signature (4-char string)
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return sig2str(self.this.CurrFramH.Signature)
 */
  }

  /* "pysdif/_pysdif.pyx":1403
 *         if self.this.CurrFramH == NULL:
 *             return None
 *         return sig2str(self.this.CurrFramH.Signature)             # <<<<<<<<<<<<<<
 * 
 *     def frame_time(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_self->this->CurrFramH->Signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1394
 *         return self.this.CurrFramH.Signature
 * 
 *     def frame_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the str. signature of the current frame, or None if no current frame
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1405
 *         return sig2str(self.this.CurrFramH.Signature)
 * 
 *     def frame_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the time of the current frame, or -1 if no current frame
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_27frame_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_26frame_time[] = "SdifFile.frame_time(self)\n\n        Get the time of the current frame, or -1 if no current frame\n\n        Returns:\n            (float) The time of the current frame\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_27frame_time = {"frame_time", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_27frame_time, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_26frame_time};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_27frame_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_time (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_26frame_time(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_26frame_time(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_time", 0);

  /* "pysdif/_pysdif.pyx":1412
 *             (float) The time of the current frame
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrFramH.Time
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1413
 *         """
 *         if self.this.CurrFramH == NULL:
 *             return -1             # <<<<<<<<<<<<<<
 *         return self.this.CurrFramH.Time
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1412
 *             (float) The time of the current frame
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return -1
 *         return self.this.CurrFramH.Time
 */
  }

  /* "pysdif/_pysdif.pyx":1414
 *         if self.this.CurrFramH == NULL:
 *             return -1
 *         return self.this.CurrFramH.Time             # <<<<<<<<<<<<<<
 * 
 *     def last_error(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->this->CurrFramH->Time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1405
 *         return sig2str(self.this.CurrFramH.Signature)
 * 
 *     def frame_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the time of the current frame, or -1 if no current frame
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1416
 *         return self.this.CurrFramH.Time
 * 
 *     def last_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns (error_tag, error_level) or None if there is no last error
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_29last_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_28last_error[] = "SdifFile.last_error(self)\n\n        Returns (error_tag, error_level) or None if there is no last error\n\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_29last_error = {"last_error", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_29last_error, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_28last_error};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_29last_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("last_error (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_28last_error(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_28last_error(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  SdifErrorT *__pyx_v_error;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("last_error", 0);

  /* "pysdif/_pysdif.pyx":1421
 * 
 *         """
 *         cdef SdifErrorT* error = SdifFLastError(self.this)             # <<<<<<<<<<<<<<
 *         if error == NULL:
 *             return None
 */
  __pyx_v_error = SdifFLastError(__pyx_v_self->this);

  /* "pysdif/_pysdif.pyx":1422
 *         """
 *         cdef SdifErrorT* error = SdifFLastError(self.this)
 *         if error == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return (error.Tag, error.Level)
 */
  __pyx_t_1 = ((__pyx_v_error == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1423
 *         cdef SdifErrorT* error = SdifFLastError(self.this)
 *         if error == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return (error.Tag, error.Level)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1422
 *         """
 *         cdef SdifErrorT* error = SdifFLastError(self.this)
 *         if error == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return (error.Tag, error.Level)
 */
  }

  /* "pysdif/_pysdif.pyx":1424
 *         if error == NULL:
 *             return None
 *         return (error.Tag, error.Level)             # <<<<<<<<<<<<<<
 * 
 *     def curr_frame_is_selected(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_enum__SdifErrorTagE(__pyx_v_error->Tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_enum__SdifErrorLevelE(__pyx_v_error->Level); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1416
 *         return self.this.CurrFramH.Time
 * 
 *     def last_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns (error_tag, error_level) or None if there is no last error
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.last_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1426
 *         return (error.Tag, error.Level)
 * 
 *     def curr_frame_is_selected(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the current frame is selected.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_31curr_frame_is_selected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_30curr_frame_is_selected[] = "SdifFile.curr_frame_is_selected(self)\n\n        Return whether the current frame is selected. \n\n        Can only be called after reading the frame header. \n\n        !!! note\n\n            Raises `NoFrame` if no header was read\n\n        Returns:\n            (bool) True if current frame is selected\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_31curr_frame_is_selected = {"curr_frame_is_selected", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_31curr_frame_is_selected, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_30curr_frame_is_selected};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_31curr_frame_is_selected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("curr_frame_is_selected (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_30curr_frame_is_selected(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_30curr_frame_is_selected(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("curr_frame_is_selected", 0);

  /* "pysdif/_pysdif.pyx":1439
 *             (bool) True if current frame is selected
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("No current matrix!")
 *         return bool(SdifFCurrFrameIsSelected(self.this))
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1440
 *         """
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("No current matrix!")             # <<<<<<<<<<<<<<
 *         return bool(SdifFCurrFrameIsSelected(self.this))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_No_current_matrix_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_No_current_matrix_2);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1440, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1439
 *             (bool) True if current frame is selected
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("No current matrix!")
 *         return bool(SdifFCurrFrameIsSelected(self.this))
 */
  }

  /* "pysdif/_pysdif.pyx":1441
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("No current matrix!")
 *         return bool(SdifFCurrFrameIsSelected(self.this))             # <<<<<<<<<<<<<<
 * 
 *     def curr_matrix_is_selected(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(SdifFCurrFrameIsSelected(__pyx_v_self->this)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1426
 *         return (error.Tag, error.Level)
 * 
 *     def curr_frame_is_selected(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the current frame is selected.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.curr_frame_is_selected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1443
 *         return bool(SdifFCurrFrameIsSelected(self.this))
 * 
 *     def curr_matrix_is_selected(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the current matrix is selected.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_33curr_matrix_is_selected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_32curr_matrix_is_selected[] = "SdifFile.curr_matrix_is_selected(self)\n\n        Return whether the current matrix is selected. \n\n        !!! note\n\n            Raises `NoMatrix` if the matrix header was not read.\n\n        Returns:\n            (bool) True if current matrix is selected\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_33curr_matrix_is_selected = {"curr_matrix_is_selected", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_33curr_matrix_is_selected, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_32curr_matrix_is_selected};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_33curr_matrix_is_selected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("curr_matrix_is_selected (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_32curr_matrix_is_selected(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_32curr_matrix_is_selected(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("curr_matrix_is_selected", 0);

  /* "pysdif/_pysdif.pyx":1454
 *             (bool) True if current matrix is selected
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoMatrix("No current matrix!")
 *         return bool(SdifFCurrMatrixIsSelected(self.this))
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1455
 *         """
 *         if self.this.CurrFramH == NULL:
 *             raise NoMatrix("No current matrix!")             # <<<<<<<<<<<<<<
 *         return bool(SdifFCurrMatrixIsSelected(self.this))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoMatrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_No_current_matrix_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_No_current_matrix_2);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1455, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1454
 *             (bool) True if current matrix is selected
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoMatrix("No current matrix!")
 *         return bool(SdifFCurrMatrixIsSelected(self.this))
 */
  }

  /* "pysdif/_pysdif.pyx":1456
 *         if self.this.CurrFramH == NULL:
 *             raise NoMatrix("No current matrix!")
 *         return bool(SdifFCurrMatrixIsSelected(self.this))             # <<<<<<<<<<<<<<
 * 
 *     def get_num_NVTs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(SdifFCurrMatrixIsSelected(__pyx_v_self->this)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1443
 *         return bool(SdifFCurrFrameIsSelected(self.this))
 * 
 *     def curr_matrix_is_selected(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the current matrix is selected.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.curr_matrix_is_selected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1458
 *         return bool(SdifFCurrMatrixIsSelected(self.this))
 * 
 *     def get_num_NVTs(self):             # <<<<<<<<<<<<<<
 *         if SdifNameValuesLIsNotEmpty(self.this.NameValues):
 *             return SdifFNameValueNum(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_35get_num_NVTs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_34get_num_NVTs[] = "SdifFile.get_num_NVTs(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_35get_num_NVTs = {"get_num_NVTs", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_35get_num_NVTs, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_34get_num_NVTs};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_35get_num_NVTs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_NVTs (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_34get_num_NVTs(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_34get_num_NVTs(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_num_NVTs", 0);

  /* "pysdif/_pysdif.pyx":1459
 * 
 *     def get_num_NVTs(self):
 *         if SdifNameValuesLIsNotEmpty(self.this.NameValues):             # <<<<<<<<<<<<<<
 *             return SdifFNameValueNum(self.this)
 *         else:
 */
  __pyx_t_1 = (SdifNameValuesLIsNotEmpty(__pyx_v_self->this->NameValues) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1460
 *     def get_num_NVTs(self):
 *         if SdifNameValuesLIsNotEmpty(self.this.NameValues):
 *             return SdifFNameValueNum(self.this)             # <<<<<<<<<<<<<<
 *         else:
 *             return 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(SdifFNameValueNum(__pyx_v_self->this)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1459
 * 
 *     def get_num_NVTs(self):
 *         if SdifNameValuesLIsNotEmpty(self.this.NameValues):             # <<<<<<<<<<<<<<
 *             return SdifFNameValueNum(self.this)
 *         else:
 */
  }

  /* "pysdif/_pysdif.pyx":1462
 *             return SdifFNameValueNum(self.this)
 *         else:
 *             return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
  }

  /* "pysdif/_pysdif.pyx":1458
 *         return bool(SdifFCurrMatrixIsSelected(self.this))
 * 
 *     def get_num_NVTs(self):             # <<<<<<<<<<<<<<
 *         if SdifNameValuesLIsNotEmpty(self.this.NameValues):
 *             return SdifFNameValueNum(self.this)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.get_num_NVTs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1465
 * 
 * 
 *     cdef int _frame_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         Internal function.
 */

static int __pyx_f_6pysdif_7_pysdif_8SdifFile__frame_read_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_status;
  int __pyx_v_bytes_read;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  enum __pyx_t_6pysdif_7_pysdif_FrameStatusE __pyx_t_2;
  __Pyx_RefNannySetupContext("_frame_read_header", 0);

  /* "pysdif/_pysdif.pyx":1473
 *         If eof is reached, returns 0
 *         """
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             return 0
 *         cdef int status = self.frame_status
 */
  __pyx_t_1 = ((__pyx_v_self->eof == 1) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1474
 *         """
 *         if self.eof == 1:
 *             return 0             # <<<<<<<<<<<<<<
 *         cdef int status = self.frame_status
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead or status == eFrameAllDataRead:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1473
 *         If eof is reached, returns 0
 *         """
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             return 0
 *         cdef int status = self.frame_status
 */
  }

  /* "pysdif/_pysdif.pyx":1475
 *         if self.eof == 1:
 *             return 0
 *         cdef int status = self.frame_status             # <<<<<<<<<<<<<<
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead or status == eFrameAllDataRead:
 *             return -1
 */
  __pyx_t_2 = __pyx_v_self->frame_status;
  __pyx_v_status = __pyx_t_2;

  /* "pysdif/_pysdif.pyx":1476
 *             return 0
 *         cdef int status = self.frame_status
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead or status == eFrameAllDataRead:             # <<<<<<<<<<<<<<
 *             return -1
 *         cdef int bytes_read = SdifFReadFrameHeader(self.this)
 */
  switch (__pyx_v_status) {
    case __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead:
    case __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead:
    case __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead:

    /* "pysdif/_pysdif.pyx":1477
 *         cdef int status = self.frame_status
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead or status == eFrameAllDataRead:
 *             return -1             # <<<<<<<<<<<<<<
 *         cdef int bytes_read = SdifFReadFrameHeader(self.this)
 *         # bytes_read += self._read_signature()
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1476
 *             return 0
 *         cdef int status = self.frame_status
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead or status == eFrameAllDataRead:             # <<<<<<<<<<<<<<
 *             return -1
 *         cdef int bytes_read = SdifFReadFrameHeader(self.this)
 */
    break;
    default: break;
  }

  /* "pysdif/_pysdif.pyx":1478
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead or status == eFrameAllDataRead:
 *             return -1
 *         cdef int bytes_read = SdifFReadFrameHeader(self.this)             # <<<<<<<<<<<<<<
 *         # bytes_read += self._read_signature()
 *         self.frame_status = eFrameHeaderRead
 */
  __pyx_v_bytes_read = SdifFReadFrameHeader(__pyx_v_self->this);

  /* "pysdif/_pysdif.pyx":1480
 *         cdef int bytes_read = SdifFReadFrameHeader(self.this)
 *         # bytes_read += self._read_signature()
 *         self.frame_status = eFrameHeaderRead             # <<<<<<<<<<<<<<
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 */
  __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead;

  /* "pysdif/_pysdif.pyx":1481
 *         # bytes_read += self._read_signature()
 *         self.frame_status = eFrameHeaderRead
 *         self.matrix_idx = 0             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixNothingRead
 *         return bytes_read
 */
  __pyx_v_self->matrix_idx = 0;

  /* "pysdif/_pysdif.pyx":1482
 *         self.frame_status = eFrameHeaderRead
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead             # <<<<<<<<<<<<<<
 *         return bytes_read
 * 
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead;

  /* "pysdif/_pysdif.pyx":1483
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     def frame_read_header(self):
 */
  __pyx_r = __pyx_v_bytes_read;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1465
 * 
 * 
 *     cdef int _frame_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         Internal function.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1485
 *         return bytes_read
 * 
 *     def frame_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         ** Low level interface ** - Read the frame header.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_37frame_read_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_36frame_read_header[] = "SdifFile.frame_read_header(self)\n\n        ** Low level interface ** - Read the frame header.\n\n        Returns the number of bytes read. If it reaches the\n        end of file, self.eof is 1 and this function returns 0\n\n        Raises SdifOrderError if the header or some of the data\n        were already read from this frame.\n        \n        Returns:\n            (int) The bytes read\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_37frame_read_header = {"frame_read_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_37frame_read_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_36frame_read_header};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_37frame_read_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_read_header (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_36frame_read_header(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_36frame_read_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_error;
  int __pyx_v_bytesread;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_read_header", 0);

  /* "pysdif/_pysdif.pyx":1499
 *         """
 *         cdef int error
 *         if self.frame_status == eFrameAllDataRead:             # <<<<<<<<<<<<<<
 *             # we are at the end of the last frame.
 *             logger.debug("frame_read_header: finalizing last frame")
 */
  __pyx_t_1 = ((__pyx_v_self->frame_status == __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1501
 *         if self.frame_status == eFrameAllDataRead:
 *             # we are at the end of the last frame.
 *             logger.debug("frame_read_header: finalizing last frame")             # <<<<<<<<<<<<<<
 *             error = self._finalize_frame()
 *             if error:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s_frame_read_header_finalizing_las) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_frame_read_header_finalizing_las);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1502
 *             # we are at the end of the last frame.
 *             logger.debug("frame_read_header: finalizing last frame")
 *             error = self._finalize_frame()             # <<<<<<<<<<<<<<
 *             if error:
 *                 raise SdifOrderError("Error finalizing Frame")
 */
    __pyx_v_error = __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_frame(__pyx_v_self);

    /* "pysdif/_pysdif.pyx":1503
 *             logger.debug("frame_read_header: finalizing last frame")
 *             error = self._finalize_frame()
 *             if error:             # <<<<<<<<<<<<<<
 *                 raise SdifOrderError("Error finalizing Frame")
 *         cdef int bytesread = self._frame_read_header()
 */
    __pyx_t_1 = (__pyx_v_error != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pysdif/_pysdif.pyx":1504
 *             error = self._finalize_frame()
 *             if error:
 *                 raise SdifOrderError("Error finalizing Frame")             # <<<<<<<<<<<<<<
 *         cdef int bytesread = self._frame_read_header()
 *         if bytesread >= 0:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s_Error_finalizing_Frame) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_Error_finalizing_Frame);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1504, __pyx_L1_error)

      /* "pysdif/_pysdif.pyx":1503
 *             logger.debug("frame_read_header: finalizing last frame")
 *             error = self._finalize_frame()
 *             if error:             # <<<<<<<<<<<<<<
 *                 raise SdifOrderError("Error finalizing Frame")
 *         cdef int bytesread = self._frame_read_header()
 */
    }

    /* "pysdif/_pysdif.pyx":1499
 *         """
 *         cdef int error
 *         if self.frame_status == eFrameAllDataRead:             # <<<<<<<<<<<<<<
 *             # we are at the end of the last frame.
 *             logger.debug("frame_read_header: finalizing last frame")
 */
  }

  /* "pysdif/_pysdif.pyx":1505
 *             if error:
 *                 raise SdifOrderError("Error finalizing Frame")
 *         cdef int bytesread = self._frame_read_header()             # <<<<<<<<<<<<<<
 *         if bytesread >= 0:
 *             return bytesread
 */
  __pyx_v_bytesread = ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->_frame_read_header(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1506
 *                 raise SdifOrderError("Error finalizing Frame")
 *         cdef int bytesread = self._frame_read_header()
 *         if bytesread >= 0:             # <<<<<<<<<<<<<<
 *             return bytesread
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_bytesread >= 0) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1507
 *         cdef int bytesread = self._frame_read_header()
 *         if bytesread >= 0:
 *             return bytesread             # <<<<<<<<<<<<<<
 *         else:
 *             if self.frame_status == eFrameHeaderRead:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_bytesread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1506
 *                 raise SdifOrderError("Error finalizing Frame")
 *         cdef int bytesread = self._frame_read_header()
 *         if bytesread >= 0:             # <<<<<<<<<<<<<<
 *             return bytesread
 *         else:
 */
  }

  /* "pysdif/_pysdif.pyx":1509
 *             return bytesread
 *         else:
 *             if self.frame_status == eFrameHeaderRead:             # <<<<<<<<<<<<<<
 *                 raise SdifOrderError("The header was already read")
 *             else:
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->frame_status == __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pysdif/_pysdif.pyx":1510
 *         else:
 *             if self.frame_status == eFrameHeaderRead:
 *                 raise SdifOrderError("The header was already read")             # <<<<<<<<<<<<<<
 *             else:
 *                 raise SdifOrderError("The frame should be read or skipped before a new header is read")
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s_The_header_was_already_read) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_The_header_was_already_read);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1510, __pyx_L1_error)

      /* "pysdif/_pysdif.pyx":1509
 *             return bytesread
 *         else:
 *             if self.frame_status == eFrameHeaderRead:             # <<<<<<<<<<<<<<
 *                 raise SdifOrderError("The header was already read")
 *             else:
 */
    }

    /* "pysdif/_pysdif.pyx":1512
 *                 raise SdifOrderError("The header was already read")
 *             else:
 *                 raise SdifOrderError("The frame should be read or skipped before a new header is read")             # <<<<<<<<<<<<<<
 * 
 *     def frame_skip_data(self):
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s_The_frame_should_be_read_or_skip) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_The_frame_should_be_read_or_skip);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1512, __pyx_L1_error)
    }
  }

  /* "pysdif/_pysdif.pyx":1485
 *         return bytes_read
 * 
 *     def frame_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         ** Low level interface ** - Read the frame header.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_read_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1514
 *                 raise SdifOrderError("The frame should be read or skipped before a new header is read")
 * 
 *     def frame_skip_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low level interface** - Skip frame and all its matrices
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_39frame_skip_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_38frame_skip_data[] = "SdifFile.frame_skip_data(self)\n\n        **Low level interface** - Skip frame and all its matrices\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_39frame_skip_data = {"frame_skip_data", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_39frame_skip_data, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_38frame_skip_data};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_39frame_skip_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_skip_data (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_38frame_skip_data(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_38frame_skip_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  size_t __pyx_v_bytes_read;
  int __pyx_v_error;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_skip_data", 0);

  /* "pysdif/_pysdif.pyx":1518
 *         **Low level interface** - Skip frame and all its matrices
 *         """
 *         cdef size_t bytes_read = SdifFSkipFrameData (self.this)             # <<<<<<<<<<<<<<
 *         logger.debug("frame_skip_data: calling finalize_frame")
 *         cdef int error = self._finalize_frame()
 */
  __pyx_v_bytes_read = SdifFSkipFrameData(__pyx_v_self->this);

  /* "pysdif/_pysdif.pyx":1519
 *         """
 *         cdef size_t bytes_read = SdifFSkipFrameData (self.this)
 *         logger.debug("frame_skip_data: calling finalize_frame")             # <<<<<<<<<<<<<<
 *         cdef int error = self._finalize_frame()
 *         if error:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s_frame_skip_data_calling_finalize) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_frame_skip_data_calling_finalize);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1520
 *         cdef size_t bytes_read = SdifFSkipFrameData (self.this)
 *         logger.debug("frame_skip_data: calling finalize_frame")
 *         cdef int error = self._finalize_frame()             # <<<<<<<<<<<<<<
 *         if error:
 *             raise SdifOrderError("Error finalizing Frame")
 */
  __pyx_v_error = __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_frame(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1521
 *         logger.debug("frame_skip_data: calling finalize_frame")
 *         cdef int error = self._finalize_frame()
 *         if error:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Error finalizing Frame")
 *         return bytes_read
 */
  __pyx_t_4 = (__pyx_v_error != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pysdif/_pysdif.pyx":1522
 *         cdef int error = self._finalize_frame()
 *         if error:
 *             raise SdifOrderError("Error finalizing Frame")             # <<<<<<<<<<<<<<
 *         return bytes_read
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s_Error_finalizing_Frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Error_finalizing_Frame);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1522, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1521
 *         logger.debug("frame_skip_data: calling finalize_frame")
 *         cdef int error = self._finalize_frame()
 *         if error:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Error finalizing Frame")
 *         return bytes_read
 */
  }

  /* "pysdif/_pysdif.pyx":1523
 *         if error:
 *             raise SdifOrderError("Error finalizing Frame")
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     cpdef int _read_signature(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1514
 *                 raise SdifOrderError("The frame should be read or skipped before a new header is read")
 * 
 *     def frame_skip_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low level interface** - Skip frame and all its matrices
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_skip_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1525
 *         return bytes_read
 * 
 *     cpdef int _read_signature(self):             # <<<<<<<<<<<<<<
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof
 */

static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_41_read_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int __pyx_f_6pysdif_7_pysdif_8SdifFile__read_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t __pyx_v_NbCharRead;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_signature", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  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)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6pysdif_7_pysdif_8SdifFile_41_read_signature)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1525, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pysdif/_pysdif.pyx":1527
 *     cpdef int _read_signature(self):
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameSignatureRead
 *         return NbCharRead
 */
  __pyx_v_self->eof = (SdifFGetSignature(__pyx_v_self->this, (&__pyx_v_NbCharRead)) == eEof);

  /* "pysdif/_pysdif.pyx":1528
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof
 *         self.frame_status = eFrameSignatureRead             # <<<<<<<<<<<<<<
 *         return NbCharRead
 * 
 */
  __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead;

  /* "pysdif/_pysdif.pyx":1529
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof
 *         self.frame_status = eFrameSignatureRead
 *         return NbCharRead             # <<<<<<<<<<<<<<
 * 
 *     cdef inline size_t _read_matrix_header(self):
 */
  __pyx_r = __pyx_v_NbCharRead;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1525
 *         return bytes_read
 * 
 *     cpdef int _read_signature(self):             # <<<<<<<<<<<<<<
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile._read_signature", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_41_read_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_40_read_signature[] = "SdifFile._read_signature(self) -> int";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_41_read_signature = {"_read_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_41_read_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_40_read_signature};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_41_read_signature(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_signature (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_40_read_signature(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_40_read_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_signature", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_6pysdif_7_pysdif_8SdifFile__read_signature(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile._read_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1531
 *         return NbCharRead
 * 
 *     cdef inline size_t _read_matrix_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         Internal
 */

static CYTHON_INLINE size_t __pyx_f_6pysdif_7_pysdif_8SdifFile__read_matrix_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_read_matrix_header", 0);

  /* "pysdif/_pysdif.pyx":1538
 *         Return the number of bytes read or 0 if no more matrices.
 *         """
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             return 0
 *         self.frame_status = eFrameSomeDataRead
 */
  __pyx_t_1 = ((__pyx_v_self->matrix_idx >= __pyx_v_self->this->CurrFramH->NbMatrix) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1539
 *         """
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             return 0             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameSomeDataRead
 *         self.matrix_status = eMatrixHeaderRead
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1538
 *         Return the number of bytes read or 0 if no more matrices.
 *         """
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             return 0
 *         self.frame_status = eFrameSomeDataRead
 */
  }

  /* "pysdif/_pysdif.pyx":1540
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             return 0
 *         self.frame_status = eFrameSomeDataRead             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixHeaderRead
 *         return SdifFReadMatrixHeader(self.this)
 */
  __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead;

  /* "pysdif/_pysdif.pyx":1541
 *             return 0
 *         self.frame_status = eFrameSomeDataRead
 *         self.matrix_status = eMatrixHeaderRead             # <<<<<<<<<<<<<<
 *         return SdifFReadMatrixHeader(self.this)
 * 
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead;

  /* "pysdif/_pysdif.pyx":1542
 *         self.frame_status = eFrameSomeDataRead
 *         self.matrix_status = eMatrixHeaderRead
 *         return SdifFReadMatrixHeader(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def matrix_read_header(self):
 */
  __pyx_r = SdifFReadMatrixHeader(__pyx_v_self->this);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1531
 *         return NbCharRead
 * 
 *     cdef inline size_t _read_matrix_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         Internal
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1544
 *         return SdifFReadMatrixHeader(self.this)
 * 
 *     def matrix_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low level interface** - Read the matrix header
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_43matrix_read_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_42matrix_read_header[] = "SdifFile.matrix_read_header(self)\n\n        **Low level interface** - Read the matrix header \n\n        Reads the matrix header (signature, number of rows and columns, etc.)\n        Return the number of bytes read or 0 if no more matrices,\n        or if eof is reached\n\n        !!! note\n\n            Raises `NoFrame` if no current frame\n\n        Returns:\n            (int) The bytes read\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_43matrix_read_header = {"matrix_read_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_43matrix_read_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_42matrix_read_header};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_43matrix_read_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix_read_header (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_42matrix_read_header(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_42matrix_read_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  size_t __pyx_v_bytesread;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix_read_header", 0);

  /* "pysdif/_pysdif.pyx":1559
 *             (int) The bytes read
 *         """
 *         if self.frame_status == eFrameNothingRead:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Frame header has not been read")
 *         if self.this.CurrFramH == NULL:
 */
  __pyx_t_1 = ((__pyx_v_self->frame_status == __pyx_e_6pysdif_7_pysdif_eFrameNothingRead) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1560
 *         """
 *         if self.frame_status == eFrameNothingRead:
 *             raise SdifOrderError("Frame header has not been read")             # <<<<<<<<<<<<<<
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("no current frame")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Frame_header_has_not_been_read) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Frame_header_has_not_been_read);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1560, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1559
 *             (int) The bytes read
 *         """
 *         if self.frame_status == eFrameNothingRead:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Frame header has not been read")
 *         if self.this.CurrFramH == NULL:
 */
  }

  /* "pysdif/_pysdif.pyx":1561
 *         if self.frame_status == eFrameNothingRead:
 *             raise SdifOrderError("Frame header has not been read")
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("no current frame")
 *         if self.matrix_status == eMatrixHeaderRead:
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1562
 *             raise SdifOrderError("Frame header has not been read")
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("no current frame")             # <<<<<<<<<<<<<<
 *         if self.matrix_status == eMatrixHeaderRead:
 *             raise SdifOrderError("Matrix header was already read")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_no_current_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_no_current_frame);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1562, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1561
 *         if self.frame_status == eFrameNothingRead:
 *             raise SdifOrderError("Frame header has not been read")
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("no current frame")
 *         if self.matrix_status == eMatrixHeaderRead:
 */
  }

  /* "pysdif/_pysdif.pyx":1563
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("no current frame")
 *         if self.matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Matrix header was already read")
 *         if self.eof:
 */
  __pyx_t_1 = ((__pyx_v_self->matrix_status == __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1564
 *             raise NoFrame("no current frame")
 *         if self.matrix_status == eMatrixHeaderRead:
 *             raise SdifOrderError("Matrix header was already read")             # <<<<<<<<<<<<<<
 *         if self.eof:
 *             logger.error("Attempted to read past end of file")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Matrix_header_was_already_read) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Matrix_header_was_already_read);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1564, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1563
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("no current frame")
 *         if self.matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Matrix header was already read")
 *         if self.eof:
 */
  }

  /* "pysdif/_pysdif.pyx":1565
 *         if self.matrix_status == eMatrixHeaderRead:
 *             raise SdifOrderError("Matrix header was already read")
 *         if self.eof:             # <<<<<<<<<<<<<<
 *             logger.error("Attempted to read past end of file")
 *             return 0
 */
  __pyx_t_1 = (__pyx_v_self->eof != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1566
 *             raise SdifOrderError("Matrix header was already read")
 *         if self.eof:
 *             logger.error("Attempted to read past end of file")             # <<<<<<<<<<<<<<
 *             return 0
 *         cdef size_t bytesread = self._read_matrix_header()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s_Attempted_to_read_past_end_of_fi) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_Attempted_to_read_past_end_of_fi);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1567
 *         if self.eof:
 *             logger.error("Attempted to read past end of file")
 *             return 0             # <<<<<<<<<<<<<<
 *         cdef size_t bytesread = self._read_matrix_header()
 *         return bytesread
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1565
 *         if self.matrix_status == eMatrixHeaderRead:
 *             raise SdifOrderError("Matrix header was already read")
 *         if self.eof:             # <<<<<<<<<<<<<<
 *             logger.error("Attempted to read past end of file")
 *             return 0
 */
  }

  /* "pysdif/_pysdif.pyx":1568
 *             logger.error("Attempted to read past end of file")
 *             return 0
 *         cdef size_t bytesread = self._read_matrix_header()             # <<<<<<<<<<<<<<
 *         return bytesread
 * 
 */
  __pyx_v_bytesread = __pyx_f_6pysdif_7_pysdif_8SdifFile__read_matrix_header(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1569
 *             return 0
 *         cdef size_t bytesread = self._read_matrix_header()
 *         return bytesread             # <<<<<<<<<<<<<<
 * 
 *     def curr_frame_available(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_bytesread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1544
 *         return SdifFReadMatrixHeader(self.this)
 * 
 *     def matrix_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low level interface** - Read the matrix header
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.matrix_read_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1571
 *         return bytesread
 * 
 *     def curr_frame_available(self):             # <<<<<<<<<<<<<<
 *        return self.this.CurrFramH != NULL
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_45curr_frame_available(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_44curr_frame_available[] = "SdifFile.curr_frame_available(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_45curr_frame_available = {"curr_frame_available", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_45curr_frame_available, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_44curr_frame_available};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_45curr_frame_available(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("curr_frame_available (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_44curr_frame_available(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_44curr_frame_available(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("curr_frame_available", 0);

  /* "pysdif/_pysdif.pyx":1572
 * 
 *     def curr_frame_available(self):
 *        return self.this.CurrFramH != NULL             # <<<<<<<<<<<<<<
 * 
 *     def curr_matrix_available(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->this->CurrFramH != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1571
 *         return bytesread
 * 
 *     def curr_frame_available(self):             # <<<<<<<<<<<<<<
 *        return self.this.CurrFramH != NULL
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.curr_frame_available", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1574
 *        return self.this.CurrFramH != NULL
 * 
 *     def curr_matrix_available(self):             # <<<<<<<<<<<<<<
 *        return self.this.CurrMtrxH != NULL
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_47curr_matrix_available(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_46curr_matrix_available[] = "SdifFile.curr_matrix_available(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_47curr_matrix_available = {"curr_matrix_available", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_47curr_matrix_available, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_46curr_matrix_available};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_47curr_matrix_available(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("curr_matrix_available (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_46curr_matrix_available(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_46curr_matrix_available(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("curr_matrix_available", 0);

  /* "pysdif/_pysdif.pyx":1575
 * 
 *     def curr_matrix_available(self):
 *        return self.this.CurrMtrxH != NULL             # <<<<<<<<<<<<<<
 * 
 *     def matrix_skip_data(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->this->CurrMtrxH != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1574
 *        return self.this.CurrFramH != NULL
 * 
 *     def curr_matrix_available(self):             # <<<<<<<<<<<<<<
 *        return self.this.CurrMtrxH != NULL
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.curr_matrix_available", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1577
 *        return self.this.CurrMtrxH != NULL
 * 
 *     def matrix_skip_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level Interface** - Skip the matrix data without reading it.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_49matrix_skip_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_48matrix_skip_data[] = "SdifFile.matrix_skip_data(self)\n\n        **Low-level Interface** - Skip the matrix data without reading it.\n\n        !!! note\n\n            Raises NoFrame if no current frame\n\n        Returns:\n            (int) The bytes read. \n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_49matrix_skip_data = {"matrix_skip_data", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_49matrix_skip_data, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_48matrix_skip_data};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_49matrix_skip_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix_skip_data (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_48matrix_skip_data(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_48matrix_skip_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  size_t __pyx_v_bytes_read;
  int __pyx_v_error;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix_skip_data", 0);

  /* "pysdif/_pysdif.pyx":1588
 *             (int) The bytes read.
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("matrix_skip_data: no current frame")
 *         if self.matrix_status != eMatrixHeaderRead:
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1589
 *         """
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("matrix_skip_data: no current frame")             # <<<<<<<<<<<<<<
 *         if self.matrix_status != eMatrixHeaderRead:
 *             raise SdifOrderError("Matrix data can only be skipped after reading the matrix header")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_matrix_skip_data_no_current_fram) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_matrix_skip_data_no_current_fram);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1589, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1588
 *             (int) The bytes read.
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("matrix_skip_data: no current frame")
 *         if self.matrix_status != eMatrixHeaderRead:
 */
  }

  /* "pysdif/_pysdif.pyx":1590
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("matrix_skip_data: no current frame")
 *         if self.matrix_status != eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Matrix data can only be skipped after reading the matrix header")
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)
 */
  __pyx_t_1 = ((__pyx_v_self->matrix_status != __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1591
 *             raise NoFrame("matrix_skip_data: no current frame")
 *         if self.matrix_status != eMatrixHeaderRead:
 *             raise SdifOrderError("Matrix data can only be skipped after reading the matrix header")             # <<<<<<<<<<<<<<
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)
 *         self.matrix_status = eMatrixDataSkipped
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Matrix_data_can_only_be_skipped) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Matrix_data_can_only_be_skipped);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1591, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1590
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("matrix_skip_data: no current frame")
 *         if self.matrix_status != eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Matrix data can only be skipped after reading the matrix header")
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)
 */
  }

  /* "pysdif/_pysdif.pyx":1592
 *         if self.matrix_status != eMatrixHeaderRead:
 *             raise SdifOrderError("Matrix data can only be skipped after reading the matrix header")
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef int error = self._finalize_matrix()
 */
  __pyx_v_bytes_read = SdifFSkipMatrixData(__pyx_v_self->this);

  /* "pysdif/_pysdif.pyx":1593
 *             raise SdifOrderError("Matrix data can only be skipped after reading the matrix header")
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)
 *         self.matrix_status = eMatrixDataSkipped             # <<<<<<<<<<<<<<
 *         cdef int error = self._finalize_matrix()
 *         if error:
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixDataSkipped;

  /* "pysdif/_pysdif.pyx":1594
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef int error = self._finalize_matrix()             # <<<<<<<<<<<<<<
 *         if error:
 *             raise SdifOrderError("error finishing matrix")
 */
  __pyx_v_error = __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_matrix(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1595
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef int error = self._finalize_matrix()
 *         if error:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("error finishing matrix")
 *         return bytes_read
 */
  __pyx_t_1 = (__pyx_v_error != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1596
 *         cdef int error = self._finalize_matrix()
 *         if error:
 *             raise SdifOrderError("error finishing matrix")             # <<<<<<<<<<<<<<
 *         return bytes_read
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_error_finishing_matrix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_error_finishing_matrix);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1596, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1595
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef int error = self._finalize_matrix()
 *         if error:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("error finishing matrix")
 *         return bytes_read
 */
  }

  /* "pysdif/_pysdif.pyx":1597
 *         if error:
 *             raise SdifOrderError("error finishing matrix")
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     cdef inline int _matrix_read_data(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1577
 *        return self.this.CurrMtrxH != NULL
 * 
 *     def matrix_skip_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level Interface** - Skip the matrix data without reading it.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.matrix_skip_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1599
 *         return bytes_read
 * 
 *     cdef inline int _matrix_read_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the matrix data.
 */

static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__matrix_read_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_bytesread;
  int __pyx_v_error;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_matrix_read_data", 0);

  /* "pysdif/_pysdif.pyx":1606
 *             (int) The number of bytes read, 0 if error
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         cdef int bytesread = SdifFReadMatrixData(self.this)
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1607
 *         """
 *         if self.this.CurrFramH == NULL:
 *             return 0             # <<<<<<<<<<<<<<
 *         cdef int bytesread = SdifFReadMatrixData(self.this)
 *         self.matrix_status = eMatrixDataRead
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1606
 *             (int) The number of bytes read, 0 if error
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         cdef int bytesread = SdifFReadMatrixData(self.this)
 */
  }

  /* "pysdif/_pysdif.pyx":1608
 *         if self.this.CurrFramH == NULL:
 *             return 0
 *         cdef int bytesread = SdifFReadMatrixData(self.this)             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixDataRead
 *         cdef int error = self._finalize_matrix()
 */
  __pyx_v_bytesread = SdifFReadMatrixData(__pyx_v_self->this);

  /* "pysdif/_pysdif.pyx":1609
 *             return 0
 *         cdef int bytesread = SdifFReadMatrixData(self.this)
 *         self.matrix_status = eMatrixDataRead             # <<<<<<<<<<<<<<
 *         cdef int error = self._finalize_matrix()
 *         if error:
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixDataRead;

  /* "pysdif/_pysdif.pyx":1610
 *         cdef int bytesread = SdifFReadMatrixData(self.this)
 *         self.matrix_status = eMatrixDataRead
 *         cdef int error = self._finalize_matrix()             # <<<<<<<<<<<<<<
 *         if error:
 *             return 0
 */
  __pyx_v_error = __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_matrix(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1611
 *         self.matrix_status = eMatrixDataRead
 *         cdef int error = self._finalize_matrix()
 *         if error:             # <<<<<<<<<<<<<<
 *             return 0
 *         return bytesread
 */
  __pyx_t_1 = (__pyx_v_error != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1612
 *         cdef int error = self._finalize_matrix()
 *         if error:
 *             return 0             # <<<<<<<<<<<<<<
 *         return bytesread
 * 
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1611
 *         self.matrix_status = eMatrixDataRead
 *         cdef int error = self._finalize_matrix()
 *         if error:             # <<<<<<<<<<<<<<
 *             return 0
 *         return bytesread
 */
  }

  /* "pysdif/_pysdif.pyx":1613
 *         if error:
 *             return 0
 *         return bytesread             # <<<<<<<<<<<<<<
 * 
 *     def matrix_read_data(self, copy=False):
 */
  __pyx_r = __pyx_v_bytesread;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1599
 *         return bytes_read
 * 
 *     cdef inline int _matrix_read_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the matrix data.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1615
 *         return bytesread
 * 
 *     def matrix_read_data(self, copy=False):             # <<<<<<<<<<<<<<
 *         """
 *         Read the data of the current matrix as a numpy array
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_51matrix_read_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_50matrix_read_data[] = "SdifFile.matrix_read_data(self, copy=False)\n\n        Read the data of the current matrix as a numpy array\n        \n        If the matrix-header was not read, it is read here\n        The matrix signature cam be retrieved via sdiffile.curr_matrix_signature()\n        \n        If data was already read, it is wrapped as a numpy array and returned.\n        \n        If copy is False, the array is referencing the data read and \n        is only valid as long as no new matrix is read.\n        To keep the array for longer, use `copy=True` or call `.copy()` on the array:\n\n        ```python\n        tmparray = sdiffile.matrix_read_data()\n        myarray = tmparray.copy() \n        ```\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_51matrix_read_data = {"matrix_read_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_51matrix_read_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_50matrix_read_data};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_51matrix_read_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_copy = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix_read_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copy);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matrix_read_data") < 0)) __PYX_ERR(0, 1615, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_copy = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("matrix_read_data", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1615, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.matrix_read_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_50matrix_read_data(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_copy);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_50matrix_read_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_copy) {
  int __pyx_v_status;
  size_t __pyx_v_bytesread;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix_read_data", 0);

  /* "pysdif/_pysdif.pyx":1633
 *         ```
 *         """
 *         cdef int status = self.matrix_status             # <<<<<<<<<<<<<<
 *         cdef size_t bytesread
 *         if status == eMatrixDataSkipped:
 */
  __pyx_t_1 = __pyx_v_self->matrix_status;
  __pyx_v_status = __pyx_t_1;

  /* "pysdif/_pysdif.pyx":1635
 *         cdef int status = self.matrix_status
 *         cdef size_t bytesread
 *         if status == eMatrixDataSkipped:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Can't get the data, since it was already skipped")
 *         if status == eMatrixNothingRead:
 */
  __pyx_t_2 = ((__pyx_v_status == __pyx_e_6pysdif_7_pysdif_eMatrixDataSkipped) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pysdif/_pysdif.pyx":1636
 *         cdef size_t bytesread
 *         if status == eMatrixDataSkipped:
 *             raise SdifOrderError("Can't get the data, since it was already skipped")             # <<<<<<<<<<<<<<
 *         if status == eMatrixNothingRead:
 *             if not self.matrix_read_header():
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_Can_t_get_the_data_since_it_was) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_Can_t_get_the_data_since_it_was);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1636, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1635
 *         cdef int status = self.matrix_status
 *         cdef size_t bytesread
 *         if status == eMatrixDataSkipped:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Can't get the data, since it was already skipped")
 *         if status == eMatrixNothingRead:
 */
  }

  /* "pysdif/_pysdif.pyx":1637
 *         if status == eMatrixDataSkipped:
 *             raise SdifOrderError("Can't get the data, since it was already skipped")
 *         if status == eMatrixNothingRead:             # <<<<<<<<<<<<<<
 *             if not self.matrix_read_header():
 *                 if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 */
  __pyx_t_2 = ((__pyx_v_status == __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead) != 0);
  if (__pyx_t_2) {

    /* "pysdif/_pysdif.pyx":1638
 *             raise SdifOrderError("Can't get the data, since it was already skipped")
 *         if status == eMatrixNothingRead:
 *             if not self.matrix_read_header():             # <<<<<<<<<<<<<<
 *                 if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *                     raise SdifOrderError("Attempted to read matrix header, but there are no more matrices in this frame")
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix_read_header); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((!__pyx_t_2) != 0);
    if (__pyx_t_6) {

      /* "pysdif/_pysdif.pyx":1639
 *         if status == eMatrixNothingRead:
 *             if not self.matrix_read_header():
 *                 if self.matrix_idx >= self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *                     raise SdifOrderError("Attempted to read matrix header, but there are no more matrices in this frame")
 *                 else:
 */
      __pyx_t_6 = ((__pyx_v_self->matrix_idx >= __pyx_v_self->this->CurrFramH->NbMatrix) != 0);
      if (unlikely(__pyx_t_6)) {

        /* "pysdif/_pysdif.pyx":1640
 *             if not self.matrix_read_header():
 *                 if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *                     raise SdifOrderError("Attempted to read matrix header, but there are no more matrices in this frame")             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise IOError("Could not read matrix header. ")
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_Attempted_to_read_matrix_header) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_Attempted_to_read_matrix_header);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1640, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(0, 1640, __pyx_L1_error)

        /* "pysdif/_pysdif.pyx":1639
 *         if status == eMatrixNothingRead:
 *             if not self.matrix_read_header():
 *                 if self.matrix_idx >= self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *                     raise SdifOrderError("Attempted to read matrix header, but there are no more matrices in this frame")
 *                 else:
 */
      }

      /* "pysdif/_pysdif.pyx":1642
 *                     raise SdifOrderError("Attempted to read matrix header, but there are no more matrices in this frame")
 *                 else:
 *                     raise IOError("Could not read matrix header. ")             # <<<<<<<<<<<<<<
 *             status = eMatrixHeaderRead
 *         if status == eMatrixHeaderRead:
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1642, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(0, 1642, __pyx_L1_error)
      }

      /* "pysdif/_pysdif.pyx":1638
 *             raise SdifOrderError("Can't get the data, since it was already skipped")
 *         if status == eMatrixNothingRead:
 *             if not self.matrix_read_header():             # <<<<<<<<<<<<<<
 *                 if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *                     raise SdifOrderError("Attempted to read matrix header, but there are no more matrices in this frame")
 */
    }

    /* "pysdif/_pysdif.pyx":1643
 *                 else:
 *                     raise IOError("Could not read matrix header. ")
 *             status = eMatrixHeaderRead             # <<<<<<<<<<<<<<
 *         if status == eMatrixHeaderRead:
 *             bytesread = self._matrix_read_data()
 */
    __pyx_v_status = __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead;

    /* "pysdif/_pysdif.pyx":1637
 *         if status == eMatrixDataSkipped:
 *             raise SdifOrderError("Can't get the data, since it was already skipped")
 *         if status == eMatrixNothingRead:             # <<<<<<<<<<<<<<
 *             if not self.matrix_read_header():
 *                 if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 */
  }

  /* "pysdif/_pysdif.pyx":1644
 *                     raise IOError("Could not read matrix header. ")
 *             status = eMatrixHeaderRead
 *         if status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             bytesread = self._matrix_read_data()
 *             if not bytesread:
 */
  __pyx_t_6 = ((__pyx_v_status == __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead) != 0);
  if (__pyx_t_6) {

    /* "pysdif/_pysdif.pyx":1645
 *             status = eMatrixHeaderRead
 *         if status == eMatrixHeaderRead:
 *             bytesread = self._matrix_read_data()             # <<<<<<<<<<<<<<
 *             if not bytesread:
 *                 raise IOError("matrix empty or could not read matrix data")
 */
    __pyx_v_bytesread = __pyx_f_6pysdif_7_pysdif_8SdifFile__matrix_read_data(__pyx_v_self);

    /* "pysdif/_pysdif.pyx":1646
 *         if status == eMatrixHeaderRead:
 *             bytesread = self._matrix_read_data()
 *             if not bytesread:             # <<<<<<<<<<<<<<
 *                 raise IOError("matrix empty or could not read matrix data")
 *         if copy:
 */
    __pyx_t_6 = ((!(__pyx_v_bytesread != 0)) != 0);
    if (unlikely(__pyx_t_6)) {

      /* "pysdif/_pysdif.pyx":1647
 *             bytesread = self._matrix_read_data()
 *             if not bytesread:
 *                 raise IOError("matrix empty or could not read matrix data")             # <<<<<<<<<<<<<<
 *         if copy:
 *             return _array_from_matrix_data_copy(self.this.CurrMtrxData)
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1647, __pyx_L1_error)

      /* "pysdif/_pysdif.pyx":1646
 *         if status == eMatrixHeaderRead:
 *             bytesread = self._matrix_read_data()
 *             if not bytesread:             # <<<<<<<<<<<<<<
 *                 raise IOError("matrix empty or could not read matrix data")
 *         if copy:
 */
    }

    /* "pysdif/_pysdif.pyx":1644
 *                     raise IOError("Could not read matrix header. ")
 *             status = eMatrixHeaderRead
 *         if status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             bytesread = self._matrix_read_data()
 *             if not bytesread:
 */
  }

  /* "pysdif/_pysdif.pyx":1648
 *             if not bytesread:
 *                 raise IOError("matrix empty or could not read matrix data")
 *         if copy:             # <<<<<<<<<<<<<<
 *             return _array_from_matrix_data_copy(self.this.CurrMtrxData)
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_copy); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1648, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "pysdif/_pysdif.pyx":1649
 *                 raise IOError("matrix empty or could not read matrix data")
 *         if copy:
 *             return _array_from_matrix_data_copy(self.this.CurrMtrxData)             # <<<<<<<<<<<<<<
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_copy(__pyx_v_self->this->CurrMtrxData)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1648
 *             if not bytesread:
 *                 raise IOError("matrix empty or could not read matrix data")
 *         if copy:             # <<<<<<<<<<<<<<
 *             return _array_from_matrix_data_copy(self.this.CurrMtrxData)
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)
 */
  }

  /* "pysdif/_pysdif.pyx":1650
 *         if copy:
 *             return _array_from_matrix_data_copy(self.this.CurrMtrxData)
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline int _finalize_matrix(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(__pyx_v_self->this->CurrMtrxData)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1615
 *         return bytesread
 * 
 *     def matrix_read_data(self, copy=False):             # <<<<<<<<<<<<<<
 *         """
 *         Read the data of the current matrix as a numpy array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.matrix_read_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1652
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)
 * 
 *     cdef inline int _finalize_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return 0 if OK, -1 if error
 */

static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_st;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_finalize_matrix", 0);

  /* "pysdif/_pysdif.pyx":1656
 *         Return 0 if OK, -1 if error
 *         """
 *         logger.debug("finalize_matrix")             # <<<<<<<<<<<<<<
 *         cdef int st = self.matrix_status
 *         if not (st == eMatrixDataRead or st == eMatrixDataSkipped):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_n_s_finalize_matrix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_finalize_matrix);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1657
 *         """
 *         logger.debug("finalize_matrix")
 *         cdef int st = self.matrix_status             # <<<<<<<<<<<<<<
 *         if not (st == eMatrixDataRead or st == eMatrixDataSkipped):
 *             logger.debug("tried to finalize matrix, but status is %s" % matrixstatus2str(st))
 */
  __pyx_t_4 = __pyx_v_self->matrix_status;
  __pyx_v_st = __pyx_t_4;

  /* "pysdif/_pysdif.pyx":1658
 *         logger.debug("finalize_matrix")
 *         cdef int st = self.matrix_status
 *         if not (st == eMatrixDataRead or st == eMatrixDataSkipped):             # <<<<<<<<<<<<<<
 *             logger.debug("tried to finalize matrix, but status is %s" % matrixstatus2str(st))
 *             return -1
 */
  switch (__pyx_v_st) {
    case __pyx_e_6pysdif_7_pysdif_eMatrixDataRead:
    case __pyx_e_6pysdif_7_pysdif_eMatrixDataSkipped:
    __pyx_t_5 = 1;
    break;
    default:
    __pyx_t_5 = 0;
    break;
  }
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  if (__pyx_t_6) {

    /* "pysdif/_pysdif.pyx":1659
 *         cdef int st = self.matrix_status
 *         if not (st == eMatrixDataRead or st == eMatrixDataSkipped):
 *             logger.debug("tried to finalize matrix, but status is %s" % matrixstatus2str(st))             # <<<<<<<<<<<<<<
 *             return -1
 *         self.matrix_idx += 1
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_matrixstatus2str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_st); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_tried_to_finalize_matrix_but_sta, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":1660
 *         if not (st == eMatrixDataRead or st == eMatrixDataSkipped):
 *             logger.debug("tried to finalize matrix, but status is %s" % matrixstatus2str(st))
 *             return -1             # <<<<<<<<<<<<<<
 *         self.matrix_idx += 1
 *         self.matrix_status = eMatrixNothingRead
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1658
 *         logger.debug("finalize_matrix")
 *         cdef int st = self.matrix_status
 *         if not (st == eMatrixDataRead or st == eMatrixDataSkipped):             # <<<<<<<<<<<<<<
 *             logger.debug("tried to finalize matrix, but status is %s" % matrixstatus2str(st))
 *             return -1
 */
  }

  /* "pysdif/_pysdif.pyx":1661
 *             logger.debug("tried to finalize matrix, but status is %s" % matrixstatus2str(st))
 *             return -1
 *         self.matrix_idx += 1             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixNothingRead
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 */
  __pyx_v_self->matrix_idx = (__pyx_v_self->matrix_idx + 1);

  /* "pysdif/_pysdif.pyx":1662
 *             return -1
 *         self.matrix_idx += 1
 *         self.matrix_status = eMatrixNothingRead             # <<<<<<<<<<<<<<
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead;

  /* "pysdif/_pysdif.pyx":1663
 *         self.matrix_idx += 1
 *         self.matrix_status = eMatrixNothingRead
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             self.frame_status = eFrameAllDataRead
 *             self._finalize_frame()
 */
  __pyx_t_6 = ((__pyx_v_self->matrix_idx >= __pyx_v_self->this->CurrFramH->NbMatrix) != 0);
  if (__pyx_t_6) {

    /* "pysdif/_pysdif.pyx":1664
 *         self.matrix_status = eMatrixNothingRead
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead             # <<<<<<<<<<<<<<
 *             self._finalize_frame()
 *         else:
 */
    __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead;

    /* "pysdif/_pysdif.pyx":1665
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead
 *             self._finalize_frame()             # <<<<<<<<<<<<<<
 *         else:
 *             self.frame_status = eFrameSomeDataRead
 */
    (void)(__pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_frame(__pyx_v_self));

    /* "pysdif/_pysdif.pyx":1663
 *         self.matrix_idx += 1
 *         self.matrix_status = eMatrixNothingRead
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             self.frame_status = eFrameAllDataRead
 *             self._finalize_frame()
 */
    goto __pyx_L4;
  }

  /* "pysdif/_pysdif.pyx":1667
 *             self._finalize_frame()
 *         else:
 *             self.frame_status = eFrameSomeDataRead             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  /*else*/ {
    __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead;
  }
  __pyx_L4:;

  /* "pysdif/_pysdif.pyx":1668
 *         else:
 *             self.frame_status = eFrameSomeDataRead
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def matrix_skip(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1652
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)
 * 
 *     cdef inline int _finalize_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return 0 if OK, -1 if error
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile._finalize_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1670
 *         return 0
 * 
 *     def matrix_skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         Low level Interface. Skip the matrix altogether.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_53matrix_skip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_52matrix_skip[] = "SdifFile.matrix_skip(self)\n\n        Low level Interface. Skip the matrix altogether. \n\n        !!! note\n\n            this CAN be called after having read the header, in which\n            case only the data is skipped, otherwise the matrix is\n            skipped altogether\n        \n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_53matrix_skip = {"matrix_skip", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_53matrix_skip, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_52matrix_skip};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_53matrix_skip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix_skip (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_52matrix_skip(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_52matrix_skip(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_matrix_status;
  size_t __pyx_v_bytes_read;
  int __pyx_v_error;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix_skip", 0);

  /* "pysdif/_pysdif.pyx":1681
 * 
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("matrix_skip: no current frame")
 *         cdef int matrix_status = self.matrix_status
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1682
 *         """
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("matrix_skip: no current frame")             # <<<<<<<<<<<<<<
 *         cdef int matrix_status = self.matrix_status
 *         cdef size_t bytes_read
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_matrix_skip_no_current_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_matrix_skip_no_current_frame);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1682, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1681
 * 
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("matrix_skip: no current frame")
 *         cdef int matrix_status = self.matrix_status
 */
  }

  /* "pysdif/_pysdif.pyx":1683
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("matrix_skip: no current frame")
 *         cdef int matrix_status = self.matrix_status             # <<<<<<<<<<<<<<
 *         cdef size_t bytes_read
 *         if matrix_status == eMatrixHeaderRead:
 */
  __pyx_t_5 = __pyx_v_self->matrix_status;
  __pyx_v_matrix_status = __pyx_t_5;

  /* "pysdif/_pysdif.pyx":1685
 *         cdef int matrix_status = self.matrix_status
 *         cdef size_t bytes_read
 *         if matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             bytes_read = SdifFSkipMatrixData(self.this)
 *         elif matrix_status == eMatrixNothingRead:
 */
  switch (__pyx_v_matrix_status) {
    case __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead:

    /* "pysdif/_pysdif.pyx":1686
 *         cdef size_t bytes_read
 *         if matrix_status == eMatrixHeaderRead:
 *             bytes_read = SdifFSkipMatrixData(self.this)             # <<<<<<<<<<<<<<
 *         elif matrix_status == eMatrixNothingRead:
 *             bytes_read = SdifFSkipMatrix(self.this)
 */
    __pyx_v_bytes_read = SdifFSkipMatrixData(__pyx_v_self->this);

    /* "pysdif/_pysdif.pyx":1685
 *         cdef int matrix_status = self.matrix_status
 *         cdef size_t bytes_read
 *         if matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             bytes_read = SdifFSkipMatrixData(self.this)
 *         elif matrix_status == eMatrixNothingRead:
 */
    break;
    case __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead:

    /* "pysdif/_pysdif.pyx":1688
 *             bytes_read = SdifFSkipMatrixData(self.this)
 *         elif matrix_status == eMatrixNothingRead:
 *             bytes_read = SdifFSkipMatrix(self.this)             # <<<<<<<<<<<<<<
 *         else:
 *             raise SdifOrderError("Matrix can only be skipped if data has not been already read or skipped")
 */
    __pyx_v_bytes_read = SdifFSkipMatrix(__pyx_v_self->this);

    /* "pysdif/_pysdif.pyx":1687
 *         if matrix_status == eMatrixHeaderRead:
 *             bytes_read = SdifFSkipMatrixData(self.this)
 *         elif matrix_status == eMatrixNothingRead:             # <<<<<<<<<<<<<<
 *             bytes_read = SdifFSkipMatrix(self.this)
 *         else:
 */
    break;
    default:

    /* "pysdif/_pysdif.pyx":1690
 *             bytes_read = SdifFSkipMatrix(self.this)
 *         else:
 *             raise SdifOrderError("Matrix can only be skipped if data has not been already read or skipped")             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef int error = self._finalize_matrix()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Matrix_can_only_be_skipped_if_da) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Matrix_can_only_be_skipped_if_da);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1690, __pyx_L1_error)
    break;
  }

  /* "pysdif/_pysdif.pyx":1691
 *         else:
 *             raise SdifOrderError("Matrix can only be skipped if data has not been already read or skipped")
 *         self.matrix_status = eMatrixDataSkipped             # <<<<<<<<<<<<<<
 *         cdef int error = self._finalize_matrix()
 *         if error:
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixDataSkipped;

  /* "pysdif/_pysdif.pyx":1692
 *             raise SdifOrderError("Matrix can only be skipped if data has not been already read or skipped")
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef int error = self._finalize_matrix()             # <<<<<<<<<<<<<<
 *         if error:
 *             raise SdifOrderError("Error finalizing matrix")
 */
  __pyx_v_error = __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_matrix(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1693
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef int error = self._finalize_matrix()
 *         if error:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Error finalizing matrix")
 *         return bytes_read
 */
  __pyx_t_1 = (__pyx_v_error != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1694
 *         cdef int error = self._finalize_matrix()
 *         if error:
 *             raise SdifOrderError("Error finalizing matrix")             # <<<<<<<<<<<<<<
 *         return bytes_read
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Error_finalizing_matrix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Error_finalizing_matrix);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1694, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1693
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef int error = self._finalize_matrix()
 *         if error:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Error finalizing matrix")
 *         return bytes_read
 */
  }

  /* "pysdif/_pysdif.pyx":1695
 *         if error:
 *             raise SdifOrderError("Error finalizing matrix")
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     def status(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1670
 *         return 0
 * 
 *     def matrix_skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         Low level Interface. Skip the matrix altogether.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.matrix_skip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1697
 *         return bytes_read
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple (curr_frame_status, curr_matrix_index, curr_matrix_status)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_55status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_54status[] = "SdifFile.status(self)\n\n        Returns a tuple (curr_frame_status, curr_matrix_index, curr_matrix_status)\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_55status = {"status", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_55status, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_54status};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_55status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("status (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_54status(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_54status(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("status", 0);

  /* "pysdif/_pysdif.pyx":1701
 *         Returns a tuple (curr_frame_status, curr_matrix_index, curr_matrix_status)
 *         """
 *         return self.frame_status, self.matrix_idx, self.matrix_status             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_FrameStatusE(__pyx_v_self->frame_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->matrix_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_MatrixStatusE(__pyx_v_self->matrix_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1697
 *         return bytes_read
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple (curr_frame_status, curr_matrix_index, curr_matrix_status)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1703
 *         return self.frame_status, self.matrix_idx, self.matrix_status
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_57__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_57__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_56__iter__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_56__iter__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pysdif/_pysdif.pyx":1704
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1703
 *         return self.frame_status, self.matrix_idx, self.matrix_status
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1706
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         self._next_frame()
 *         if self.eof == 1:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_59__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_59__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_58__next__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_58__next__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pysdif/_pysdif.pyx":1707
 * 
 *     def __next__(self):
 *         self._next_frame()             # <<<<<<<<<<<<<<
 *         if self.eof == 1:
 *             raise StopIteration
 */
  __pyx_f_6pysdif_7_pysdif_8SdifFile__next_frame(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1708
 *     def __next__(self):
 *         self._next_frame()
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return self.frame
 */
  __pyx_t_1 = ((__pyx_v_self->eof == 1) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1709
 *         self._next_frame()
 *         if self.eof == 1:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return self.frame
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 1709, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1708
 *     def __next__(self):
 *         self._next_frame()
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return self.frame
 */
  }

  /* "pysdif/_pysdif.pyx":1710
 *         if self.eof == 1:
 *             raise StopIteration
 *         return self.frame             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void _next_frame(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->frame));
  __pyx_r = ((PyObject *)__pyx_v_self->frame);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1706
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         self._next_frame()
 *         if self.eof == 1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1712
 *         return self.frame
 * 
 *     cdef inline void _next_frame(self):             # <<<<<<<<<<<<<<
 *         if self.eof == 1:
 *             return
 */

static CYTHON_INLINE void __pyx_f_6pysdif_7_pysdif_8SdifFile__next_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_frame_status;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  enum __pyx_t_6pysdif_7_pysdif_FrameStatusE __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_next_frame", 0);

  /* "pysdif/_pysdif.pyx":1713
 * 
 *     cdef inline void _next_frame(self):
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             return
 *         cdef int frame_status = self.frame_status
 */
  __pyx_t_1 = ((__pyx_v_self->eof == 1) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1714
 *     cdef inline void _next_frame(self):
 *         if self.eof == 1:
 *             return             # <<<<<<<<<<<<<<
 *         cdef int frame_status = self.frame_status
 *         if frame_status == eFrameSomeDataRead or frame_status == eFrameHeaderRead:
 */
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1713
 * 
 *     cdef inline void _next_frame(self):
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             return
 *         cdef int frame_status = self.frame_status
 */
  }

  /* "pysdif/_pysdif.pyx":1715
 *         if self.eof == 1:
 *             return
 *         cdef int frame_status = self.frame_status             # <<<<<<<<<<<<<<
 *         if frame_status == eFrameSomeDataRead or frame_status == eFrameHeaderRead:
 *             self.frame_skip_rest()
 */
  __pyx_t_2 = __pyx_v_self->frame_status;
  __pyx_v_frame_status = __pyx_t_2;

  /* "pysdif/_pysdif.pyx":1716
 *             return
 *         cdef int frame_status = self.frame_status
 *         if frame_status == eFrameSomeDataRead or frame_status == eFrameHeaderRead:             # <<<<<<<<<<<<<<
 *             self.frame_skip_rest()
 *         self.frame_read_header()
 */
  switch (__pyx_v_frame_status) {
    case __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead:
    case __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead:

    /* "pysdif/_pysdif.pyx":1717
 *         cdef int frame_status = self.frame_status
 *         if frame_status == eFrameSomeDataRead or frame_status == eFrameHeaderRead:
 *             self.frame_skip_rest()             # <<<<<<<<<<<<<<
 *         self.frame_read_header()
 *         if self.eof == 1:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frame_skip_rest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":1716
 *             return
 *         cdef int frame_status = self.frame_status
 *         if frame_status == eFrameSomeDataRead or frame_status == eFrameHeaderRead:             # <<<<<<<<<<<<<<
 *             self.frame_skip_rest()
 *         self.frame_read_header()
 */
    break;
    default: break;
  }

  /* "pysdif/_pysdif.pyx":1718
 *         if frame_status == eFrameSomeDataRead or frame_status == eFrameHeaderRead:
 *             self.frame_skip_rest()
 *         self.frame_read_header()             # <<<<<<<<<<<<<<
 *         if self.eof == 1:
 *             return
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frame_read_header); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":1719
 *             self.frame_skip_rest()
 *         self.frame_read_header()
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->eof == 1) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1720
 *         self.frame_read_header()
 *         if self.eof == 1:
 *             return             # <<<<<<<<<<<<<<
 * 
 *     def next_frame(self):
 */
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1719
 *             self.frame_skip_rest()
 *         self.frame_read_header()
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "pysdif/_pysdif.pyx":1712
 *         return self.frame
 * 
 *     cdef inline void _next_frame(self):             # <<<<<<<<<<<<<<
 *         if self.eof == 1:
 *             return
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile._next_frame", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysdif/_pysdif.pyx":1722
 *             return
 * 
 *     def next_frame(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the next frame, returns a Frame or None if no more frames left.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_61next_frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_60next_frame[] = "SdifFile.next_frame(self)\n\n        Read the next frame, returns a Frame or None if no more frames left.\n        \n        Returns:\n            (Frame | None) Returns the next Frame, or None if no more frames\n\n        ## Example\n\n        ```python\n\n        sdif = SdifFile(\"mysdif.sdif\")\n\n        while True:\n            frame = sdif.next_frame()\n            if frame is None: break\n            print(frame.time)\n\n        ```\n\n        This is the same as:\n\n        ```python\n        for frame in sdif:\n            print(frame.time)\n        ```\n\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_61next_frame = {"next_frame", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_61next_frame, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_60next_frame};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_61next_frame(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next_frame (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_60next_frame(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_60next_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("next_frame", 0);

  /* "pysdif/_pysdif.pyx":1750
 * 
 *         """
 *         self._next_frame()             # <<<<<<<<<<<<<<
 *         return self.frame if self.eof == 0 else None
 * 
 */
  __pyx_f_6pysdif_7_pysdif_8SdifFile__next_frame(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1751
 *         """
 *         self._next_frame()
 *         return self.frame if self.eof == 0 else None             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->eof == 0) != 0)) {
    __Pyx_INCREF(((PyObject *)__pyx_v_self->frame));
    __pyx_t_1 = ((PyObject *)__pyx_v_self->frame);
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1722
 *             return
 * 
 *     def next_frame(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the next frame, returns a Frame or None if no more frames left.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1753
 *         return self.frame if self.eof == 0 else None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_63__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_62__enter__[] = "SdifFile.__enter__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_63__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_63__enter__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_62__enter__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_63__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_62__enter__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_62__enter__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pysdif/_pysdif.pyx":1754
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1753
 *         return self.frame if self.eof == 0 else None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1756
 *         return self
 * 
 *     def __exit__(self):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_65__exit__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_64__exit__[] = "SdifFile.__exit__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_65__exit__ = {"__exit__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_65__exit__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_64__exit__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_65__exit__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_64__exit__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_64__exit__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pysdif/_pysdif.pyx":1757
 * 
 *     def __exit__(self):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def frame_skip_rest(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1756
 *         return self
 * 
 *     def __exit__(self):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1759
 *         self.close()
 * 
 *     def frame_skip_rest(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skipts the rest of the frame, so that a new frame can be read.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_67frame_skip_rest(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_66frame_skip_rest[] = "SdifFile.frame_skip_rest(self)\n\n        Skipts the rest of the frame, so that a new frame can be read.\n\n        Returns:\n            (bool) True if anything was skipped, False otherwise\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_67frame_skip_rest = {"frame_skip_rest", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_67frame_skip_rest, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_66frame_skip_rest};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_67frame_skip_rest(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_skip_rest (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_66frame_skip_rest(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_66frame_skip_rest(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_error;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_skip_rest", 0);

  /* "pysdif/_pysdif.pyx":1766
 *             (bool) True if anything was skipped, False otherwise
 *         """
 *         logger.debug("frame_skip_rest")             # <<<<<<<<<<<<<<
 *         if self.eof:
 *             raise EOFError("Attempted to read past end of file")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_n_s_frame_skip_rest) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_frame_skip_rest);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1767
 *         """
 *         logger.debug("frame_skip_rest")
 *         if self.eof:             # <<<<<<<<<<<<<<
 *             raise EOFError("Attempted to read past end of file")
 *         cdef int error = self._frame_skip_rest()
 */
  __pyx_t_4 = (__pyx_v_self->eof != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pysdif/_pysdif.pyx":1768
 *         logger.debug("frame_skip_rest")
 *         if self.eof:
 *             raise EOFError("Attempted to read past end of file")             # <<<<<<<<<<<<<<
 *         cdef int error = self._frame_skip_rest()
 *         return False if error else True
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1768, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1767
 *         """
 *         logger.debug("frame_skip_rest")
 *         if self.eof:             # <<<<<<<<<<<<<<
 *             raise EOFError("Attempted to read past end of file")
 *         cdef int error = self._frame_skip_rest()
 */
  }

  /* "pysdif/_pysdif.pyx":1769
 *         if self.eof:
 *             raise EOFError("Attempted to read past end of file")
 *         cdef int error = self._frame_skip_rest()             # <<<<<<<<<<<<<<
 *         return False if error else True
 * 
 */
  __pyx_v_error = ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->_frame_skip_rest(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1770
 *             raise EOFError("Attempted to read past end of file")
 *         cdef int error = self._frame_skip_rest()
 *         return False if error else True             # <<<<<<<<<<<<<<
 * 
 *     cdef int _frame_skip_rest(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_error != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1759
 *         self.close()
 * 
 *     def frame_skip_rest(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skipts the rest of the frame, so that a new frame can be read.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_skip_rest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1772
 *         return False if error else True
 * 
 *     cdef int _frame_skip_rest(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skipts the rest of the frame, so that a new frame can be read.
 */

static int __pyx_f_6pysdif_7_pysdif_8SdifFile__frame_skip_rest(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_status;
  CYTHON_UNUSED int __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  enum __pyx_t_6pysdif_7_pysdif_FrameStatusE __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  long __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_frame_skip_rest", 0);

  /* "pysdif/_pysdif.pyx":1776
 *         Skipts the rest of the frame, so that a new frame can be read.
 *         """
 *         cdef int status = self.frame_status             # <<<<<<<<<<<<<<
 *         cdef int num_matrix
 *         cdef int i
 */
  __pyx_t_1 = __pyx_v_self->frame_status;
  __pyx_v_status = __pyx_t_1;

  /* "pysdif/_pysdif.pyx":1779
 *         cdef int num_matrix
 *         cdef int i
 *         if status == eFrameSignatureRead or status == eFrameNothingRead:             # <<<<<<<<<<<<<<
 *             self.frame_read_header()
 *             status = eFrameHeaderRead
 */
  switch (__pyx_v_status) {
    case __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead:
    case __pyx_e_6pysdif_7_pysdif_eFrameNothingRead:

    /* "pysdif/_pysdif.pyx":1780
 *         cdef int i
 *         if status == eFrameSignatureRead or status == eFrameNothingRead:
 *             self.frame_read_header()             # <<<<<<<<<<<<<<
 *             status = eFrameHeaderRead
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frame_read_header); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1781
 *         if status == eFrameSignatureRead or status == eFrameNothingRead:
 *             self.frame_read_header()
 *             status = eFrameHeaderRead             # <<<<<<<<<<<<<<
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead:
 *             for i in range(self.matrix_idx, self.frame_num_matrix()):
 */
    __pyx_v_status = __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead;

    /* "pysdif/_pysdif.pyx":1779
 *         cdef int num_matrix
 *         cdef int i
 *         if status == eFrameSignatureRead or status == eFrameNothingRead:             # <<<<<<<<<<<<<<
 *             self.frame_read_header()
 *             status = eFrameHeaderRead
 */
    break;
    default: break;
  }

  /* "pysdif/_pysdif.pyx":1782
 *             self.frame_read_header()
 *             status = eFrameHeaderRead
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead:             # <<<<<<<<<<<<<<
 *             for i in range(self.matrix_idx, self.frame_num_matrix()):
 *                 self.matrix_skip()
 */
  switch (__pyx_v_status) {
    case __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead:
    case __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead:

    /* "pysdif/_pysdif.pyx":1783
 *             status = eFrameHeaderRead
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead:
 *             for i in range(self.matrix_idx, self.frame_num_matrix()):             # <<<<<<<<<<<<<<
 *                 self.matrix_skip()
 *             return 0
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frame_num_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = __pyx_v_self->matrix_idx; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "pysdif/_pysdif.pyx":1784
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead:
 *             for i in range(self.matrix_idx, self.frame_num_matrix()):
 *                 self.matrix_skip()             # <<<<<<<<<<<<<<
 *             return 0
 *         else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix_skip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1784, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1784, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "pysdif/_pysdif.pyx":1785
 *             for i in range(self.matrix_idx, self.frame_num_matrix()):
 *                 self.matrix_skip()
 *             return 0             # <<<<<<<<<<<<<<
 *         else:
 *             logger.debug("_frame_skip_rest: Attempted to skip, but everything was read already")
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1782
 *             self.frame_read_header()
 *             status = eFrameHeaderRead
 *         if status == eFrameHeaderRead or status == eFrameSomeDataRead:             # <<<<<<<<<<<<<<
 *             for i in range(self.matrix_idx, self.frame_num_matrix()):
 *                 self.matrix_skip()
 */
    break;
    default:

    /* "pysdif/_pysdif.pyx":1787
 *             return 0
 *         else:
 *             logger.debug("_frame_skip_rest: Attempted to skip, but everything was read already")             # <<<<<<<<<<<<<<
 *             return -1
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s_frame_skip_rest_Attempted_to_sk) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_frame_skip_rest_Attempted_to_sk);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1788
 *         else:
 *             logger.debug("_frame_skip_rest: Attempted to skip, but everything was read already")
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *     cdef inline int _finalize_frame(self):
 */
    __pyx_r = -1;
    goto __pyx_L0;
    break;
  }

  /* "pysdif/_pysdif.pyx":1772
 *         return False if error else True
 * 
 *     cdef int _frame_skip_rest(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skipts the rest of the frame, so that a new frame can be read.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile._frame_skip_rest", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1790
 *             return -1
 * 
 *     cdef inline int _finalize_frame(self):             # <<<<<<<<<<<<<<
 *         logger.debug("_finalize_frame")
 *         cdef int status = self.frame_status
 */

static CYTHON_INLINE int __pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  enum __pyx_t_6pysdif_7_pysdif_FrameStatusE __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_finalize_frame", 0);

  /* "pysdif/_pysdif.pyx":1791
 * 
 *     cdef inline int _finalize_frame(self):
 *         logger.debug("_finalize_frame")             # <<<<<<<<<<<<<<
 *         cdef int status = self.frame_status
 *         if self.frame_status == eFrameSignatureRead:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_n_s_finalize_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_finalize_frame);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1792
 *     cdef inline int _finalize_frame(self):
 *         logger.debug("_finalize_frame")
 *         cdef int status = self.frame_status             # <<<<<<<<<<<<<<
 *         if self.frame_status == eFrameSignatureRead:
 *             logger.debug("_finalize_frame called, but header was not even read")
 */
  __pyx_t_4 = __pyx_v_self->frame_status;
  __pyx_v_status = __pyx_t_4;

  /* "pysdif/_pysdif.pyx":1793
 *         logger.debug("_finalize_frame")
 *         cdef int status = self.frame_status
 *         if self.frame_status == eFrameSignatureRead:             # <<<<<<<<<<<<<<
 *             logger.debug("_finalize_frame called, but header was not even read")
 *             return -1
 */
  __pyx_t_5 = ((__pyx_v_self->frame_status == __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead) != 0);
  if (__pyx_t_5) {

    /* "pysdif/_pysdif.pyx":1794
 *         cdef int status = self.frame_status
 *         if self.frame_status == eFrameSignatureRead:
 *             logger.debug("_finalize_frame called, but header was not even read")             # <<<<<<<<<<<<<<
 *             return -1
 *         elif status == eFrameSomeDataRead or status == eFrameHeaderRead:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_finalize_frame_called_but_heade) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_finalize_frame_called_but_heade);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":1795
 *         if self.frame_status == eFrameSignatureRead:
 *             logger.debug("_finalize_frame called, but header was not even read")
 *             return -1             # <<<<<<<<<<<<<<
 *         elif status == eFrameSomeDataRead or status == eFrameHeaderRead:
 *             logger.debug("_finalize_frame without having read everything")
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1793
 *         logger.debug("_finalize_frame")
 *         cdef int status = self.frame_status
 *         if self.frame_status == eFrameSignatureRead:             # <<<<<<<<<<<<<<
 *             logger.debug("_finalize_frame called, but header was not even read")
 *             return -1
 */
  }

  /* "pysdif/_pysdif.pyx":1796
 *             logger.debug("_finalize_frame called, but header was not even read")
 *             return -1
 *         elif status == eFrameSomeDataRead or status == eFrameHeaderRead:             # <<<<<<<<<<<<<<
 *             logger.debug("_finalize_frame without having read everything")
 *             return -1
 */
  switch (__pyx_v_status) {
    case __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead:
    case __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead:
    __pyx_t_5 = 1;
    break;
    default:
    __pyx_t_5 = 0;
    break;
  }
  if (__pyx_t_5) {

    /* "pysdif/_pysdif.pyx":1797
 *             return -1
 *         elif status == eFrameSomeDataRead or status == eFrameHeaderRead:
 *             logger.debug("_finalize_frame without having read everything")             # <<<<<<<<<<<<<<
 *             return -1
 *         # self.matrix_idx = 0
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s_finalize_frame_without_having_r) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_finalize_frame_without_having_r);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":1798
 *         elif status == eFrameSomeDataRead or status == eFrameHeaderRead:
 *             logger.debug("_finalize_frame without having read everything")
 *             return -1             # <<<<<<<<<<<<<<
 *         # self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1796
 *             logger.debug("_finalize_frame called, but header was not even read")
 *             return -1
 *         elif status == eFrameSomeDataRead or status == eFrameHeaderRead:             # <<<<<<<<<<<<<<
 *             logger.debug("_finalize_frame without having read everything")
 *             return -1
 */
  }

  /* "pysdif/_pysdif.pyx":1800
 *             return -1
 *         # self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead             # <<<<<<<<<<<<<<
 *         self._read_signature()
 *         return 0
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead;

  /* "pysdif/_pysdif.pyx":1801
 *         # self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 *         self._read_signature()             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  (void)(((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->_read_signature(__pyx_v_self, 0));

  /* "pysdif/_pysdif.pyx":1802
 *         self.matrix_status = eMatrixNothingRead
 *         self._read_signature()
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def next_matrix(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1790
 *             return -1
 * 
 *     cdef inline int _finalize_frame(self):             # <<<<<<<<<<<<<<
 *         logger.debug("_finalize_frame")
 *         cdef int status = self.frame_status
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile._finalize_frame", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1804
 *         return 0
 * 
 *     def next_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the next matrix header and return a Matrix with its data **still not read**.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_69next_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_68next_matrix[] = "SdifFile.next_matrix(self)\n\n        Read the next matrix header and return a Matrix with its data **still not read**. \n\n        If the previous matrix was not read fully, its data is skipped. This is the\n        same as calling `next(frame)`\n\n        Returns:\n            (Matrix|None) The next Matrix or None if no more matrices available\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_69next_matrix = {"next_matrix", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_69next_matrix, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_68next_matrix};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_69next_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next_matrix (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_68next_matrix(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_68next_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_matrix_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next_matrix", 0);

  /* "pysdif/_pysdif.pyx":1814
 *             (Matrix|None) The next Matrix or None if no more matrices available
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("no current frame")
 *         cdef int matrix_status = self.matrix_status
 */
  __pyx_t_1 = ((__pyx_v_self->this->CurrFramH == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1815
 *         """
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("no current frame")             # <<<<<<<<<<<<<<
 *         cdef int matrix_status = self.matrix_status
 *         if matrix_status == eMatrixHeaderRead:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_no_current_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_no_current_frame);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1815, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1814
 *             (Matrix|None) The next Matrix or None if no more matrices available
 *         """
 *         if self.this.CurrFramH == NULL:             # <<<<<<<<<<<<<<
 *             raise NoFrame("no current frame")
 *         cdef int matrix_status = self.matrix_status
 */
  }

  /* "pysdif/_pysdif.pyx":1816
 *         if self.this.CurrFramH == NULL:
 *             raise NoFrame("no current frame")
 *         cdef int matrix_status = self.matrix_status             # <<<<<<<<<<<<<<
 *         if matrix_status == eMatrixHeaderRead:
 *             # SdifFSkipMatrixData(self.this)
 */
  __pyx_t_5 = __pyx_v_self->matrix_status;
  __pyx_v_matrix_status = __pyx_t_5;

  /* "pysdif/_pysdif.pyx":1817
 *             raise NoFrame("no current frame")
 *         cdef int matrix_status = self.matrix_status
 *         if matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             # SdifFSkipMatrixData(self.this)
 *             self.matrix_skip_data()
 */
  __pyx_t_1 = ((__pyx_v_matrix_status == __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1819
 *         if matrix_status == eMatrixHeaderRead:
 *             # SdifFSkipMatrixData(self.this)
 *             self.matrix_skip_data()             # <<<<<<<<<<<<<<
 *         elif matrix_status != eMatrixNothingRead:
 *             raise SdifOrderError("Some data of the matrix has been read (%s)" % matrixstatus2str(matrix_status))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix_skip_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":1817
 *             raise NoFrame("no current frame")
 *         cdef int matrix_status = self.matrix_status
 *         if matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             # SdifFSkipMatrixData(self.this)
 *             self.matrix_skip_data()
 */
    goto __pyx_L4;
  }

  /* "pysdif/_pysdif.pyx":1820
 *             # SdifFSkipMatrixData(self.this)
 *             self.matrix_skip_data()
 *         elif matrix_status != eMatrixNothingRead:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Some data of the matrix has been read (%s)" % matrixstatus2str(matrix_status))
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 */
  __pyx_t_1 = ((__pyx_v_matrix_status != __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1821
 *             self.matrix_skip_data()
 *         elif matrix_status != eMatrixNothingRead:
 *             raise SdifOrderError("Some data of the matrix has been read (%s)" % matrixstatus2str(matrix_status))             # <<<<<<<<<<<<<<
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             return None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SdifOrderError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_matrixstatus2str); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_matrix_status); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Some_data_of_the_matrix_has_been, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1821, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1820
 *             # SdifFSkipMatrixData(self.this)
 *             self.matrix_skip_data()
 *         elif matrix_status != eMatrixNothingRead:             # <<<<<<<<<<<<<<
 *             raise SdifOrderError("Some data of the matrix has been read (%s)" % matrixstatus2str(matrix_status))
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 */
  }
  __pyx_L4:;

  /* "pysdif/_pysdif.pyx":1822
 *         elif matrix_status != eMatrixNothingRead:
 *             raise SdifOrderError("Some data of the matrix has been read (%s)" % matrixstatus2str(matrix_status))
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             return None
 *         if not self.matrix_read_header():
 */
  __pyx_t_1 = ((__pyx_v_self->matrix_idx >= __pyx_v_self->this->CurrFramH->NbMatrix) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1823
 *             raise SdifOrderError("Some data of the matrix has been read (%s)" % matrixstatus2str(matrix_status))
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             return None             # <<<<<<<<<<<<<<
 *         if not self.matrix_read_header():
 *             raise IOError("Could not read matrix header. ")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":1822
 *         elif matrix_status != eMatrixNothingRead:
 *             raise SdifOrderError("Some data of the matrix has been read (%s)" % matrixstatus2str(matrix_status))
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             return None
 *         if not self.matrix_read_header():
 */
  }

  /* "pysdif/_pysdif.pyx":1824
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             return None
 *         if not self.matrix_read_header():             # <<<<<<<<<<<<<<
 *             raise IOError("Could not read matrix header. ")
 *         return self.matrix
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix_read_header); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_9)) {

    /* "pysdif/_pysdif.pyx":1825
 *             return None
 *         if not self.matrix_read_header():
 *             raise IOError("Could not read matrix header. ")             # <<<<<<<<<<<<<<
 *         return self.matrix
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1825, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1824
 *         if self.matrix_idx >= self.this.CurrFramH.NbMatrix:
 *             return None
 *         if not self.matrix_read_header():             # <<<<<<<<<<<<<<
 *             raise IOError("Could not read matrix header. ")
 *         return self.matrix
 */
  }

  /* "pysdif/_pysdif.pyx":1826
 *         if not self.matrix_read_header():
 *             raise IOError("Could not read matrix header. ")
 *         return self.matrix             # <<<<<<<<<<<<<<
 * 
 *     def rewind(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->matrix));
  __pyx_r = ((PyObject *)__pyx_v_self->matrix);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1804
 *         return 0
 * 
 *     def next_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the next matrix header and return a Matrix with its data **still not read**.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.next_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1828
 *         return self.matrix
 * 
 *     def rewind(self):             # <<<<<<<<<<<<<<
 *         """
 *         Rewind the SdifFile.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_71rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_70rewind[] = "SdifFile.rewind(self)\n\n        Rewind the SdifFile. \n\n        After this function is called, the file is in its starting frame \n        (as if the file had been just open)\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_71rewind = {"rewind", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_71rewind, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_70rewind};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_71rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rewind (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_70rewind(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_70rewind(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rewind", 0);

  /* "pysdif/_pysdif.pyx":1835
 *         (as if the file had been just open)
 *         """
 *         SdifFRewind(self.this)             # <<<<<<<<<<<<<<
 *         self.reinit()
 * 
 */
  (void)(SdifFRewind(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":1836
 *         """
 *         SdifFRewind(self.this)
 *         self.reinit()             # <<<<<<<<<<<<<<
 * 
 *     def _rewind(self):
 */
  ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->reinit(__pyx_v_self);

  /* "pysdif/_pysdif.pyx":1828
 *         return self.matrix
 * 
 *     def rewind(self):             # <<<<<<<<<<<<<<
 *         """
 *         Rewind the SdifFile.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1838
 *         self.reinit()
 * 
 *     def _rewind(self):             # <<<<<<<<<<<<<<
 *         SdifFRewind(self.this)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_73_rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_72_rewind[] = "SdifFile._rewind(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_73_rewind = {"_rewind", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_73_rewind, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_72_rewind};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_73_rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_rewind (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_72_rewind(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_72_rewind(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_rewind", 0);

  /* "pysdif/_pysdif.pyx":1839
 * 
 *     def _rewind(self):
 *         SdifFRewind(self.this)             # <<<<<<<<<<<<<<
 * 
 *     cdef void reinit(self):
 */
  (void)(SdifFRewind(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":1838
 *         self.reinit()
 * 
 *     def _rewind(self):             # <<<<<<<<<<<<<<
 *         SdifFRewind(self.this)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1841
 *         SdifFRewind(self.this)
 * 
 *     cdef void reinit(self):             # <<<<<<<<<<<<<<
 *         if self.mode == 'r' or self.mode == 'rw':
 *             self.init_read()
 */

static void __pyx_f_6pysdif_7_pysdif_8SdifFile_reinit(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reinit", 0);

  /* "pysdif/_pysdif.pyx":1842
 * 
 *     cdef void reinit(self):
 *         if self.mode == 'r' or self.mode == 'rw':             # <<<<<<<<<<<<<<
 *             self.init_read()
 *         if self.mode == 'w':
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1842, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_rw, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1842, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1843
 *     cdef void reinit(self):
 *         if self.mode == 'r' or self.mode == 'rw':
 *             self.init_read()             # <<<<<<<<<<<<<<
 *         if self.mode == 'w':
 *             self.init_write()
 */
    ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->init_read(__pyx_v_self);

    /* "pysdif/_pysdif.pyx":1842
 * 
 *     cdef void reinit(self):
 *         if self.mode == 'r' or self.mode == 'rw':             # <<<<<<<<<<<<<<
 *             self.init_read()
 *         if self.mode == 'w':
 */
  }

  /* "pysdif/_pysdif.pyx":1844
 *         if self.mode == 'r' or self.mode == 'rw':
 *             self.init_read()
 *         if self.mode == 'w':             # <<<<<<<<<<<<<<
 *             self.init_write()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1844, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":1845
 *             self.init_read()
 *         if self.mode == 'w':
 *             self.init_write()             # <<<<<<<<<<<<<<
 * 
 *     def _read_padding(self):
 */
    ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->init_write(__pyx_v_self);

    /* "pysdif/_pysdif.pyx":1844
 *         if self.mode == 'r' or self.mode == 'rw':
 *             self.init_read()
 *         if self.mode == 'w':             # <<<<<<<<<<<<<<
 *             self.init_write()
 * 
 */
  }

  /* "pysdif/_pysdif.pyx":1841
 *         SdifFRewind(self.this)
 * 
 *     cdef void reinit(self):             # <<<<<<<<<<<<<<
 *         if self.mode == 'r' or self.mode == 'rw':
 *             self.init_read()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile.reinit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysdif/_pysdif.pyx":1847
 *             self.init_write()
 * 
 *     def _read_padding(self):             # <<<<<<<<<<<<<<
 *         return SdifFReadPadding(self.this, SdifFPaddingCalculate(self.this.Stream, self.this.Pos))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_75_read_padding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_74_read_padding[] = "SdifFile._read_padding(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_75_read_padding = {"_read_padding", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_75_read_padding, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_74_read_padding};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_75_read_padding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_padding (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_74_read_padding(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_74_read_padding(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_padding", 0);

  /* "pysdif/_pysdif.pyx":1848
 * 
 *     def _read_padding(self):
 *         return SdifFReadPadding(self.this, SdifFPaddingCalculate(self.this.Stream, self.this.Pos))             # <<<<<<<<<<<<<<
 * 
 *     # ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(SdifFReadPadding(__pyx_v_self->this, SdifFPaddingCalculate(__pyx_v_self->this->Stream, __pyx_v_self->this->Pos))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":1847
 *             self.init_write()
 * 
 *     def _read_padding(self):             # <<<<<<<<<<<<<<
 *         return SdifFReadPadding(self.this, SdifFPaddingCalculate(self.this.Stream, self.this.Pos))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile._read_padding", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1854
 *     # ------------------------------------------------
 * 
 *     def add_NVT(self, dict d):             # <<<<<<<<<<<<<<
 *         """
 *         The NVT (Name Value Table) is a place to put metadata about the file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_77add_NVT(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_76add_NVT[] = "SdifFile.add_NVT(self, dict d)\n\n        The NVT (Name Value Table) is a place to put metadata about the file.\n        \n        The NVT is a hash table (key: value) where both key and value are a bytes \n        string.\n\n        Args:\n            d (dict): A python dictionary which is translated to a NVT \n        \n        ## Example\n\n        ```python\n\n        import pysdif\n        f = pysdif.SdifFile(\"foo.sdif\", \"w\")\n        f.add_NVT({'Author': 'pysdif3', 'SampleRate': '44100'})\n        \n        ```\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_77add_NVT = {"add_NVT", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_77add_NVT, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_76add_NVT};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_77add_NVT(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_NVT (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_d), (&PyDict_Type), 1, "d", 1))) __PYX_ERR(0, 1854, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_76add_NVT(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), ((PyObject*)__pyx_v_d));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_76add_NVT(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_d) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  const char* __pyx_t_11;
  const char* __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_NVT", 0);

  /* "pysdif/_pysdif.pyx":1874
 *         ```
 *         """
 *         SdifNameValuesLNewTable(self.this.NameValues, _SdifNVTStreamID)             # <<<<<<<<<<<<<<
 *         for name, value in d.iteritems():
 *             if not isinstance(name, (str, bytes)):
 */
  (void)(SdifNameValuesLNewTable(__pyx_v_self->this->NameValues, 0xFFFFFFFD));

  /* "pysdif/_pysdif.pyx":1875
 *         """
 *         SdifNameValuesLNewTable(self.this.NameValues, _SdifNVTStreamID)
 *         for name, value in d.iteritems():             # <<<<<<<<<<<<<<
 *             if not isinstance(name, (str, bytes)):
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (name, type(name)))
 */
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_d == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(0, 1875, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pysdif/_pysdif.pyx":1876
 *         SdifNameValuesLNewTable(self.this.NameValues, _SdifNVTStreamID)
 *         for name, value in d.iteritems():
 *             if not isinstance(name, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (name, type(name)))
 *             if not isinstance(value, (str, bytes)):
 */
    __pyx_t_9 = PyString_Check(__pyx_v_name); 
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_8 = __pyx_t_10;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_10 = PyBytes_Check(__pyx_v_name); 
    __pyx_t_9 = (__pyx_t_10 != 0);
    __pyx_t_8 = __pyx_t_9;
    __pyx_L6_bool_binop_done:;
    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
    if (unlikely(__pyx_t_9)) {

      /* "pysdif/_pysdif.pyx":1877
 *         for name, value in d.iteritems():
 *             if not isinstance(name, (str, bytes)):
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (name, type(name)))             # <<<<<<<<<<<<<<
 *             if not isinstance(value, (str, bytes)):
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (value, type(value)))
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_name);
      __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_name)));
      __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_name)));
      PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)Py_TYPE(__pyx_v_name)));
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Only_strings_or_bytestrings_are, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(0, 1877, __pyx_L1_error)

      /* "pysdif/_pysdif.pyx":1876
 *         SdifNameValuesLNewTable(self.this.NameValues, _SdifNVTStreamID)
 *         for name, value in d.iteritems():
 *             if not isinstance(name, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (name, type(name)))
 *             if not isinstance(value, (str, bytes)):
 */
    }

    /* "pysdif/_pysdif.pyx":1878
 *             if not isinstance(name, (str, bytes)):
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (name, type(name)))
 *             if not isinstance(value, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (value, type(value)))
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, asbytes(name), asbytes(value))
 */
    __pyx_t_8 = PyString_Check(__pyx_v_value); 
    __pyx_t_10 = (__pyx_t_8 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_9 = __pyx_t_10;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_10 = PyBytes_Check(__pyx_v_value); 
    __pyx_t_8 = (__pyx_t_10 != 0);
    __pyx_t_9 = __pyx_t_8;
    __pyx_L9_bool_binop_done:;
    __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0);
    if (unlikely(__pyx_t_8)) {

      /* "pysdif/_pysdif.pyx":1879
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (name, type(name)))
 *             if not isinstance(value, (str, bytes)):
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (value, type(value)))             # <<<<<<<<<<<<<<
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, asbytes(name), asbytes(value))
 * 
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_value);
      __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value)));
      __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_value)));
      PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)Py_TYPE(__pyx_v_value)));
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Only_strings_or_bytestrings_are, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(0, 1879, __pyx_L1_error)

      /* "pysdif/_pysdif.pyx":1878
 *             if not isinstance(name, (str, bytes)):
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (name, type(name)))
 *             if not isinstance(value, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (value, type(value)))
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, asbytes(name), asbytes(value))
 */
    }

    /* "pysdif/_pysdif.pyx":1880
 *             if not isinstance(value, (str, bytes)):
 *                 raise TypeError("Only strings or bytestrings are allowed, but found %s of type %s" % (value, type(value)))
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, asbytes(name), asbytes(value))             # <<<<<<<<<<<<<<
 * 
 *     def add_matrix_type(self, signature, column_names):
 */
    __pyx_t_6 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(__pyx_t_6 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
      __PYX_ERR(0, 1880, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_6); if (unlikely((__pyx_t_11 == ((const char*)NULL)) && PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__pyx_t_5 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
      __PYX_ERR(0, 1880, __pyx_L1_error)
    }
    __pyx_t_12 = __Pyx_PyBytes_AsWritableString(__pyx_t_5); if (unlikely((__pyx_t_12 == ((const char*)NULL)) && PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L1_error)
    (void)(SdifNameValuesLPutCurrNVT(__pyx_v_self->this->NameValues, __pyx_t_11, __pyx_t_12));
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1854
 *     # ------------------------------------------------
 * 
 *     def add_NVT(self, dict d):             # <<<<<<<<<<<<<<
 *         """
 *         The NVT (Name Value Table) is a place to put metadata about the file.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_NVT", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1882
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, asbytes(name), asbytes(value))
 * 
 *     def add_matrix_type(self, signature, column_names):             # <<<<<<<<<<<<<<
 *         """
 *         Adds a matrix type to this Sdif
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_79add_matrix_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_78add_matrix_type[] = "SdifFile.add_matrix_type(self, signature, column_names)\n\n        Adds a matrix type to this Sdif\n\n        Args:\n            signature (str): The signature as 4-byte string\n            column_names (list[str]): The names of the columns of this matrix\n\n        There are two possible formats for the column names:\n            \n        * `sdiff.add_matrix_type(\"1ABC\", \"Column1, Column2\")` or\n        * `sdiff.add_matrix_type(\"1ABC\", [\"Column1\", \"Column2\"])`\n        \n        See also: add_frame_type\n        \n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_79add_matrix_type = {"add_matrix_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_79add_matrix_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_78add_matrix_type};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_79add_matrix_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_column_names = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_matrix_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signature,&__pyx_n_s_column_names,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signature)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column_names)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_matrix_type", 1, 2, 2, 1); __PYX_ERR(0, 1882, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_matrix_type") < 0)) __PYX_ERR(0, 1882, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_signature = values[0];
    __pyx_v_column_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_matrix_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1882, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_matrix_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_78add_matrix_type(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_signature, __pyx_v_column_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_78add_matrix_type(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_column_names) {
  CYTHON_UNUSED PyObject *__pyx_v_sig = NULL;
  SdifMatrixTypeT *__pyx_v_mt;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_matrix_type", 0);
  __Pyx_INCREF(__pyx_v_column_names);

  /* "pysdif/_pysdif.pyx":1898
 * 
 *         """
 *         sig = asbytes(signature)             # <<<<<<<<<<<<<<
 *         if isinstance(column_names, (str, bytes)):
 *             column_names = asbytes(column_names).replace(b",", b" ").split()
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sig = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1899
 *         """
 *         sig = asbytes(signature)
 *         if isinstance(column_names, (str, bytes)):             # <<<<<<<<<<<<<<
 *             column_names = asbytes(column_names).replace(b",", b" ").split()
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 */
  __pyx_t_3 = PyString_Check(__pyx_v_column_names); 
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = PyBytes_Check(__pyx_v_column_names); 
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pysdif/_pysdif.pyx":1900
 *         sig = asbytes(signature)
 *         if isinstance(column_names, (str, bytes)):
 *             column_names = asbytes(column_names).replace(b",", b" ").split()             # <<<<<<<<<<<<<<
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 *         if mt == NULL:
 */
    __pyx_t_5 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_column_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_column_names, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":1899
 *         """
 *         sig = asbytes(signature)
 *         if isinstance(column_names, (str, bytes)):             # <<<<<<<<<<<<<<
 *             column_names = asbytes(column_names).replace(b",", b" ").split()
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 */
  }

  /* "pysdif/_pysdif.pyx":1901
 *         if isinstance(column_names, (str, bytes)):
 *             column_names = asbytes(column_names).replace(b",", b" ").split()
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)             # <<<<<<<<<<<<<<
 *         if mt == NULL:
 *             raise RuntimeError("Could not create matrixtype")
 */
  __pyx_v_mt = __pyx_f_6pysdif_7_pysdif_MatrixType_create(__pyx_v_signature, __pyx_v_column_names);

  /* "pysdif/_pysdif.pyx":1902
 *             column_names = asbytes(column_names).replace(b",", b" ").split()
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 *         if mt == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Could not create matrixtype")
 *         SdifPutMatrixType(self.this.MatrixTypesTable, mt)
 */
  __pyx_t_3 = ((__pyx_v_mt == NULL) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pysdif/_pysdif.pyx":1903
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 *         if mt == NULL:
 *             raise RuntimeError("Could not create matrixtype")             # <<<<<<<<<<<<<<
 *         SdifPutMatrixType(self.this.MatrixTypesTable, mt)
 *         # TODO: is this a memory leak? who destroys the MatrixType?
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1903, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1902
 *             column_names = asbytes(column_names).replace(b",", b" ").split()
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 *         if mt == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Could not create matrixtype")
 *         SdifPutMatrixType(self.this.MatrixTypesTable, mt)
 */
  }

  /* "pysdif/_pysdif.pyx":1904
 *         if mt == NULL:
 *             raise RuntimeError("Could not create matrixtype")
 *         SdifPutMatrixType(self.this.MatrixTypesTable, mt)             # <<<<<<<<<<<<<<
 *         # TODO: is this a memory leak? who destroys the MatrixType?
 *         #self.frame_status = eFrameInvalid
 */
  SdifPutMatrixType(__pyx_v_self->this->MatrixTypesTable, __pyx_v_mt);

  /* "pysdif/_pysdif.pyx":1882
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, asbytes(name), asbytes(value))
 * 
 *     def add_matrix_type(self, signature, column_names):             # <<<<<<<<<<<<<<
 *         """
 *         Adds a matrix type to this Sdif
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_matrix_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XDECREF(__pyx_v_column_names);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1908
 *         #self.frame_status = eFrameInvalid
 * 
 *     def add_frame_type(self, signature, list components):             # <<<<<<<<<<<<<<
 *         """
 *         Adds a frame type to this sdif.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_81add_frame_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_80add_frame_type[] = "SdifFile.add_frame_type(self, signature, list components)\n\n        Adds a frame type to this sdif. \n\n        A frame is defined by a signature and a list of possible matrices. \n\n        Args:\n            signature (str):A 4-char string\n            components (list[str]): A list of components, where each component is a string\n                of the sort `\"{Signature} {Name}\"`, like `[\"1NEW NewMatrix\", \"1FQ0 New1FQ0\"]`    \n\n        A frame type defines which matrix types are allowed in it.\n        The matrices mentioned in the frame type MUST be defined\n        via `add_matrix_type`.\n\n        !!! note\n\n            A frame can have multiple matrices in it, so when defining\n            a frame-type, you need to pass a sequence of possible\n            matrices.\n\n        \n        ## Example\n\n        Add a new frame type 1NEW, with a 1NEW matrix type\n        \n        ```python\n\n        sdiffile.add_frame_type(\"1NEW\", [\"1NEW NewMatrix\"])\n        sdiffile.add_matrix_type(\"1NEW\", \"Column1, Column2\")\n        \n        ```\n\n        **See also**: `add_matrix_type`\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_81add_frame_type = {"add_frame_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_81add_frame_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_80add_frame_type};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_81add_frame_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_components = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_frame_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signature,&__pyx_n_s_components,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signature)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_frame_type", 1, 2, 2, 1); __PYX_ERR(0, 1908, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_frame_type") < 0)) __PYX_ERR(0, 1908, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_signature = values[0];
    __pyx_v_components = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_frame_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1908, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_frame_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_components), (&PyList_Type), 1, "components", 1))) __PYX_ERR(0, 1908, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_80add_frame_type(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_signature, __pyx_v_components);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_80add_frame_type(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_components) {
  SdifFrameTypeT *__pyx_v_ft;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_frame_type", 0);

  /* "pysdif/_pysdif.pyx":1943
 *         **See also**: `add_matrix_type`
 *         """
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)             # <<<<<<<<<<<<<<
 *         if ft == NULL:
 *             raise RuntimeError("Could not create frametype")
 */
  __pyx_v_ft = __pyx_f_6pysdif_7_pysdif_FrameType_create(__pyx_v_signature, __pyx_v_components);

  /* "pysdif/_pysdif.pyx":1944
 *         """
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)
 *         if ft == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Could not create frametype")
 *         SdifPutFrameType(self.this.FrameTypesTable, ft)
 */
  __pyx_t_1 = ((__pyx_v_ft == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pysdif/_pysdif.pyx":1945
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)
 *         if ft == NULL:
 *             raise RuntimeError("Could not create frametype")             # <<<<<<<<<<<<<<
 *         SdifPutFrameType(self.this.FrameTypesTable, ft)
 *         # TODO: is this a memory leak? who destroys the FrameType?
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1945, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1944
 *         """
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)
 *         if ft == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Could not create frametype")
 *         SdifPutFrameType(self.this.FrameTypesTable, ft)
 */
  }

  /* "pysdif/_pysdif.pyx":1946
 *         if ft == NULL:
 *             raise RuntimeError("Could not create frametype")
 *         SdifPutFrameType(self.this.FrameTypesTable, ft)             # <<<<<<<<<<<<<<
 *         # TODO: is this a memory leak? who destroys the FrameType?
 * 
 */
  SdifPutFrameType(__pyx_v_self->this->FrameTypesTable, __pyx_v_ft);

  /* "pysdif/_pysdif.pyx":1908
 *         #self.frame_status = eFrameInvalid
 * 
 *     def add_frame_type(self, signature, list components):             # <<<<<<<<<<<<<<
 *         """
 *         Adds a frame type to this sdif.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_frame_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1949
 *         # TODO: is this a memory leak? who destroys the FrameType?
 * 
 *     def clone_type_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_83clone_type_definitions(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_82clone_type_definitions[] = "SdifFile.clone_type_definitions(self, SdifFile source)\n\n        \n        Clone the frame and matrix type definitions of source_sdiffile\n        \n        !!! note\n\n            Only for writing mode. This function must be called before \n            any frame has been written\n\n        Args:\n            source (SdifFile): The sourc file to clone type definitions from\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_83clone_type_definitions = {"clone_type_definitions", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_83clone_type_definitions, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_82clone_type_definitions};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_83clone_type_definitions(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone_type_definitions (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) __PYX_ERR(0, 1949, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_82clone_type_definitions(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_source));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_82clone_type_definitions(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source) {
  PyObject *__pyx_v_frametypes = NULL;
  PyObject *__pyx_v_matrixtypes = NULL;
  PyObject *__pyx_v_frametype = NULL;
  PyObject *__pyx_v_matrixtype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone_type_definitions", 0);

  /* "pysdif/_pysdif.pyx":1962
 *             source (SdifFile): The sourc file to clone type definitions from
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         frametypes = source.get_frame_types()
 */
  switch (__pyx_v_self->this->Mode) {
    case eWriteFile:
    case eReadWriteFile:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pysdif/_pysdif.pyx":1963
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")             # <<<<<<<<<<<<<<
 *         frametypes = source.get_frame_types()
 *         matrixtypes = source.get_matrix_types()
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1963, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":1962
 *             source (SdifFile): The sourc file to clone type definitions from
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         frametypes = source.get_frame_types()
 */
  }

  /* "pysdif/_pysdif.pyx":1964
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         frametypes = source.get_frame_types()             # <<<<<<<<<<<<<<
 *         matrixtypes = source.get_matrix_types()
 *         for frametype in frametypes:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_get_frame_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_frametypes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":1965
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         frametypes = source.get_frame_types()
 *         matrixtypes = source.get_matrix_types()             # <<<<<<<<<<<<<<
 *         for frametype in frametypes:
 *             self.add_frame_type(frametype.signature, frametype.components)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_get_matrix_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_matrixtypes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":1966
 *         frametypes = source.get_frame_types()
 *         matrixtypes = source.get_matrix_types()
 *         for frametype in frametypes:             # <<<<<<<<<<<<<<
 *             self.add_frame_type(frametype.signature, frametype.components)
 *         for matrixtype in matrixtypes:
 */
  if (likely(PyList_CheckExact(__pyx_v_frametypes)) || PyTuple_CheckExact(__pyx_v_frametypes)) {
    __pyx_t_3 = __pyx_v_frametypes; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_frametypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1966, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1966, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1966, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1966, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1966, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1966, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_frametype, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":1967
 *         matrixtypes = source.get_matrix_types()
 *         for frametype in frametypes:
 *             self.add_frame_type(frametype.signature, frametype.components)             # <<<<<<<<<<<<<<
 *         for matrixtype in matrixtypes:
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_frame_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_frametype, __pyx_n_s_signature); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_frametype, __pyx_n_s_components); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1967, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1967, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1967, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9);
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1967, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":1966
 *         frametypes = source.get_frame_types()
 *         matrixtypes = source.get_matrix_types()
 *         for frametype in frametypes:             # <<<<<<<<<<<<<<
 *             self.add_frame_type(frametype.signature, frametype.components)
 *         for matrixtype in matrixtypes:
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":1968
 *         for frametype in frametypes:
 *             self.add_frame_type(frametype.signature, frametype.components)
 *         for matrixtype in matrixtypes:             # <<<<<<<<<<<<<<
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_matrixtypes)) || PyTuple_CheckExact(__pyx_v_matrixtypes)) {
    __pyx_t_3 = __pyx_v_matrixtypes; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_matrixtypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1968, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1968, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1968, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1968, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_matrixtype, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":1969
 *             self.add_frame_type(frametype.signature, frametype.components)
 *         for matrixtype in matrixtypes:
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)             # <<<<<<<<<<<<<<
 * 
 *     def clone_NVTs(self, SdifFile source):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_matrix_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_matrixtype, __pyx_n_s_signature); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_matrixtype, __pyx_n_s_column_names); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1969, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1969, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1969, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_t_9);
      __pyx_t_12 = 0;
      __pyx_t_9 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1969, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":1968
 *         for frametype in frametypes:
 *             self.add_frame_type(frametype.signature, frametype.components)
 *         for matrixtype in matrixtypes:             # <<<<<<<<<<<<<<
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":1949
 *         # TODO: is this a memory leak? who destroys the FrameType?
 * 
 *     def clone_type_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_type_definitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_frametypes);
  __Pyx_XDECREF(__pyx_v_matrixtypes);
  __Pyx_XDECREF(__pyx_v_frametype);
  __Pyx_XDECREF(__pyx_v_matrixtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1971
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 * 
 *     def clone_NVTs(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         Clone the NVT (name:value table) from source (an open SdifFile)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_85clone_NVTs(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_84clone_NVTs[] = "SdifFile.clone_NVTs(self, SdifFile source)\n\n        Clone the NVT (name:value table) from source (an open SdifFile)\n        \n        !!! note\n\n            Only for writing mode. If you do not plan to midify the type \n            definitions included in the source file, it's better to call \n            `clone_definitions`, which clones everything but the data\n            (see example)\n\n        Args:\n            source (SdifFile): The source SdifFile to clone the NVTs from\n        \n        ## Example\n\n        ```python    \n        source_sdif = SdifFile(\"in.sdif\")\n        new_sdif = SdifFile(\"out.sdif\", \"w\")\n        new_sdif.clone_definitions(source_sdif)\n        for frame in old_sdif:\n            new_frame = new_sdif.new_frame(frame.signature, frame.time)\n            # ... etc ...\n\n        ```\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_85clone_NVTs = {"clone_NVTs", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_85clone_NVTs, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_84clone_NVTs};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_85clone_NVTs(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone_NVTs (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) __PYX_ERR(0, 1971, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_84clone_NVTs(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_source));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_84clone_NVTs(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source) {
  PyObject *__pyx_v_nvt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone_NVTs", 0);

  /* "pysdif/_pysdif.pyx":1997
 *         ```
 *         """
 *         for nvt in source.get_NVTs():             # <<<<<<<<<<<<<<
 *             self.add_NVT(nvt)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_get_NVTs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1997, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1997, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1997, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1997, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_nvt, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":1998
 *         """
 *         for nvt in source.get_NVTs():
 *             self.add_NVT(nvt)             # <<<<<<<<<<<<<<
 * 
 *     def clone_definitions(self, SdifFile source):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_NVT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_nvt) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_nvt);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pysdif/_pysdif.pyx":1997
 *         ```
 *         """
 *         for nvt in source.get_NVTs():             # <<<<<<<<<<<<<<
 *             self.add_NVT(nvt)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":1971
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 * 
 *     def clone_NVTs(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         Clone the NVT (name:value table) from source (an open SdifFile)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_NVTs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nvt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2000
 *             self.add_NVT(nvt)
 * 
 *     def clone_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         Only for writing mode - Clone both NVT(s), frame and matrix definitions
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_87clone_definitions(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_86clone_definitions[] = "SdifFile.clone_definitions(self, SdifFile source)\n\n        Only for writing mode - Clone both NVT(s), frame and matrix definitions \n\n        Clone NVT, frame and matrix definitions from source, so after calling \n        this function you can start creating frames\n\n        Args:\n            source (SdifFile): The sdiffile to clone definitions from\n        \n        ## Example\n\n        ```python\n\n        infile = SdifFile(\"myfile.sdif\")\n        outfile = SdifFile(\"outfile.sdif\", \"w\")\n        outfile.clone_definitions(infile)\n        for inframe in infile:\n            with outfile.new_frame(inframe.signature) as outframe:\n                matrixsig, data = inframe.get_one_matrix_data()\n                outframe.add_matrix(matrixsig, data)\n        \n        ```\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_87clone_definitions = {"clone_definitions", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_87clone_definitions, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_86clone_definitions};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_87clone_definitions(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone_definitions (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) __PYX_ERR(0, 2000, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_86clone_definitions(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_source));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_86clone_definitions(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone_definitions", 0);

  /* "pysdif/_pysdif.pyx":2024
 *         ```
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         self.clone_NVTs(source)
 */
  switch (__pyx_v_self->this->Mode) {
    case eWriteFile:
    case eReadWriteFile:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pysdif/_pysdif.pyx":2025
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")             # <<<<<<<<<<<<<<
 *         self.clone_NVTs(source)
 *         self.clone_type_definitions(source)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2025, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":2024
 *         ```
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         self.clone_NVTs(source)
 */
  }

  /* "pysdif/_pysdif.pyx":2026
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         self.clone_NVTs(source)             # <<<<<<<<<<<<<<
 *         self.clone_type_definitions(source)
 *         return self
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clone_NVTs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_source)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_source));
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":2027
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         self.clone_NVTs(source)
 *         self.clone_type_definitions(source)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clone_type_definitions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_source)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_source));
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":2028
 *         self.clone_NVTs(source)
 *         self.clone_type_definitions(source)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def clone_frames(self, SdifFile source, signatures_to_clone=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":2000
 *             self.add_NVT(nvt)
 * 
 *     def clone_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         Only for writing mode - Clone both NVT(s), frame and matrix definitions
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_definitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2030
 *         return self
 * 
 *     def clone_frames(self, SdifFile source, signatures_to_clone=None):             # <<<<<<<<<<<<<<
 *         """
 *         Clone all the frames in source which are included in
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_89clone_frames(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_88clone_frames[] = "SdifFile.clone_frames(self, SdifFile source, signatures_to_clone=None)\n\n        Clone all the frames in source which are included in \n        \n        Args:\n            source (SdifFile): The SdifFile to clone from\n            signatures_to_clone (list[str]): A seq. of signature, or None to clone all\n        \n        Returns:\n            None\n\n        !!! note\n\n            the use case for this function is when you want to\n            modify some of the metadata but leave the data itself\n            unmodified\n        \n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_89clone_frames = {"clone_frames", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_89clone_frames, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_88clone_frames};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_89clone_frames(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source = 0;
  PyObject *__pyx_v_signatures_to_clone = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone_frames (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_signatures_to_clone,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signatures_to_clone);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clone_frames") < 0)) __PYX_ERR(0, 2030, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)values[0]);
    __pyx_v_signatures_to_clone = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clone_frames", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2030, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_frames", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) __PYX_ERR(0, 2030, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_88clone_frames(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_source, __pyx_v_signatures_to_clone);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6pysdif_7_pysdif_8SdifFile_12clone_frames_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pysdif/_pysdif.pyx":2052
 * 
 *         if signatures_to_clone is not None:
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)             # <<<<<<<<<<<<<<
 *         for frame0 in source:
 *             if signatures_to_clone is None or frame0.signature in sigs:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_12clone_frames_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr(__pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2052, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6pysdif_7_pysdif_8SdifFile_12clone_frames_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_clone_frames_locals_genexpr, __pyx_n_s_pysdif__pysdif); if (unlikely(!gen)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_frames.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6pysdif_7_pysdif_8SdifFile_12clone_frames_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2052, __pyx_L1_error)
  __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 2052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_signatures_to_clone)) { __Pyx_RaiseClosureNameError("signatures_to_clone"); __PYX_ERR(0, 2052, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_signatures_to_clone)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_signatures_to_clone)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_signatures_to_clone; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_signatures_to_clone); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2052, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2052, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2052, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2052, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2052, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2052, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sig);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sig, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_cur_scope->__pyx_v_sig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2030
 *         return self
 * 
 *     def clone_frames(self, SdifFile source, signatures_to_clone=None):             # <<<<<<<<<<<<<<
 *         """
 *         Clone all the frames in source which are included in
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_88clone_frames(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source, PyObject *__pyx_v_signatures_to_clone) {
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *__pyx_cur_scope;
  PyObject *__pyx_v_sigs = NULL;
  PyObject *__pyx_v_frame0 = NULL;
  PyObject *__pyx_v_frame1 = NULL;
  PyObject *__pyx_v_matrix = NULL;
  PyObject *__pyx_gb_6pysdif_7_pysdif_8SdifFile_12clone_frames_2generator1 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone_frames", 0);
  __pyx_cur_scope = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *)__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames(__pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2030, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_signatures_to_clone = __pyx_v_signatures_to_clone;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_signatures_to_clone);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_signatures_to_clone);

  /* "pysdif/_pysdif.pyx":2048
 * 
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 * 
 */
  switch (__pyx_v_self->this->Mode) {
    case eWriteFile:
    case eReadWriteFile:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pysdif/_pysdif.pyx":2049
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")             # <<<<<<<<<<<<<<
 * 
 *         if signatures_to_clone is not None:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2049, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":2048
 * 
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 * 
 */
  }

  /* "pysdif/_pysdif.pyx":2051
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 * 
 *         if signatures_to_clone is not None:             # <<<<<<<<<<<<<<
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)
 *         for frame0 in source:
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_signatures_to_clone != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":2052
 * 
 *         if signatures_to_clone is not None:
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)             # <<<<<<<<<<<<<<
 *         for frame0 in source:
 *             if signatures_to_clone is None or frame0.signature in sigs:
 */
    __pyx_t_3 = __pyx_pf_6pysdif_7_pysdif_8SdifFile_12clone_frames_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_sigs = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":2051
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 * 
 *         if signatures_to_clone is not None:             # <<<<<<<<<<<<<<
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)
 *         for frame0 in source:
 */
  }

  /* "pysdif/_pysdif.pyx":2053
 *         if signatures_to_clone is not None:
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)
 *         for frame0 in source:             # <<<<<<<<<<<<<<
 *             if signatures_to_clone is None or frame0.signature in sigs:
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 */
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_source))) || PyTuple_CheckExact(((PyObject *)__pyx_v_source))) {
    __pyx_t_4 = ((PyObject *)__pyx_v_source); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_v_source)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2053, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2053, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2053, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2053, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_frame0, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":2054
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)
 *         for frame0 in source:
 *             if signatures_to_clone is None or frame0.signature in sigs:             # <<<<<<<<<<<<<<
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 *                 for matrix in frame0:
 */
    __pyx_t_2 = (__pyx_cur_scope->__pyx_v_signatures_to_clone == Py_None);
    __pyx_t_7 = (__pyx_t_2 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_1 = __pyx_t_7;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame0, __pyx_n_s_signature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_v_sigs)) { __Pyx_RaiseUnboundLocalError("sigs"); __PYX_ERR(0, 2054, __pyx_L1_error) }
    if (unlikely(__pyx_v_sigs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 2054, __pyx_L1_error)
    }
    __pyx_t_7 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_sigs, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2054, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__pyx_t_7 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_1) {

      /* "pysdif/_pysdif.pyx":2055
 *         for frame0 in source:
 *             if signatures_to_clone is None or frame0.signature in sigs:
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)             # <<<<<<<<<<<<<<
 *                 for matrix in frame0:
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_new_frame); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame0, __pyx_n_s_signature); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame0, __pyx_n_s_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2055, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2055, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2055, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (__pyx_t_11) {
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_10);
        __pyx_t_9 = 0;
        __pyx_t_10 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2055, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_frame1, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pysdif/_pysdif.pyx":2056
 *             if signatures_to_clone is None or frame0.signature in sigs:
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 *                 for matrix in frame0:             # <<<<<<<<<<<<<<
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())
 *                 frame1.write()
 */
      if (likely(PyList_CheckExact(__pyx_v_frame0)) || PyTuple_CheckExact(__pyx_v_frame0)) {
        __pyx_t_3 = __pyx_v_frame0; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_frame0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2056, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2056, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_15)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_8); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 2056, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2056, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_8); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 2056, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2056, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_15(__pyx_t_3);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2056, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_v_matrix, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "pysdif/_pysdif.pyx":2057
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 *                 for matrix in frame0:
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())             # <<<<<<<<<<<<<<
 *                 frame1.write()
 * 
 */
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame1, __pyx_n_s_add_matrix); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2057, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_matrix, __pyx_n_s_signature); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2057, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_matrix, __pyx_n_s_get_data); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2057, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_16 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_16)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        __pyx_t_9 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2057, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        __pyx_t_12 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_12 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_9};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2057, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_9};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2057, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        {
          __pyx_t_16 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2057, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          if (__pyx_t_11) {
            __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_11); __pyx_t_11 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_12, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_12, __pyx_t_9);
          __pyx_t_10 = 0;
          __pyx_t_9 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2057, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pysdif/_pysdif.pyx":2056
 *             if signatures_to_clone is None or frame0.signature in sigs:
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 *                 for matrix in frame0:             # <<<<<<<<<<<<<<
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())
 *                 frame1.write()
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pysdif/_pysdif.pyx":2058
 *                 for matrix in frame0:
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())
 *                 frame1.write()             # <<<<<<<<<<<<<<
 * 
 *     def add_streamID(self, unsigned int numid, char *source, char *treeway):
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame1, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2058, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_13 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_3 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2058, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pysdif/_pysdif.pyx":2054
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)
 *         for frame0 in source:
 *             if signatures_to_clone is None or frame0.signature in sigs:             # <<<<<<<<<<<<<<
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 *                 for matrix in frame0:
 */
    }

    /* "pysdif/_pysdif.pyx":2053
 *         if signatures_to_clone is not None:
 *             sigs = set(asbytes(sig) for sig in signatures_to_clone)
 *         for frame0 in source:             # <<<<<<<<<<<<<<
 *             if signatures_to_clone is None or frame0.signature in sigs:
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pysdif/_pysdif.pyx":2030
 *         return self
 * 
 *     def clone_frames(self, SdifFile source, signatures_to_clone=None):             # <<<<<<<<<<<<<<
 *         """
 *         Clone all the frames in source which are included in
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_frames", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sigs);
  __Pyx_XDECREF(__pyx_v_frame0);
  __Pyx_XDECREF(__pyx_v_frame1);
  __Pyx_XDECREF(__pyx_v_matrix);
  __Pyx_XDECREF(__pyx_gb_6pysdif_7_pysdif_8SdifFile_12clone_frames_2generator1);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2060
 *                 frame1.write()
 * 
 *     def add_streamID(self, unsigned int numid, char *source, char *treeway):             # <<<<<<<<<<<<<<
 *         """
 *         This method is only there for completion.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_91add_streamID(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_90add_streamID[] = "SdifFile.add_streamID(self, unsigned int numid, char *source, char *treeway)\n\n        This method is only there for completion. \n\n        It seems to be only used in old sdif types\n\n        Args:\n            numid (int): The numerical ID of the new stream\n            source (str): \077\077 \n            treeway (str): \077\077\n\n        Returns:\n            None \n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_91add_streamID = {"add_streamID", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_91add_streamID, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_90add_streamID};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_91add_streamID(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  unsigned int __pyx_v_numid;
  char *__pyx_v_source;
  char *__pyx_v_treeway;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_streamID (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numid,&__pyx_n_s_source,&__pyx_n_s_treeway,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numid)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_streamID", 1, 3, 3, 1); __PYX_ERR(0, 2060, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_treeway)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_streamID", 1, 3, 3, 2); __PYX_ERR(0, 2060, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_streamID") < 0)) __PYX_ERR(0, 2060, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_numid = __Pyx_PyInt_As_unsigned_int(values[0]); if (unlikely((__pyx_v_numid == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2060, __pyx_L3_error)
    __pyx_v_source = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_source) && PyErr_Occurred())) __PYX_ERR(0, 2060, __pyx_L3_error)
    __pyx_v_treeway = __Pyx_PyObject_AsWritableString(values[2]); if (unlikely((!__pyx_v_treeway) && PyErr_Occurred())) __PYX_ERR(0, 2060, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_streamID", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2060, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_streamID", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_90add_streamID(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_numid, __pyx_v_source, __pyx_v_treeway);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_90add_streamID(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, unsigned int __pyx_v_numid, char *__pyx_v_source, char *__pyx_v_treeway) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_streamID", 0);

  /* "pysdif/_pysdif.pyx":2074
 *             None
 *         """
 *         SdifStreamIDTablePutSID(self.this.StreamIDsTable,             # <<<<<<<<<<<<<<
 *             numid, source, treeway)
 * 
 */
  (void)(SdifStreamIDTablePutSID(__pyx_v_self->this->StreamIDsTable, __pyx_v_numid, __pyx_v_source, __pyx_v_treeway));

  /* "pysdif/_pysdif.pyx":2060
 *                 frame1.write()
 * 
 *     def add_streamID(self, unsigned int numid, char *source, char *treeway):             # <<<<<<<<<<<<<<
 *         """
 *         This method is only there for completion.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2077
 *             numid, source, treeway)
 * 
 *     def add_predefined_frametype(self, signature):             # <<<<<<<<<<<<<<
 *         """
 *         Add a predefined frame type with corresponding matrix definitions
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_93add_predefined_frametype(PyObject *__pyx_v_self, PyObject *__pyx_v_signature); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_92add_predefined_frametype[] = "SdifFile.add_predefined_frametype(self, signature)\n\n        Add a predefined frame type with corresponding matrix definitions\n\n        This type must be already defined globally. If not already defined, add \n        your definitions via `frametypes_set` and `matrixtypes_set`\n\n        Args:\n            signature (str): the 4-char string signature\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_93add_predefined_frametype = {"add_predefined_frametype", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_93add_predefined_frametype, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_92add_predefined_frametype};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_93add_predefined_frametype(PyObject *__pyx_v_self, PyObject *__pyx_v_signature) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_predefined_frametype (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_92add_predefined_frametype(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), ((PyObject *)__pyx_v_signature));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_92add_predefined_frametype(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_signature) {
  PyObject *__pyx_v_sig = NULL;
  PyObject *__pyx_v_components = NULL;
  PyObject *__pyx_v_comp = NULL;
  PyObject *__pyx_v_matrixsig = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_matrixrole = NULL;
  PyObject *__pyx_v_column_names = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_predefined_frametype", 0);

  /* "pysdif/_pysdif.pyx":2087
 *             signature (str): the 4-char string signature
 *         """
 *         sig = asbytes(signature)             # <<<<<<<<<<<<<<
 *         components = predefined_frametypes().get(sig)
 *         # a component is a strings '{Signature} {Description}'
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sig = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":2088
 *         """
 *         sig = asbytes(signature)
 *         components = predefined_frametypes().get(sig)             # <<<<<<<<<<<<<<
 *         # a component is a strings '{Signature} {Description}'
 *         if not components:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_predefined_frametypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_sig) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_sig);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_components = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":2090
 *         components = predefined_frametypes().get(sig)
 *         # a component is a strings '{Signature} {Description}'
 *         if not components:             # <<<<<<<<<<<<<<
 *             raise KeyError("signature not found")
 *         self.add_frame_type(sig, components)
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_components); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pysdif/_pysdif.pyx":2091
 *         # a component is a strings '{Signature} {Description}'
 *         if not components:
 *             raise KeyError("signature not found")             # <<<<<<<<<<<<<<
 *         self.add_frame_type(sig, components)
 *         for comp in components:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2091, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":2090
 *         components = predefined_frametypes().get(sig)
 *         # a component is a strings '{Signature} {Description}'
 *         if not components:             # <<<<<<<<<<<<<<
 *             raise KeyError("signature not found")
 *         self.add_frame_type(sig, components)
 */
  }

  /* "pysdif/_pysdif.pyx":2092
 *         if not components:
 *             raise KeyError("signature not found")
 *         self.add_frame_type(sig, components)             # <<<<<<<<<<<<<<
 *         for comp in components:
 *             matrixsig, matrixrole = comp.split()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_frame_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_sig, __pyx_v_components};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2092, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_sig, __pyx_v_components};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2092, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_sig);
    __Pyx_GIVEREF(__pyx_v_sig);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_sig);
    __Pyx_INCREF(__pyx_v_components);
    __Pyx_GIVEREF(__pyx_v_components);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_components);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":2093
 *             raise KeyError("signature not found")
 *         self.add_frame_type(sig, components)
 *         for comp in components:             # <<<<<<<<<<<<<<
 *             matrixsig, matrixrole = comp.split()
 *             column_names = SDIF_PREDEFINEDTYPES['matrixtypes'].get(asbytes(matrixsig))
 */
  if (likely(PyList_CheckExact(__pyx_v_components)) || PyTuple_CheckExact(__pyx_v_components)) {
    __pyx_t_1 = __pyx_v_components; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2093, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2093, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2093, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2093, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2093, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2093, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_comp, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":2094
 *         self.add_frame_type(sig, components)
 *         for comp in components:
 *             matrixsig, matrixrole = comp.split()             # <<<<<<<<<<<<<<
 *             column_names = SDIF_PREDEFINEDTYPES['matrixtypes'].get(asbytes(matrixsig))
 *             if not column_names:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_comp, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2094, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 2094, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2094, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_matrixsig, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_matrixrole, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":2095
 *         for comp in components:
 *             matrixsig, matrixrole = comp.split()
 *             column_names = SDIF_PREDEFINEDTYPES['matrixtypes'].get(asbytes(matrixsig))             # <<<<<<<<<<<<<<
 *             if not column_names:
 *                 raise KeyError("Failed to fetch the column names for {sig}".format(sig=matrixsig))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SDIF_PREDEFINEDTYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_matrixtypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_matrixsig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_column_names, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":2096
 *             matrixsig, matrixrole = comp.split()
 *             column_names = SDIF_PREDEFINEDTYPES['matrixtypes'].get(asbytes(matrixsig))
 *             if not column_names:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Failed to fetch the column names for {sig}".format(sig=matrixsig))
 *             if isinstance(column_names, str):
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_column_names); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2096, __pyx_L1_error)
    __pyx_t_5 = ((!__pyx_t_6) != 0);
    if (unlikely(__pyx_t_5)) {

      /* "pysdif/_pysdif.pyx":2097
 *             column_names = SDIF_PREDEFINEDTYPES['matrixtypes'].get(asbytes(matrixsig))
 *             if not column_names:
 *                 raise KeyError("Failed to fetch the column names for {sig}".format(sig=matrixsig))             # <<<<<<<<<<<<<<
 *             if isinstance(column_names, str):
 *                 column_names = bytes(column_names)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Failed_to_fetch_the_column_names, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sig, __pyx_v_matrixsig) < 0) __PYX_ERR(0, 2097, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2097, __pyx_L1_error)

      /* "pysdif/_pysdif.pyx":2096
 *             matrixsig, matrixrole = comp.split()
 *             column_names = SDIF_PREDEFINEDTYPES['matrixtypes'].get(asbytes(matrixsig))
 *             if not column_names:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Failed to fetch the column names for {sig}".format(sig=matrixsig))
 *             if isinstance(column_names, str):
 */
    }

    /* "pysdif/_pysdif.pyx":2098
 *             if not column_names:
 *                 raise KeyError("Failed to fetch the column names for {sig}".format(sig=matrixsig))
 *             if isinstance(column_names, str):             # <<<<<<<<<<<<<<
 *                 column_names = bytes(column_names)
 *             self.add_matrix_type(matrixsig, column_names)
 */
    __pyx_t_5 = PyString_Check(__pyx_v_column_names); 
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pysdif/_pysdif.pyx":2099
 *                 raise KeyError("Failed to fetch the column names for {sig}".format(sig=matrixsig))
 *             if isinstance(column_names, str):
 *                 column_names = bytes(column_names)             # <<<<<<<<<<<<<<
 *             self.add_matrix_type(matrixsig, column_names)
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_column_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_column_names, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pysdif/_pysdif.pyx":2098
 *             if not column_names:
 *                 raise KeyError("Failed to fetch the column names for {sig}".format(sig=matrixsig))
 *             if isinstance(column_names, str):             # <<<<<<<<<<<<<<
 *                 column_names = bytes(column_names)
 *             self.add_matrix_type(matrixsig, column_names)
 */
    }

    /* "pysdif/_pysdif.pyx":2100
 *             if isinstance(column_names, str):
 *                 column_names = bytes(column_names)
 *             self.add_matrix_type(matrixsig, column_names)             # <<<<<<<<<<<<<<
 * 
 *     def write_all_ascii_chunks(self):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_matrix_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_matrixsig, __pyx_v_column_names};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2100, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_matrixsig, __pyx_v_column_names};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2100, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_matrixsig);
      __Pyx_GIVEREF(__pyx_v_matrixsig);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_v_matrixsig);
      __Pyx_INCREF(__pyx_v_column_names);
      __Pyx_GIVEREF(__pyx_v_column_names);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_v_column_names);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pysdif/_pysdif.pyx":2093
 *             raise KeyError("signature not found")
 *         self.add_frame_type(sig, components)
 *         for comp in components:             # <<<<<<<<<<<<<<
 *             matrixsig, matrixrole = comp.split()
 *             column_names = SDIF_PREDEFINEDTYPES['matrixtypes'].get(asbytes(matrixsig))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":2077
 *             numid, source, treeway)
 * 
 *     def add_predefined_frametype(self, signature):             # <<<<<<<<<<<<<<
 *         """
 *         Add a predefined frame type with corresponding matrix definitions
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_predefined_frametype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XDECREF(__pyx_v_components);
  __Pyx_XDECREF(__pyx_v_comp);
  __Pyx_XDECREF(__pyx_v_matrixsig);
  __Pyx_XDECREF(__pyx_v_matrixrole);
  __Pyx_XDECREF(__pyx_v_column_names);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2102
 *             self.add_matrix_type(matrixsig, column_names)
 * 
 *     def write_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level Interface**
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_95write_all_ascii_chunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_94write_all_ascii_chunks[] = "SdifFile.write_all_ascii_chunks(self)\n\n        **Low-level Interface** \n\n        Once the NVTs and matrix and frame definitions have been added to the SdifFile,\n        this methods writes them all together to disk and the SdifFile is ready to accept\n        new frames.\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_95write_all_ascii_chunks = {"write_all_ascii_chunks", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_95write_all_ascii_chunks, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_94write_all_ascii_chunks};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_95write_all_ascii_chunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_all_ascii_chunks (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_94write_all_ascii_chunks(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_94write_all_ascii_chunks(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_all_ascii_chunks", 0);

  /* "pysdif/_pysdif.pyx":2110
 *         new frames.
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status != eSdifGeneralHeader:
 */
  switch (__pyx_v_self->this->Mode) {
    case eWriteFile:
    case eReadWriteFile:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pysdif/_pysdif.pyx":2111
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")             # <<<<<<<<<<<<<<
 *         if self.write_status != eSdifGeneralHeader:
 *             return
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2111, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":2110
 *         new frames.
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status != eSdifGeneralHeader:
 */
  }

  /* "pysdif/_pysdif.pyx":2112
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status != eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             return
 *         SdifFWriteAllASCIIChunks(self.this)
 */
  __pyx_t_2 = ((__pyx_v_self->write_status != __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader) != 0);
  if (__pyx_t_2) {

    /* "pysdif/_pysdif.pyx":2113
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status != eSdifGeneralHeader:
 *             return             # <<<<<<<<<<<<<<
 *         SdifFWriteAllASCIIChunks(self.this)
 *         self.write_status = eSdifAllASCIIChunks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pysdif/_pysdif.pyx":2112
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status != eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             return
 *         SdifFWriteAllASCIIChunks(self.this)
 */
  }

  /* "pysdif/_pysdif.pyx":2114
 *         if self.write_status != eSdifGeneralHeader:
 *             return
 *         SdifFWriteAllASCIIChunks(self.this)             # <<<<<<<<<<<<<<
 *         self.write_status = eSdifAllASCIIChunks
 * 
 */
  (void)(SdifFWriteAllASCIIChunks(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2115
 *             return
 *         SdifFWriteAllASCIIChunks(self.this)
 *         self.write_status = eSdifAllASCIIChunks             # <<<<<<<<<<<<<<
 * 
 *     def new_frame(self, signature, SdifFloat8 time, SdifUInt4 streamID=0):
 */
  __pyx_v_self->write_status = __pyx_e_6pysdif_7_pysdif_eSdifAllASCIIChunks;

  /* "pysdif/_pysdif.pyx":2102
 *             self.add_matrix_type(matrixsig, column_names)
 * 
 *     def write_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level Interface**
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.write_all_ascii_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2117
 *         self.write_status = eSdifAllASCIIChunks
 * 
 *     def new_frame(self, signature, SdifFloat8 time, SdifUInt4 streamID=0):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new frame with given signature and at given time
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_97new_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_96new_frame[] = "SdifFile.new_frame(self, signature, SdifFloat8 time, SdifUInt4 streamID=0)\n\n        Create a new frame with given signature and at given time\n\n        !!! note \"Stream/Frame/Matrix\"\n\n            A SDIF file can have 1 or more streams. Each stream has multiple\n            frames. A frame is a collection of matrixes at a given time.\n\n        Args:\n            signature (str): The signature of the new Frame\n            time (float): The time of the new frame\n            streamID (int): The ID of the stream\n    \n        Returns:\n            (FrameW) A FrameW, used to write a (see example)\n        \n        ## Example\n        \n        ```python\n        new_frame = sdiffile.new_frame('1SIG', time_now)\n        new_frame.add_matrix(...)\n        new_frame.write()\n        ```\n\n        if you know that you will write only one matrix, you can call:\n\n        ```python\n        \n        sdiffile.new_frame_one_matrix(frame_sig, time_now, matrix_sig, data)\n        \n        ```\n        \n        This will do the same as the three method calls above\n\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_97new_frame = {"new_frame", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_97new_frame, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_96new_frame};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_97new_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  SdifFloat8 __pyx_v_time;
  SdifUInt4 __pyx_v_streamID;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("new_frame (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signature,&__pyx_n_s_time,&__pyx_n_s_streamID,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signature)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("new_frame", 0, 2, 3, 1); __PYX_ERR(0, 2117, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_streamID);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new_frame") < 0)) __PYX_ERR(0, 2117, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_signature = values[0];
    __pyx_v_time = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_time == ((SdifFloat8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2117, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_streamID = __Pyx_PyInt_As_SdifUInt4(values[2]); if (unlikely((__pyx_v_streamID == ((SdifUInt4)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2117, __pyx_L3_error)
    } else {
      __pyx_v_streamID = ((SdifUInt4)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("new_frame", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2117, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.new_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_96new_frame(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_signature, __pyx_v_time, __pyx_v_streamID);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_96new_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_signature, SdifFloat8 __pyx_v_time, SdifUInt4 __pyx_v_streamID) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_frame", 0);

  /* "pysdif/_pysdif.pyx":2156
 *         # defining the global header (ascii chunks) so verify that
 *         # we have written it
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:
 */
  switch (__pyx_v_self->this->Mode) {
    case eWriteFile:
    case eReadWriteFile:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pysdif/_pysdif.pyx":2157
 *         # we have written it
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")             # <<<<<<<<<<<<<<
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2157, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":2156
 *         # defining the global header (ascii chunks) so verify that
 *         # we have written it
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:
 */
  }

  /* "pysdif/_pysdif.pyx":2158
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             self.write_all_ascii_chunks()
 *         return FrameW_new(self, str2sig(asbytes(signature)), time, streamID)
 */
  __pyx_t_2 = ((__pyx_v_self->write_status == __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader) != 0);
  if (__pyx_t_2) {

    /* "pysdif/_pysdif.pyx":2159
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()             # <<<<<<<<<<<<<<
 *         return FrameW_new(self, str2sig(asbytes(signature)), time, streamID)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_all_ascii_chunks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":2158
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             self.write_all_ascii_chunks()
 *         return FrameW_new(self, str2sig(asbytes(signature)), time, streamID)
 */
  }

  /* "pysdif/_pysdif.pyx":2160
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()
 *         return FrameW_new(self, str2sig(asbytes(signature)), time, streamID)             # <<<<<<<<<<<<<<
 * 
 *     def new_frame_one_matrix(self, frame_sig, SdifFloat8 time, matrix_sig,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_signature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 2160, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_3); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2160, __pyx_L1_error)
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.streamID = __pyx_v_streamID;
  __pyx_t_4 = ((PyObject *)__pyx_f_6pysdif_7_pysdif_FrameW_new(__pyx_v_self, __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_6), __pyx_v_time, &__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":2117
 *         self.write_status = eSdifAllASCIIChunks
 * 
 *     def new_frame(self, signature, SdifFloat8 time, SdifUInt4 streamID=0):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new frame with given signature and at given time
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.new_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2162
 *         return FrameW_new(self, str2sig(asbytes(signature)), time, streamID)
 * 
 *     def new_frame_one_matrix(self, frame_sig, SdifFloat8 time, matrix_sig,             # <<<<<<<<<<<<<<
 *                              c_numpy.ndarray matrixdata, SdifUInt4 streamID=0):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_99new_frame_one_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_98new_frame_one_matrix[] = "SdifFile.new_frame_one_matrix(self, frame_sig, SdifFloat8 time, matrix_sig, ndarray matrixdata, SdifUInt4 streamID=0)\n\n        Create a frame containing only one matrix and write it\n        \n        This method creates the frame, creates a new matrix\n        in the frame and writes it to disk, all at once\n\n        Args:\n            frame_sig (str): The frame signature\n            time (float): The time of the frame\n            matrix_sig (str): The matrix signature\n            matrixdata (numpy.array): The data of the matrix, a 2D array\n            streamID (int): The ID of the stream to add this frame/matrix to\n\n        Returns:\n            None\n        \n        !!! note\n\n            use this method when you want to create a frame which\n            contains only one matrix, like a 1TRC frame. It is more efficient\n            than calling new_frame, add_matrix, write (see method 'new_frame')\n        \n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_99new_frame_one_matrix = {"new_frame_one_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_99new_frame_one_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_98new_frame_one_matrix};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_99new_frame_one_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_frame_sig = 0;
  SdifFloat8 __pyx_v_time;
  PyObject *__pyx_v_matrix_sig = 0;
  PyArrayObject *__pyx_v_matrixdata = 0;
  SdifUInt4 __pyx_v_streamID;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("new_frame_one_matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frame_sig,&__pyx_n_s_time,&__pyx_n_s_matrix_sig,&__pyx_n_s_matrixdata,&__pyx_n_s_streamID,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame_sig)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("new_frame_one_matrix", 0, 4, 5, 1); __PYX_ERR(0, 2162, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matrix_sig)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("new_frame_one_matrix", 0, 4, 5, 2); __PYX_ERR(0, 2162, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matrixdata)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("new_frame_one_matrix", 0, 4, 5, 3); __PYX_ERR(0, 2162, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_streamID);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new_frame_one_matrix") < 0)) __PYX_ERR(0, 2162, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frame_sig = values[0];
    __pyx_v_time = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_time == ((SdifFloat8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2162, __pyx_L3_error)
    __pyx_v_matrix_sig = values[2];
    __pyx_v_matrixdata = ((PyArrayObject *)values[3]);
    if (values[4]) {
      __pyx_v_streamID = __Pyx_PyInt_As_SdifUInt4(values[4]); if (unlikely((__pyx_v_streamID == ((SdifUInt4)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2163, __pyx_L3_error)
    } else {
      __pyx_v_streamID = ((SdifUInt4)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("new_frame_one_matrix", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2162, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.new_frame_one_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matrixdata), __pyx_ptype_5numpy_ndarray, 1, "matrixdata", 0))) __PYX_ERR(0, 2163, __pyx_L1_error)
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_98new_frame_one_matrix(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_v_frame_sig, __pyx_v_time, __pyx_v_matrix_sig, __pyx_v_matrixdata, __pyx_v_streamID);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_98new_frame_one_matrix(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, PyObject *__pyx_v_frame_sig, SdifFloat8 __pyx_v_time, PyObject *__pyx_v_matrix_sig, PyArrayObject *__pyx_v_matrixdata, SdifUInt4 __pyx_v_streamID) {
  size_t __pyx_v_frame_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_frame_one_matrix", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_matrixdata);

  /* "pysdif/_pysdif.pyx":2187
 * 
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:
 */
  switch (__pyx_v_self->this->Mode) {
    case eWriteFile:
    case eReadWriteFile:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pysdif/_pysdif.pyx":2188
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")             # <<<<<<<<<<<<<<
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2188, __pyx_L1_error)

    /* "pysdif/_pysdif.pyx":2187
 * 
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):             # <<<<<<<<<<<<<<
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:
 */
  }

  /* "pysdif/_pysdif.pyx":2189
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             self.write_all_ascii_chunks()
 *         cdef size_t frame_size = SdifSizeOfFrameHeader() + SdifSizeOfMatrix(
 */
  __pyx_t_2 = ((__pyx_v_self->write_status == __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader) != 0);
  if (__pyx_t_2) {

    /* "pysdif/_pysdif.pyx":2190
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()             # <<<<<<<<<<<<<<
 *         cdef size_t frame_size = SdifSizeOfFrameHeader() + SdifSizeOfMatrix(
 *             <SdifDataTypeET>(dtype_numpy2sdif(matrixdata.descr.type_num)),
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_all_ascii_chunks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pysdif/_pysdif.pyx":2189
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")
 *         if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             self.write_all_ascii_chunks()
 *         cdef size_t frame_size = SdifSizeOfFrameHeader() + SdifSizeOfMatrix(
 */
  }

  /* "pysdif/_pysdif.pyx":2191
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()
 *         cdef size_t frame_size = SdifSizeOfFrameHeader() + SdifSizeOfMatrix(             # <<<<<<<<<<<<<<
 *             <SdifDataTypeET>(dtype_numpy2sdif(matrixdata.descr.type_num)),
 *             matrixdata.shape[0], matrixdata.shape[1] # rows, cols
 */
  __pyx_v_frame_size = (SdifSizeOfFrameHeader() + SdifSizeOfMatrix(((SdifDataTypeET)__pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(__pyx_v_matrixdata->descr->type_num)), (__pyx_v_matrixdata->dimensions[0]), (__pyx_v_matrixdata->dimensions[1])));

  /* "pysdif/_pysdif.pyx":2195
 *             matrixdata.shape[0], matrixdata.shape[1] # rows, cols
 *         )
 *         SdifFSetCurrFrameHeader(self.this, str2sig(asbytes(frame_sig)), frame_size, 1, streamID, time)             # <<<<<<<<<<<<<<
 *         SdifFWriteFrameHeader(self.this)
 *         if not matrixdata.flags.c_contiguous:
 */
  __pyx_t_3 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_frame_sig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 2195, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_3); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2195, __pyx_L1_error)
  (void)(SdifFSetCurrFrameHeader(__pyx_v_self->this, __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_6), __pyx_v_frame_size, 1, __pyx_v_streamID, __pyx_v_time));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":2196
 *         )
 *         SdifFSetCurrFrameHeader(self.this, str2sig(asbytes(frame_sig)), frame_size, 1, streamID, time)
 *         SdifFWriteFrameHeader(self.this)             # <<<<<<<<<<<<<<
 *         if not matrixdata.flags.c_contiguous:
 *             matrixdata = np.ascontiguousarray(matrixdata)
 */
  (void)(SdifFWriteFrameHeader(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2197
 *         SdifFSetCurrFrameHeader(self.this, str2sig(asbytes(frame_sig)), frame_size, 1, streamID, time)
 *         SdifFWriteFrameHeader(self.this)
 *         if not matrixdata.flags.c_contiguous:             # <<<<<<<<<<<<<<
 *             matrixdata = np.ascontiguousarray(matrixdata)
 *         SdifFWriteMatrix(self.this, str2sig(asbytes(matrix_sig)),
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_matrixdata), __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = ((!__pyx_t_2) != 0);
  if (__pyx_t_1) {

    /* "pysdif/_pysdif.pyx":2198
 *         SdifFWriteFrameHeader(self.this)
 *         if not matrixdata.flags.c_contiguous:
 *             matrixdata = np.ascontiguousarray(matrixdata)             # <<<<<<<<<<<<<<
 *         SdifFWriteMatrix(self.this, str2sig(asbytes(matrix_sig)),
 *                          <SdifDataTypeET>dtype_numpy2sdif(matrixdata.descr.type_num),
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_matrixdata)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_matrixdata));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2198, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_matrixdata, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pysdif/_pysdif.pyx":2197
 *         SdifFSetCurrFrameHeader(self.this, str2sig(asbytes(frame_sig)), frame_size, 1, streamID, time)
 *         SdifFWriteFrameHeader(self.this)
 *         if not matrixdata.flags.c_contiguous:             # <<<<<<<<<<<<<<
 *             matrixdata = np.ascontiguousarray(matrixdata)
 *         SdifFWriteMatrix(self.this, str2sig(asbytes(matrix_sig)),
 */
  }

  /* "pysdif/_pysdif.pyx":2199
 *         if not matrixdata.flags.c_contiguous:
 *             matrixdata = np.ascontiguousarray(matrixdata)
 *         SdifFWriteMatrix(self.this, str2sig(asbytes(matrix_sig)),             # <<<<<<<<<<<<<<
 *                          <SdifDataTypeET>dtype_numpy2sdif(matrixdata.descr.type_num),
 *                          matrixdata.shape[0], matrixdata.shape[1],   # rows, cols
 */
  __pyx_t_4 = __pyx_f_6pysdif_7_pysdif_asbytes(__pyx_v_matrix_sig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(__pyx_t_4 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 2199, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2199, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2202
 *                          <SdifDataTypeET>dtype_numpy2sdif(matrixdata.descr.type_num),
 *                          matrixdata.shape[0], matrixdata.shape[1],   # rows, cols
 *                          matrixdata.data)             # <<<<<<<<<<<<<<
 *         self.write_status = eSdifMatrixData
 * 
 */
  (void)(SdifFWriteMatrix(__pyx_v_self->this, __pyx_f_6pysdif_7_pysdif_str2sig(__pyx_t_6), ((SdifDataTypeET)__pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(__pyx_v_matrixdata->descr->type_num)), (__pyx_v_matrixdata->dimensions[0]), (__pyx_v_matrixdata->dimensions[1]), __pyx_v_matrixdata->data));
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pysdif/_pysdif.pyx":2203
 *                          matrixdata.shape[0], matrixdata.shape[1],   # rows, cols
 *                          matrixdata.data)
 *         self.write_status = eSdifMatrixData             # <<<<<<<<<<<<<<
 * 
 *     # low level functions to print info
 */
  __pyx_v_self->write_status = __pyx_e_6pysdif_7_pysdif_eSdifMatrixData;

  /* "pysdif/_pysdif.pyx":2162
 *         return FrameW_new(self, str2sig(asbytes(signature)), time, streamID)
 * 
 *     def new_frame_one_matrix(self, frame_sig, SdifFloat8 time, matrix_sig,             # <<<<<<<<<<<<<<
 *                              c_numpy.ndarray matrixdata, SdifUInt4 streamID=0):
 *         """
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.new_frame_one_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_matrixdata);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2206
 * 
 *     # low level functions to print info
 *     def print_NVT(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllNameValueNVT(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_101print_NVT(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_100print_NVT[] = "SdifFile.print_NVT(self)\n **Low-Level Interface** ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_101print_NVT = {"print_NVT", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_101print_NVT, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_100print_NVT};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_101print_NVT(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_NVT (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_100print_NVT(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_100print_NVT(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_NVT", 0);

  /* "pysdif/_pysdif.pyx":2208
 *     def print_NVT(self):
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllNameValueNVT(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def print_general_header(self):
 */
  (void)(SdifFPrintAllNameValueNVT(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2206
 * 
 *     # low level functions to print info
 *     def print_NVT(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllNameValueNVT(self.this)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2210
 *         SdifFPrintAllNameValueNVT(self.this)
 * 
 *     def print_general_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_103print_general_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_102print_general_header[] = "SdifFile.print_general_header(self)\n **Low-Level Interface** ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_103print_general_header = {"print_general_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_103print_general_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_102print_general_header};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_103print_general_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_general_header (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_102print_general_header(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_102print_general_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  CYTHON_UNUSED size_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_general_header", 0);

  /* "pysdif/_pysdif.pyx":2212
 *     def print_general_header(self):
 *         """ **Low-Level Interface** """
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def print_all_ascii_chunks(self):
 */
  __pyx_v_n = SdifFPrintGeneralHeader(__pyx_v_self->this);

  /* "pysdif/_pysdif.pyx":2210
 *         SdifFPrintAllNameValueNVT(self.this)
 * 
 *     def print_general_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2214
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)
 * 
 *     def print_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllASCIIChunks(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_105print_all_ascii_chunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_104print_all_ascii_chunks[] = "SdifFile.print_all_ascii_chunks(self)\n **Low-Level Interface** ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_105print_all_ascii_chunks = {"print_all_ascii_chunks", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_105print_all_ascii_chunks, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_104print_all_ascii_chunks};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_105print_all_ascii_chunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_all_ascii_chunks (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_104print_all_ascii_chunks(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_104print_all_ascii_chunks(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_all_ascii_chunks", 0);

  /* "pysdif/_pysdif.pyx":2216
 *     def print_all_ascii_chunks(self):
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllASCIIChunks(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def print_all_types(self):
 */
  (void)(SdifFPrintAllASCIIChunks(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2214
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)
 * 
 *     def print_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllASCIIChunks(self.this)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2218
 *         SdifFPrintAllASCIIChunks(self.this)
 * 
 *     def print_all_types(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllType(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_107print_all_types(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_106print_all_types[] = "SdifFile.print_all_types(self)\n **Low-Level Interface** ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_107print_all_types = {"print_all_types", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_107print_all_types, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_106print_all_types};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_107print_all_types(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_all_types (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_106print_all_types(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_106print_all_types(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_all_types", 0);

  /* "pysdif/_pysdif.pyx":2220
 *     def print_all_types(self):
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllType(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def print_matrix_header(self):
 */
  (void)(SdifFPrintAllType(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2218
 *         SdifFPrintAllASCIIChunks(self.this)
 * 
 *     def print_all_types(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllType(self.this)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2222
 *         SdifFPrintAllType(self.this)
 * 
 *     def print_matrix_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintMatrixHeader(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_109print_matrix_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_108print_matrix_header[] = "SdifFile.print_matrix_header(self)\n **Low-Level Interface** ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_109print_matrix_header = {"print_matrix_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_109print_matrix_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_108print_matrix_header};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_109print_matrix_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_matrix_header (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_108print_matrix_header(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_108print_matrix_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_matrix_header", 0);

  /* "pysdif/_pysdif.pyx":2224
 *     def print_matrix_header(self):
 *         """ **Low-Level Interface** """
 *         SdifFPrintMatrixHeader(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def print_one_row(self):
 */
  (void)(SdifFPrintMatrixHeader(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2222
 *         SdifFPrintAllType(self.this)
 * 
 *     def print_matrix_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintMatrixHeader(self.this)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2226
 *         SdifFPrintMatrixHeader(self.this)
 * 
 *     def print_one_row(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintOneRow(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_111print_one_row(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_110print_one_row[] = "SdifFile.print_one_row(self)\n **Low-Level Interface** ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_111print_one_row = {"print_one_row", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_111print_one_row, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_110print_one_row};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_111print_one_row(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_one_row (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_110print_one_row(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_110print_one_row(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_one_row", 0);

  /* "pysdif/_pysdif.pyx":2228
 *     def print_one_row(self):
 *         """ **Low-Level Interface** """
 *         SdifFPrintOneRow(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def print_frame_header(self):
 */
  (void)(SdifFPrintOneRow(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2226
 *         SdifFPrintMatrixHeader(self.this)
 * 
 *     def print_one_row(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintOneRow(self.this)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2230
 *         SdifFPrintOneRow(self.this)
 * 
 *     def print_frame_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintFrameHeader(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_113print_frame_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_112print_frame_header[] = "SdifFile.print_frame_header(self)\n **Low-Level Interface** ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_113print_frame_header = {"print_frame_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_113print_frame_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_112print_frame_header};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_113print_frame_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_frame_header (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_112print_frame_header(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_112print_frame_header(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_frame_header", 0);

  /* "pysdif/_pysdif.pyx":2232
 *     def print_frame_header(self):
 *         """ **Low-Level Interface** """
 *         SdifFPrintFrameHeader(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def print_all_stream_ID(self):
 */
  (void)(SdifFPrintFrameHeader(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2230
 *         SdifFPrintOneRow(self.this)
 * 
 *     def print_frame_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintFrameHeader(self.this)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2234
 *         SdifFPrintFrameHeader(self.this)
 * 
 *     def print_all_stream_ID(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllStreamID(self.this)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_115print_all_stream_ID(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_114print_all_stream_ID[] = "SdifFile.print_all_stream_ID(self)\n **Low-Level Interface** ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_115print_all_stream_ID = {"print_all_stream_ID", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_115print_all_stream_ID, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_114print_all_stream_ID};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_115print_all_stream_ID(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_all_stream_ID (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_114print_all_stream_ID(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_114print_all_stream_ID(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_all_stream_ID", 0);

  /* "pysdif/_pysdif.pyx":2236
 *     def print_all_stream_ID(self):
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllStreamID(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def frame_types_to_string(self):
 */
  (void)(SdifFPrintAllStreamID(__pyx_v_self->this));

  /* "pysdif/_pysdif.pyx":2234
 *         SdifFPrintFrameHeader(self.this)
 * 
 *     def print_all_stream_ID(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllStreamID(self.this)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2238
 *         SdifFPrintAllStreamID(self.this)
 * 
 *     def frame_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         returns a string with all frame types
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_117frame_types_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_116frame_types_to_string[] = "SdifFile.frame_types_to_string(self)\n\n        returns a string with all frame types\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_117frame_types_to_string = {"frame_types_to_string", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_117frame_types_to_string, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_116frame_types_to_string};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_117frame_types_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frame_types_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_116frame_types_to_string(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_116frame_types_to_string(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  SdifStringT *__pyx_v_sdifstr;
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frame_types_to_string", 0);

  /* "pysdif/_pysdif.pyx":2243
 *         """
 *         cdef SdifStringT *sdifstr
 *         sdifstr = SdifStringNew()             # <<<<<<<<<<<<<<
 *         SdifFAllFrameTypeToSdifString(self.this, sdifstr)
 *         # out = PyString_from_SdifString(sdifstr)
 */
  __pyx_v_sdifstr = SdifStringNew();

  /* "pysdif/_pysdif.pyx":2244
 *         cdef SdifStringT *sdifstr
 *         sdifstr = SdifStringNew()
 *         SdifFAllFrameTypeToSdifString(self.this, sdifstr)             # <<<<<<<<<<<<<<
 *         # out = PyString_from_SdifString(sdifstr)
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")
 */
  (void)(SdifFAllFrameTypeToSdifString(__pyx_v_self->this, __pyx_v_sdifstr));

  /* "pysdif/_pysdif.pyx":2246
 *         SdifFAllFrameTypeToSdifString(self.this, sdifstr)
 *         # out = PyString_from_SdifString(sdifstr)
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")             # <<<<<<<<<<<<<<
 *         SdifStringFree(sdifstr)
 *         return out
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_bytes_from_sdifstring(__pyx_v_sdifstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
    __PYX_ERR(0, 2246, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_decode_bytes(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_out = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":2247
 *         # out = PyString_from_SdifString(sdifstr)
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")
 *         SdifStringFree(sdifstr)             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  SdifStringFree(__pyx_v_sdifstr);

  /* "pysdif/_pysdif.pyx":2248
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")
 *         SdifStringFree(sdifstr)
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def get_frame_types(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":2238
 *         SdifFPrintAllStreamID(self.this)
 * 
 *     def frame_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         returns a string with all frame types
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_types_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2250
 *         return out
 * 
 *     def get_frame_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of Frame Type Definitions (1FTD)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_119get_frame_types(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_118get_frame_types[] = "SdifFile.get_frame_types(self)\n\n        Returns a list of Frame Type Definitions (1FTD)\n\n        Each FrameTypeDefinition is a FrameTypeDefinition(signature:bytes, components:list[Component])\n        (a Component has the attributes signature:bytes, name:bytes, num:int)\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_119get_frame_types = {"get_frame_types", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_119get_frame_types, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_118get_frame_types};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_119get_frame_types(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_frame_types (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_118get_frame_types(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_118get_frame_types(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_frame_types", 0);

  /* "pysdif/_pysdif.pyx":2257
 *         (a Component has the attributes signature:bytes, name:bytes, num:int)
 *         """
 *         return FrameTypesTable_to_list(self.this.FrameTypesTable)             # <<<<<<<<<<<<<<
 * 
 *     def matrix_types_to_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_FrameTypesTable_to_list(__pyx_v_self->this->FrameTypesTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":2250
 *         return out
 * 
 *     def get_frame_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of Frame Type Definitions (1FTD)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.get_frame_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2259
 *         return FrameTypesTable_to_list(self.this.FrameTypesTable)
 * 
 *     def matrix_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string with all matrix types
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_121matrix_types_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_120matrix_types_to_string[] = "SdifFile.matrix_types_to_string(self)\n \n        Returns a string with all matrix types\n\n        Returns:\n            (str) A string with all matrix types\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_121matrix_types_to_string = {"matrix_types_to_string", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_121matrix_types_to_string, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_120matrix_types_to_string};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_121matrix_types_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix_types_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_120matrix_types_to_string(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_120matrix_types_to_string(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  SdifStringT *__pyx_v_sdifstr;
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix_types_to_string", 0);

  /* "pysdif/_pysdif.pyx":2267
 *         """
 *         cdef SdifStringT *sdifstr
 *         sdifstr = SdifStringNew()             # <<<<<<<<<<<<<<
 *         SdifFAllMatrixTypeToSdifString(self.this, sdifstr)
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")
 */
  __pyx_v_sdifstr = SdifStringNew();

  /* "pysdif/_pysdif.pyx":2268
 *         cdef SdifStringT *sdifstr
 *         sdifstr = SdifStringNew()
 *         SdifFAllMatrixTypeToSdifString(self.this, sdifstr)             # <<<<<<<<<<<<<<
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")
 *         SdifStringFree(sdifstr)
 */
  (void)(SdifFAllMatrixTypeToSdifString(__pyx_v_self->this, __pyx_v_sdifstr));

  /* "pysdif/_pysdif.pyx":2269
 *         sdifstr = SdifStringNew()
 *         SdifFAllMatrixTypeToSdifString(self.this, sdifstr)
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")             # <<<<<<<<<<<<<<
 *         SdifStringFree(sdifstr)
 *         return out
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_bytes_from_sdifstring(__pyx_v_sdifstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
    __PYX_ERR(0, 2269, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_decode_bytes(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_out = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pysdif/_pysdif.pyx":2270
 *         SdifFAllMatrixTypeToSdifString(self.this, sdifstr)
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")
 *         SdifStringFree(sdifstr)             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  SdifStringFree(__pyx_v_sdifstr);

  /* "pysdif/_pysdif.pyx":2271
 *         out = bytes_from_sdifstring(sdifstr).decode("ascii")
 *         SdifStringFree(sdifstr)
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def get_matrix_types(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":2259
 *         return FrameTypesTable_to_list(self.this.FrameTypesTable)
 * 
 *     def matrix_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string with all matrix types
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.matrix_types_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2273
 *         return out
 * 
 *     def get_matrix_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get a list of matrix type definitions (1MTD)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_123get_matrix_types(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_122get_matrix_types[] = "SdifFile.get_matrix_types(self)\n\n        Get a list of matrix type definitions (1MTD)\n\n        Returns:\n            (list[str]) A list of matrix types, where each item is \n            a MatrixTypeDefinition\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_123get_matrix_types = {"get_matrix_types", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_123get_matrix_types, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_122get_matrix_types};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_123get_matrix_types(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_matrix_types (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_122get_matrix_types(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_122get_matrix_types(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_matrix_types", 0);

  /* "pysdif/_pysdif.pyx":2281
 *             a MatrixTypeDefinition
 *         """
 *         return MatrixTypesTable_to_list(self.this.MatrixTypesTable)             # <<<<<<<<<<<<<<
 * 
 *     def get_NVTs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_MatrixTypesTable_to_list(__pyx_v_self->this->MatrixTypesTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":2273
 *         return out
 * 
 *     def get_matrix_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get a list of matrix type definitions (1MTD)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.get_matrix_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2283
 *         return MatrixTypesTable_to_list(self.this.MatrixTypesTable)
 * 
 *     def get_NVTs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list with all defined NameValueTables
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_125get_NVTs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_124get_NVTs[] = "SdifFile.get_NVTs(self)\n\n        Return a list with all defined NameValueTables \n        \n        Each NVT is converted to a python dict\n\n        Returns:\n            (list[dict[str, str]]) A list of NVTs, where each NVT is a\n            dictionary with string keys and string values\n        ";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_125get_NVTs = {"get_NVTs", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_125get_NVTs, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_124get_NVTs};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_125get_NVTs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_NVTs (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_124get_NVTs(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_124get_NVTs(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_NVTs", 0);

  /* "pysdif/_pysdif.pyx":2293
 *             dictionary with string keys and string values
 *         """
 *         return valuetables_to_dicts(self.this.NameValues)             # <<<<<<<<<<<<<<
 * 
 *     def get_stream_IDs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_valuetables_to_dicts(__pyx_v_self->this->NameValues); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":2283
 *         return MatrixTypesTable_to_list(self.this.MatrixTypesTable)
 * 
 *     def get_NVTs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list with all defined NameValueTables
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.get_NVTs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":2295
 *         return valuetables_to_dicts(self.this.NameValues)
 * 
 *     def get_stream_IDs(self):             # <<<<<<<<<<<<<<
 *         return streamidtable_to_list(self.this.StreamIDsTable)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_127get_stream_IDs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_126get_stream_IDs[] = "SdifFile.get_stream_IDs(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_127get_stream_IDs = {"get_stream_IDs", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_127get_stream_IDs, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_126get_stream_IDs};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_127get_stream_IDs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_stream_IDs (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_126get_stream_IDs(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_126get_stream_IDs(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_stream_IDs", 0);

  /* "pysdif/_pysdif.pyx":2296
 * 
 *     def get_stream_IDs(self):
 *         return streamidtable_to_list(self.this.StreamIDsTable)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_streamidtable_to_list(__pyx_v_self->this->StreamIDsTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pysdif/_pysdif.pyx":2295
 *         return valuetables_to_dicts(self.this.NameValues)
 * 
 *     def get_stream_IDs(self):             # <<<<<<<<<<<<<<
 *         return streamidtable_to_list(self.this.StreamIDsTable)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.get_stream_IDs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysdif/_pysdif.pyx":1134
 *     """
 *     cdef SdifFileT *this
 *     cdef readonly int eof             # <<<<<<<<<<<<<<
 *     cdef FrameR frame
 *     cdef Matrix matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_3eof_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_3eof_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_3eof___get__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_3eof___get__(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->eof); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.eof.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_128__reduce_cython__[] = "SdifFile.__reduce_cython__(self)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_129__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_129__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_128__reduce_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_128__reduce_cython__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __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)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_130__setstate_cython__[] = "SdifFile.__setstate_cython__(self, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_8SdifFile_131__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_131__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_130__setstate_cython__};
static PyObject *__pyx_pw_6pysdif_7_pysdif_8SdifFile_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_8SdifFile_130__setstate_cython__(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_130__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __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)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_MatrixTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_23__pyx_unpickle_MatrixTypeDefinition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_22__pyx_unpickle_MatrixTypeDefinition[] = "__pyx_unpickle_MatrixTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_23__pyx_unpickle_MatrixTypeDefinition = {"__pyx_unpickle_MatrixTypeDefinition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_23__pyx_unpickle_MatrixTypeDefinition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_22__pyx_unpickle_MatrixTypeDefinition};
static PyObject *__pyx_pw_6pysdif_7_pysdif_23__pyx_unpickle_MatrixTypeDefinition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_MatrixTypeDefinition (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_MatrixTypeDefinition", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_MatrixTypeDefinition", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_MatrixTypeDefinition") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_MatrixTypeDefinition", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_MatrixTypeDefinition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_22__pyx_unpickle_MatrixTypeDefinition(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_22__pyx_unpickle_MatrixTypeDefinition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_MatrixTypeDefinition", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3fbaffb:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3fbaffb = (column_names, signature))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x3fbaffb) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3fbaffb:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3fbaffb = (column_names, signature))" % __pyx_checksum)
 *     __pyx_result = MatrixTypeDefinition.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x3fbaffb:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3fbaffb = (column_names, signature))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = MatrixTypeDefinition.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x3f, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3fbaffb:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3fbaffb = (column_names, signature))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3fbaffb = (column_names, signature))" % __pyx_checksum)
 *     __pyx_result = MatrixTypeDefinition.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_MatrixTypeDefinition__set_state(<MatrixTypeDefinition> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3fbaffb = (column_names, signature))" % __pyx_checksum)
 *     __pyx_result = MatrixTypeDefinition.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_MatrixTypeDefinition__set_state(<MatrixTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = MatrixTypeDefinition.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_MatrixTypeDefinition__set_state(<MatrixTypeDefinition> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_MatrixTypeDefinition__set_state(MatrixTypeDefinition __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_6pysdif_7_pysdif___pyx_unpickle_MatrixTypeDefinition__set_state(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3fbaffb = (column_names, signature))" % __pyx_checksum)
 *     __pyx_result = MatrixTypeDefinition.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_MatrixTypeDefinition__set_state(<MatrixTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_MatrixTypeDefinition__set_state(<MatrixTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_MatrixTypeDefinition__set_state(MatrixTypeDefinition __pyx_result, tuple __pyx_state):
 *     __pyx_result.column_names = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_MatrixTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_MatrixTypeDefinition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_MatrixTypeDefinition__set_state(<MatrixTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_MatrixTypeDefinition__set_state(MatrixTypeDefinition __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.column_names = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_6pysdif_7_pysdif___pyx_unpickle_MatrixTypeDefinition__set_state(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_MatrixTypeDefinition__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_MatrixTypeDefinition__set_state(MatrixTypeDefinition __pyx_result, tuple __pyx_state):
 *     __pyx_result.column_names = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->column_names);
  __Pyx_DECREF(__pyx_v___pyx_result->column_names);
  __pyx_v___pyx_result->column_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->signature);
  __Pyx_DECREF(__pyx_v___pyx_result->signature);
  __pyx_v___pyx_result->signature = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_MatrixTypeDefinition__set_state(MatrixTypeDefinition __pyx_result, tuple __pyx_state):
 *     __pyx_result.column_names = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 2) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.column_names = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[2])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_MatrixTypeDefinition__set_state(MatrixTypeDefinition __pyx_result, tuple __pyx_state):
 *     __pyx_result.column_names = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_MatrixTypeDefinition__set_state(<MatrixTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_MatrixTypeDefinition__set_state(MatrixTypeDefinition __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.column_names = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_MatrixTypeDefinition__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Component(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_25__pyx_unpickle_Component(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_24__pyx_unpickle_Component[] = "__pyx_unpickle_Component(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_25__pyx_unpickle_Component = {"__pyx_unpickle_Component", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_25__pyx_unpickle_Component, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_24__pyx_unpickle_Component};
static PyObject *__pyx_pw_6pysdif_7_pysdif_25__pyx_unpickle_Component(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Component (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Component", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Component", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Component") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Component", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_Component", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_24__pyx_unpickle_Component(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_24__pyx_unpickle_Component(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Component", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x13edf36:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x13edf36 = (name, num, signature))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x13edf36) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x13edf36:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x13edf36 = (name, num, signature))" % __pyx_checksum)
 *     __pyx_result = Component.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x13edf36:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x13edf36 = (name, num, signature))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Component.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x13, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x13edf36:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x13edf36 = (name, num, signature))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x13edf36 = (name, num, signature))" % __pyx_checksum)
 *     __pyx_result = Component.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Component__set_state(<Component> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_Component), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x13edf36 = (name, num, signature))" % __pyx_checksum)
 *     __pyx_result = Component.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Component__set_state(<Component> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = Component.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Component__set_state(<Component> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Component__set_state(Component __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_6pysdif_7_pysdif___pyx_unpickle_Component__set_state(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x13edf36 = (name, num, signature))" % __pyx_checksum)
 *     __pyx_result = Component.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Component__set_state(<Component> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Component__set_state(<Component> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Component__set_state(Component __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]; __pyx_result.num = __pyx_state[1]; __pyx_result.signature = __pyx_state[2]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Component(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_Component", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Component__set_state(<Component> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Component__set_state(Component __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]; __pyx_result.num = __pyx_state[1]; __pyx_result.signature = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_6pysdif_7_pysdif___pyx_unpickle_Component__set_state(struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Component__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Component__set_state(Component __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]; __pyx_result.num = __pyx_state[1]; __pyx_result.signature = __pyx_state[2]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->name);
  __Pyx_DECREF(__pyx_v___pyx_result->name);
  __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->signature);
  __Pyx_DECREF(__pyx_v___pyx_result->signature);
  __pyx_v___pyx_result->signature = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Component__set_state(Component __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]; __pyx_result.num = __pyx_state[1]; __pyx_result.signature = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_5 = ((__pyx_t_4 > 3) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __pyx_result.name = __pyx_state[0]; __pyx_result.num = __pyx_state[1]; __pyx_result.signature = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])             # <<<<<<<<<<<<<<
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Component__set_state(Component __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]; __pyx_result.num = __pyx_state[1]; __pyx_result.signature = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Component__set_state(<Component> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Component__set_state(Component __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]; __pyx_result.num = __pyx_state[1]; __pyx_result.signature = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_Component__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_FrameTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_27__pyx_unpickle_FrameTypeDefinition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_26__pyx_unpickle_FrameTypeDefinition[] = "__pyx_unpickle_FrameTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_27__pyx_unpickle_FrameTypeDefinition = {"__pyx_unpickle_FrameTypeDefinition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_27__pyx_unpickle_FrameTypeDefinition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_26__pyx_unpickle_FrameTypeDefinition};
static PyObject *__pyx_pw_6pysdif_7_pysdif_27__pyx_unpickle_FrameTypeDefinition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FrameTypeDefinition (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameTypeDefinition", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameTypeDefinition", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_FrameTypeDefinition") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameTypeDefinition", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_FrameTypeDefinition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_26__pyx_unpickle_FrameTypeDefinition(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_26__pyx_unpickle_FrameTypeDefinition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FrameTypeDefinition", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3698374:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3698374 = (components, signature))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x3698374) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3698374:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3698374 = (components, signature))" % __pyx_checksum)
 *     __pyx_result = FrameTypeDefinition.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x3698374:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3698374 = (components, signature))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = FrameTypeDefinition.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x36, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3698374:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3698374 = (components, signature))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3698374 = (components, signature))" % __pyx_checksum)
 *     __pyx_result = FrameTypeDefinition.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FrameTypeDefinition__set_state(<FrameTypeDefinition> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3698374 = (components, signature))" % __pyx_checksum)
 *     __pyx_result = FrameTypeDefinition.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FrameTypeDefinition__set_state(<FrameTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = FrameTypeDefinition.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FrameTypeDefinition__set_state(<FrameTypeDefinition> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameTypeDefinition__set_state(FrameTypeDefinition __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_6pysdif_7_pysdif___pyx_unpickle_FrameTypeDefinition__set_state(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3698374 = (components, signature))" % __pyx_checksum)
 *     __pyx_result = FrameTypeDefinition.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FrameTypeDefinition__set_state(<FrameTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FrameTypeDefinition__set_state(<FrameTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FrameTypeDefinition__set_state(FrameTypeDefinition __pyx_result, tuple __pyx_state):
 *     __pyx_result.components = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_FrameTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_FrameTypeDefinition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FrameTypeDefinition__set_state(<FrameTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameTypeDefinition__set_state(FrameTypeDefinition __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.components = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_6pysdif_7_pysdif___pyx_unpickle_FrameTypeDefinition__set_state(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FrameTypeDefinition__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameTypeDefinition__set_state(FrameTypeDefinition __pyx_result, tuple __pyx_state):
 *     __pyx_result.components = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->components);
  __Pyx_DECREF(__pyx_v___pyx_result->components);
  __pyx_v___pyx_result->components = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->signature);
  __Pyx_DECREF(__pyx_v___pyx_result->signature);
  __pyx_v___pyx_result->signature = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_FrameTypeDefinition__set_state(FrameTypeDefinition __pyx_result, tuple __pyx_state):
 *     __pyx_result.components = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 2) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.components = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[2])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_FrameTypeDefinition__set_state(FrameTypeDefinition __pyx_result, tuple __pyx_state):
 *     __pyx_result.components = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_FrameTypeDefinition__set_state(<FrameTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameTypeDefinition__set_state(FrameTypeDefinition __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.components = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_FrameTypeDefinition__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_FrameW(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pysdif_7_pysdif_29__pyx_unpickle_FrameW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_28__pyx_unpickle_FrameW[] = "__pyx_unpickle_FrameW(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_6pysdif_7_pysdif_29__pyx_unpickle_FrameW = {"__pyx_unpickle_FrameW", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_29__pyx_unpickle_FrameW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_28__pyx_unpickle_FrameW};
static PyObject *__pyx_pw_6pysdif_7_pysdif_29__pyx_unpickle_FrameW(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FrameW (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameW", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameW", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_FrameW") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameW", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_FrameW", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pysdif_7_pysdif_28__pyx_unpickle_FrameW(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pysdif_7_pysdif_28__pyx_unpickle_FrameW(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FrameW", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x0cc732b:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0cc732b = (_written, frame_size, matrices, num_matrices, sdiffile, signature, signatures, streamID, time))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x0cc732b) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x0cc732b:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0cc732b = (_written, frame_size, matrices, num_matrices, sdiffile, signature, signatures, streamID, time))" % __pyx_checksum)
 *     __pyx_result = FrameW.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x0cc732b:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0cc732b = (_written, frame_size, matrices, num_matrices, sdiffile, signature, signatures, streamID, time))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = FrameW.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x0c, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x0cc732b:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0cc732b = (_written, frame_size, matrices, num_matrices, sdiffile, signature, signatures, streamID, time))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0cc732b = (_written, frame_size, matrices, num_matrices, sdiffile, signature, signatures, streamID, time))" % __pyx_checksum)
 *     __pyx_result = FrameW.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FrameW__set_state(<FrameW> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameW), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0cc732b = (_written, frame_size, matrices, num_matrices, sdiffile, signature, signatures, streamID, time))" % __pyx_checksum)
 *     __pyx_result = FrameW.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FrameW__set_state(<FrameW> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = FrameW.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FrameW__set_state(<FrameW> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameW__set_state(FrameW __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_6pysdif_7_pysdif___pyx_unpickle_FrameW__set_state(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0cc732b = (_written, frame_size, matrices, num_matrices, sdiffile, signature, signatures, streamID, time))" % __pyx_checksum)
 *     __pyx_result = FrameW.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FrameW__set_state(<FrameW> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FrameW__set_state(<FrameW> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FrameW__set_state(FrameW __pyx_result, tuple __pyx_state):
 *     __pyx_result._written = __pyx_state[0]; __pyx_result.frame_size = __pyx_state[1]; __pyx_result.matrices = __pyx_state[2]; __pyx_result.num_matrices = __pyx_state[3]; __pyx_result.sdiffile = __pyx_state[4]; __pyx_result.signature = __pyx_state[5]; __pyx_result.signatures = __pyx_state[6]; __pyx_result.streamID = __pyx_state[7]; __pyx_result.time = __pyx_state[8]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_FrameW(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_FrameW", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FrameW__set_state(<FrameW> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameW__set_state(FrameW __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._written = __pyx_state[0]; __pyx_result.frame_size = __pyx_state[1]; __pyx_result.matrices = __pyx_state[2]; __pyx_result.num_matrices = __pyx_state[3]; __pyx_result.sdiffile = __pyx_state[4]; __pyx_result.signature = __pyx_state[5]; __pyx_result.signatures = __pyx_state[6]; __pyx_result.streamID = __pyx_state[7]; __pyx_result.time = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_6pysdif_7_pysdif___pyx_unpickle_FrameW__set_state(struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  SdifUInt4 __pyx_t_3;
  SdifSignature __pyx_t_4;
  SdifFloat8 __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FrameW__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameW__set_state(FrameW __pyx_result, tuple __pyx_state):
 *     __pyx_result._written = __pyx_state[0]; __pyx_result.frame_size = __pyx_state[1]; __pyx_result.matrices = __pyx_state[2]; __pyx_result.num_matrices = __pyx_state[3]; __pyx_result.sdiffile = __pyx_state[4]; __pyx_result.signature = __pyx_state[5]; __pyx_result.signatures = __pyx_state[6]; __pyx_result.streamID = __pyx_state[7]; __pyx_result.time = __pyx_state[8]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[9])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_written = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_SdifUInt4(__pyx_t_1); if (unlikely((__pyx_t_3 == ((SdifUInt4)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->frame_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->matrices);
  __Pyx_DECREF(__pyx_v___pyx_result->matrices);
  __pyx_v___pyx_result->matrices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_SdifUInt4(__pyx_t_1); if (unlikely((__pyx_t_3 == ((SdifUInt4)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num_matrices = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pysdif_7_pysdif_SdifFile))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->sdiffile);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->sdiffile));
  __pyx_v___pyx_result->sdiffile = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_SdifUInt4(__pyx_t_1); if (unlikely((__pyx_t_4 == ((SdifSignature)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->signature = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->signatures);
  __Pyx_DECREF(__pyx_v___pyx_result->signatures);
  __pyx_v___pyx_result->signatures = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_SdifUInt4(__pyx_t_1); if (unlikely((__pyx_t_3 == ((SdifUInt4)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->streamID = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == ((SdifFloat8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->time = __pyx_t_5;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_FrameW__set_state(FrameW __pyx_result, tuple __pyx_state):
 *     __pyx_result._written = __pyx_state[0]; __pyx_result.frame_size = __pyx_state[1]; __pyx_result.matrices = __pyx_state[2]; __pyx_result.num_matrices = __pyx_state[3]; __pyx_result.sdiffile = __pyx_state[4]; __pyx_result.signature = __pyx_state[5]; __pyx_result.signatures = __pyx_state[6]; __pyx_result.streamID = __pyx_state[7]; __pyx_result.time = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[9])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_8 = ((__pyx_t_7 > 9) != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_9 = (__pyx_t_8 != 0);
  __pyx_t_6 = __pyx_t_9;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "(tree fragment)":14
 *     __pyx_result._written = __pyx_state[0]; __pyx_result.frame_size = __pyx_state[1]; __pyx_result.matrices = __pyx_state[2]; __pyx_result.num_matrices = __pyx_state[3]; __pyx_result.sdiffile = __pyx_state[4]; __pyx_result.signature = __pyx_state[5]; __pyx_result.signatures = __pyx_state[6]; __pyx_result.streamID = __pyx_state[7]; __pyx_result.time = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[9])             # <<<<<<<<<<<<<<
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_update); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_FrameW__set_state(FrameW __pyx_result, tuple __pyx_state):
 *     __pyx_result._written = __pyx_state[0]; __pyx_result.frame_size = __pyx_state[1]; __pyx_result.matrices = __pyx_state[2]; __pyx_result.num_matrices = __pyx_state[3]; __pyx_result.sdiffile = __pyx_state[4]; __pyx_result.signature = __pyx_state[5]; __pyx_result.signatures = __pyx_state[6]; __pyx_result.streamID = __pyx_state[7]; __pyx_result.time = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[9])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_FrameW__set_state(<FrameW> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameW__set_state(FrameW __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._written = __pyx_state[0]; __pyx_result.frame_size = __pyx_state[1]; __pyx_result.matrices = __pyx_state[2]; __pyx_result.num_matrices = __pyx_state[3]; __pyx_result.sdiffile = __pyx_state[4]; __pyx_result.signature = __pyx_state[5]; __pyx_result.signatures = __pyx_state[6]; __pyx_result.streamID = __pyx_state[7]; __pyx_result.time = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pysdif._pysdif.__pyx_unpickle_FrameW__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":735
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":736
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":735
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":738
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":739
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":738
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":741
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":742
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":741
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":744
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":745
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":744
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":747
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":748
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":747
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":750
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":751
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
  if (__pyx_t_1) {

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":752
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
    __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
    goto __pyx_L0;

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":751
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  }

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":754
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_r = __pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":750
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":929
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":930
 * 
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
 */
  Py_INCREF(__pyx_v_base);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":931
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":929
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":933
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":934
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
 */
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":935
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
  if (__pyx_t_1) {

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":936
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":935
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  }

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":937
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":933
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":941
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_array", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":943
 * cdef inline int import_array() except -1:
 *     try:
 *         __pyx_import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")
 */
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":944
 *     try:
 *         __pyx_import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":945
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 945, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":941
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":947
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_umath", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":949
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":950
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":951
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 951, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":947
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":953
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":955
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":956
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":957
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef extern from *:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 957, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":953
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":967
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":979
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":967
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":982
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_datetime64_object", 0);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":994
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":982
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":997
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
  npy_datetime __pyx_r;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":1004
 *     also needed.  That can be found using `get_datetime64_unit`.
 *     """
 *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":997
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":1007
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
  npy_timedelta __pyx_r;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":1011
 *     returns the int64 value underlying scalar numpy timedelta64 object
 *     """
 *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":1007
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":1014
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
  NPY_DATETIMEUNIT __pyx_r;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":1018
 *     returns the unit part of the dtype for a numpy datetime64 object.
 *     """
 *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
  goto __pyx_L0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":1014
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_StreamID(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_6pysdif_7_pysdif_8StreamID_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_StreamID(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  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))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_6pysdif_7_pysdif_8StreamID_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8StreamID_numid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8StreamID_5numid_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8StreamID_source(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8StreamID_6source_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8StreamID_treeway(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8StreamID_7treeway_1__get__(o);
}

static PyMethodDef __pyx_methods_6pysdif_7_pysdif_StreamID[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8StreamID_7__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8StreamID_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8StreamID_9__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_8StreamID_8__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_StreamID[] = {
  {(char *)"numid", __pyx_getprop_6pysdif_7_pysdif_8StreamID_numid, 0, (char *)0, 0},
  {(char *)"source", __pyx_getprop_6pysdif_7_pysdif_8StreamID_source, 0, (char *)0, 0},
  {(char *)"treeway", __pyx_getprop_6pysdif_7_pysdif_8StreamID_treeway, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pysdif_7_pysdif_StreamID = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.StreamID", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_StreamID), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_StreamID, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pysdif_7_pysdif_8StreamID_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_StreamID, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_StreamID, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_StreamID, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_6pysdif_7_pysdif_MatrixTypeDefinition __pyx_vtable_6pysdif_7_pysdif_MatrixTypeDefinition;

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_MatrixTypeDefinition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pysdif_7_pysdif_MatrixTypeDefinition;
  p->signature = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->column_names = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_MatrixTypeDefinition(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->signature);
  Py_CLEAR(p->column_names);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_MatrixTypeDefinition(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)o;
  if (p->column_names) {
    e = (*v)(p->column_names, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_MatrixTypeDefinition(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)o;
  tmp = ((PyObject*)p->column_names);
  p->column_names = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_20MatrixTypeDefinition_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_1__get__(o);
}

static int __pyx_setprop_6pysdif_7_pysdif_20MatrixTypeDefinition_signature(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_3__set__(o, v);
  }
  else {
    return __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_9signature_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_20MatrixTypeDefinition_column_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_1__get__(o);
}

static int __pyx_setprop_6pysdif_7_pysdif_20MatrixTypeDefinition_column_names(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_3__set__(o, v);
  }
  else {
    return __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6pysdif_7_pysdif_MatrixTypeDefinition[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_5__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_20MatrixTypeDefinition_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_7__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_20MatrixTypeDefinition_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_MatrixTypeDefinition[] = {
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_20MatrixTypeDefinition_signature, __pyx_setprop_6pysdif_7_pysdif_20MatrixTypeDefinition_signature, (char *)"signature: bytes", 0},
  {(char *)"column_names", __pyx_getprop_6pysdif_7_pysdif_20MatrixTypeDefinition_column_names, __pyx_setprop_6pysdif_7_pysdif_20MatrixTypeDefinition_column_names, (char *)"column_names: list", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.MatrixTypeDefinition", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "MatrixTypeDefinition(signature, list column_names)", /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pysdif_7_pysdif_20MatrixTypeDefinition_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_Component(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_Component *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_Component *)o);
  p->signature = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_Component(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_Component *p = (struct __pyx_obj_6pysdif_7_pysdif_Component *)o;
  #if CYTHON_USE_TP_FINALIZE
  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))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  Py_CLEAR(p->signature);
  Py_CLEAR(p->name);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_9Component_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_9Component_9signature_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_9Component_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_9Component_4name_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_9Component_num(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_9Component_3num_1__get__(o);
}

static PyMethodDef __pyx_methods_6pysdif_7_pysdif_Component[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_9Component_5__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_9Component_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_9Component_7__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_9Component_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_Component[] = {
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_9Component_signature, 0, (char *)0, 0},
  {(char *)"name", __pyx_getprop_6pysdif_7_pysdif_9Component_name, 0, (char *)0, 0},
  {(char *)"num", __pyx_getprop_6pysdif_7_pysdif_9Component_num, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pysdif_7_pysdif_Component = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.Component", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_Component), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_Component, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pysdif_7_pysdif_9Component_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Component(signature, name, num=0)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_Component, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_Component, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pysdif_7_pysdif_9Component_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_Component, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameTypeDefinition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)o);
  p->signature = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->components = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_FrameTypeDefinition(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->signature);
  Py_CLEAR(p->components);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_FrameTypeDefinition(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)o;
  if (p->components) {
    e = (*v)(p->components, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_FrameTypeDefinition(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)o;
  tmp = ((PyObject*)p->components);
  p->components = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_19FrameTypeDefinition_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_9signature_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_19FrameTypeDefinition_components(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_10components_1__get__(o);
}

static PyMethodDef __pyx_methods_6pysdif_7_pysdif_FrameTypeDefinition[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_5__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_19FrameTypeDefinition_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_7__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_19FrameTypeDefinition_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_FrameTypeDefinition[] = {
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_19FrameTypeDefinition_signature, 0, (char *)0, 0},
  {(char *)"components", __pyx_getprop_6pysdif_7_pysdif_19FrameTypeDefinition_components, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pysdif_7_pysdif_FrameTypeDefinition = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.FrameTypeDefinition", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "FrameTypeDefinition(signature, components)", /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pysdif_7_pysdif_19FrameTypeDefinition_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameR(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)o);
  p->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_6pysdif_7_pysdif_6FrameR_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_FrameR(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameR *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_6pysdif_7_pysdif_6FrameR_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->source);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_FrameR(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameR *)o;
  if (p->source) {
    e = (*v)(((PyObject *)p->source), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_FrameR(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameR *)o;
  tmp = ((PyObject*)p->source);
  p->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6FrameR_9signature_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_numerical_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6FrameR_19numerical_signature_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6FrameR_4size_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_num_matrices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6FrameR_12num_matrices_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6FrameR_2id_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_time(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6FrameR_4time_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_matrix_idx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6FrameR_10matrix_idx_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_6pysdif_7_pysdif_6FrameR_11__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6pysdif_7_pysdif_6FrameR_11__next__(self);}

static PyMethodDef __pyx_methods_6pysdif_7_pysdif_FrameR[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6pysdif_7_pysdif_6FrameR_11__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_6pysdif_7_pysdif_6FrameR_10__next__},
  {"get_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_6FrameR_13get_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_6FrameR_12get_matrix},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameR_15__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6FrameR_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameR_17__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_6FrameR_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_FrameR[] = {
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_6FrameR_signature, 0, (char *)" (str) The string signature of this frame ", 0},
  {(char *)"numerical_signature", __pyx_getprop_6pysdif_7_pysdif_6FrameR_numerical_signature, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop_6pysdif_7_pysdif_6FrameR_size, 0, (char *)"\n        (int) The size of this frame in bytes\n        ", 0},
  {(char *)"num_matrices", __pyx_getprop_6pysdif_7_pysdif_6FrameR_num_matrices, 0, (char *)"\n        (int) The number of matrices in this frame\n        ", 0},
  {(char *)"id", __pyx_getprop_6pysdif_7_pysdif_6FrameR_id, 0, (char *)" (int) The id of this frame ", 0},
  {(char *)"time", __pyx_getprop_6pysdif_7_pysdif_6FrameR_time, 0, (char *)" (float) The time of this frame ", 0},
  {(char *)"matrix_idx", __pyx_getprop_6pysdif_7_pysdif_6FrameR_matrix_idx, 0, (char *)"The index of the current matrix", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_FrameR = {
  __pyx_pw_6pysdif_7_pysdif_6FrameR_7__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FrameR = {
  __pyx_pw_6pysdif_7_pysdif_6FrameR_7__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_6pysdif_7_pysdif_FrameR = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.FrameR", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_FrameR), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_FrameR, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pysdif_7_pysdif_6FrameR_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_FrameR, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FrameR, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    FrameR is an iterator over the matrices of a frame. \n    \n    Access the matrices by iterating on the frame, or calling \n    next(frame). \n\n    !!! note\n\n        A `FrameR` is not created by a user, it is yielded by\n        a SdifFile on iteration.\n\n    Args:\n        source (SdifFile): the sidffile this frame belongs to\n\n    ## Example\n    \n    ```python\n\n    import pysdif\n    sdiffile = pysdif.SdifFile(\"1trc.sdif\")\n    # Iterating over a SdifFile open for reading yields FrameR\n    for frame in sdiffile:\n        print(frame.signature, frame.time)\n        # iterating over a frame yields the matrices present in the frame\n        for matrix in frame:\n            print(matrix.signature, matrix.get_data())\n    \n    ```\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_FrameR, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_FrameR, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_6pysdif_7_pysdif_6FrameR_9__iter__, /*tp_iter*/
  __pyx_pw_6pysdif_7_pysdif_6FrameR_11__next__, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_FrameR, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_FrameR, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_FrameR, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile __pyx_vtable_6pysdif_7_pysdif_SdifFile;

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_SdifFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pysdif_7_pysdif_SdifFile;
  p->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)Py_None); Py_INCREF(Py_None);
  p->matrix = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)Py_None); Py_INCREF(Py_None);
  p->_frametypes_defined = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_matrixtypes_defined = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_6pysdif_7_pysdif_8SdifFile_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_SdifFile(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *p = (struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_6pysdif_7_pysdif_8SdifFile_7__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->frame);
  Py_CLEAR(p->matrix);
  Py_CLEAR(p->_frametypes_defined);
  Py_CLEAR(p->_matrixtypes_defined);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_SdifFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *p = (struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)o;
  if (p->frame) {
    e = (*v)(((PyObject *)p->frame), a); if (e) return e;
  }
  if (p->matrix) {
    e = (*v)(((PyObject *)p->matrix), a); if (e) return e;
  }
  if (p->_frametypes_defined) {
    e = (*v)(p->_frametypes_defined, a); if (e) return e;
  }
  if (p->_matrixtypes_defined) {
    e = (*v)(p->_matrixtypes_defined, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_SdifFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *p = (struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)o;
  tmp = ((PyObject*)p->frame);
  p->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->matrix);
  p->matrix = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_frametypes_defined);
  p->_frametypes_defined = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_matrixtypes_defined);
  p->_matrixtypes_defined = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_4name_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_is_seekable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_11is_seekable_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_numerical_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_19numerical_signature_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_9signature_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_prev_time(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_9prev_time_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_9frame_pos_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_3pos_1__get__(o);
}

static int __pyx_setprop_6pysdif_7_pysdif_8SdifFile_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6pysdif_7_pysdif_8SdifFile_3pos_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_eof(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_8SdifFile_3eof_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_6pysdif_7_pysdif_8SdifFile_59__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6pysdif_7_pysdif_8SdifFile_59__next__(self);}

static PyMethodDef __pyx_methods_6pysdif_7_pysdif_SdifFile[] = {
  {"close", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_9close, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_8close},
  {"curr_matrix_size", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_11curr_matrix_size, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_10curr_matrix_size},
  {"curr_matrix_datatype", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_13curr_matrix_datatype, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_12curr_matrix_datatype},
  {"curr_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_15curr_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_14curr_signature},
  {"curr_matrix_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_17curr_matrix_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_16curr_matrix_signature},
  {"frame_num_matrix", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_19frame_num_matrix, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_18frame_num_matrix},
  {"frame_id", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_21frame_id, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_20frame_id},
  {"frame_numerical_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_23frame_numerical_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_22frame_numerical_signature},
  {"frame_signature", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_25frame_signature, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_24frame_signature},
  {"frame_time", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_27frame_time, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_26frame_time},
  {"last_error", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_29last_error, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_28last_error},
  {"curr_frame_is_selected", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_31curr_frame_is_selected, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_30curr_frame_is_selected},
  {"curr_matrix_is_selected", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_33curr_matrix_is_selected, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_32curr_matrix_is_selected},
  {"get_num_NVTs", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_35get_num_NVTs, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_34get_num_NVTs},
  {"frame_read_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_37frame_read_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_36frame_read_header},
  {"frame_skip_data", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_39frame_skip_data, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_38frame_skip_data},
  {"matrix_read_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_43matrix_read_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_42matrix_read_header},
  {"curr_frame_available", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_45curr_frame_available, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_44curr_frame_available},
  {"curr_matrix_available", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_47curr_matrix_available, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_46curr_matrix_available},
  {"matrix_skip_data", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_49matrix_skip_data, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_48matrix_skip_data},
  {"matrix_read_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_51matrix_read_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_50matrix_read_data},
  {"matrix_skip", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_53matrix_skip, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_52matrix_skip},
  {"status", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_55status, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_54status},
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6pysdif_7_pysdif_8SdifFile_59__next__, METH_NOARGS|METH_COEXIST, 0},
  {"next_frame", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_61next_frame, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_60next_frame},
  {"__enter__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_63__enter__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_62__enter__},
  {"__exit__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_65__exit__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_64__exit__},
  {"frame_skip_rest", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_67frame_skip_rest, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_66frame_skip_rest},
  {"next_matrix", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_69next_matrix, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_68next_matrix},
  {"rewind", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_71rewind, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_70rewind},
  {"_rewind", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_73_rewind, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_72_rewind},
  {"_read_padding", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_75_read_padding, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_74_read_padding},
  {"add_NVT", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_77add_NVT, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_76add_NVT},
  {"add_matrix_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_79add_matrix_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_78add_matrix_type},
  {"add_frame_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_81add_frame_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_80add_frame_type},
  {"clone_type_definitions", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_83clone_type_definitions, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_82clone_type_definitions},
  {"clone_NVTs", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_85clone_NVTs, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_84clone_NVTs},
  {"clone_definitions", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_87clone_definitions, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_86clone_definitions},
  {"clone_frames", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_89clone_frames, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_88clone_frames},
  {"add_streamID", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_91add_streamID, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_90add_streamID},
  {"add_predefined_frametype", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_93add_predefined_frametype, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_92add_predefined_frametype},
  {"write_all_ascii_chunks", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_95write_all_ascii_chunks, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_94write_all_ascii_chunks},
  {"new_frame", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_97new_frame, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_96new_frame},
  {"new_frame_one_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_8SdifFile_99new_frame_one_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_98new_frame_one_matrix},
  {"print_NVT", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_101print_NVT, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_100print_NVT},
  {"print_general_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_103print_general_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_102print_general_header},
  {"print_all_ascii_chunks", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_105print_all_ascii_chunks, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_104print_all_ascii_chunks},
  {"print_all_types", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_107print_all_types, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_106print_all_types},
  {"print_matrix_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_109print_matrix_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_108print_matrix_header},
  {"print_one_row", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_111print_one_row, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_110print_one_row},
  {"print_frame_header", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_113print_frame_header, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_112print_frame_header},
  {"print_all_stream_ID", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_115print_all_stream_ID, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_114print_all_stream_ID},
  {"frame_types_to_string", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_117frame_types_to_string, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_116frame_types_to_string},
  {"get_frame_types", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_119get_frame_types, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_118get_frame_types},
  {"matrix_types_to_string", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_121matrix_types_to_string, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_120matrix_types_to_string},
  {"get_matrix_types", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_123get_matrix_types, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_122get_matrix_types},
  {"get_NVTs", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_125get_NVTs, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_124get_NVTs},
  {"get_stream_IDs", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_127get_stream_IDs, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_126get_stream_IDs},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_129__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_8SdifFile_128__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_8SdifFile_131__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_8SdifFile_130__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_SdifFile[] = {
  {(char *)"name", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_name, 0, (char *)0, 0},
  {(char *)"mode", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_mode, 0, (char *)0, 0},
  {(char *)"is_seekable", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_is_seekable, 0, (char *)"\n        (bool) Is this SdifFile seekable?\n        ", 0},
  {(char *)"numerical_signature", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_numerical_signature, 0, (char *)"\n        (int) Current signature as numerical signature\n        ", 0},
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_signature, 0, (char *)"(str) Current signature as 4-byte string ", 0},
  {(char *)"prev_time", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_prev_time, 0, (char *)"(float)", 0},
  {(char *)"frame_pos", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_pos, 0, (char *)0, 0},
  {(char *)"pos", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_pos, __pyx_setprop_6pysdif_7_pysdif_8SdifFile_pos, (char *)"The last position read", 0},
  {(char *)"eof", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_eof, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pysdif_7_pysdif_SdifFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.SdifFile", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_SdifFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_SdifFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pysdif_7_pysdif_8SdifFile_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "SdifFile(str filename, mode='r')\n\n    This is a wrapper around a SdifFileT c-struct (`sdif.h`)\n    \n    It enables to read and write a SDIF file of any form.\n    It provides **two interfaces**: a **low-level interface**, which\n    reflects the original implementation and requires that the \n    user is acquainted with the internal structure of a SDIF file; and\n    a **high-level interface** which takes care of most of the book-keeping.\n\n    ```python\n    \n    SdifFile(filename: str, mode=\"r\")\n    \n    ```\n\n    Args:\n        filename (str):  path to a sdif file\n        mode (str): \"r\" = read, \"w\" = write, \"rw\" = read+write\n\n\n    ## Example 1: read a sdiffile \n\n    ** High-Level Interface **\n\n    ```python\n\n    s = SdifFile(\"mysdif.sdif\")\n    for frame in s:\n        print(frame.time)\n        for matrix in frame:\n            numpyarray = matrix.get_data()\n            print(numpyarray)\n    ```\n\n    ** Low-Level Interface **\n\n    ```python\n    s = SdifFile(\"mysdif.sdif\")\n    while True:\n        s.frame_read_header()\n        if s.eof:\n            break\n        print(s.frame_time())\n        for idx in range(s.frame_num_matrix()):\n            print(s.matrix_read_data())\n    ```\n\n    ## Example 2: write a sdiffile\n\n    ```python\n\n    insdif = SdifFile(\"mysdif.sdif\")\n    outsdif = SdifFile(\"outsdif.sdif\", \"w\").clone_definitions(insdif)\n    for inframe in insdif:\n        if inframe.signature != b'1SIG':\n            continue\n        with outsdif.new_frame(inframe.signature, inframe.time) as outframe:\n            for m in inframe:\n                outframe.add_matrix(m.signature, m.get_data())\n    outsdif.close()\n    \n    ```\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_SdifFile, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_SdifFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_6pysdif_7_pysdif_8SdifFile_57__iter__, /*tp_iter*/
  __pyx_pw_6pysdif_7_pysdif_8SdifFile_59__next__, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_SdifFile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_SdifFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pysdif_7_pysdif_8SdifFile_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_SdifFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_Matrix(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)o);
  p->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  p->data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_6pysdif_7_pysdif_6Matrix_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_Matrix(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *p = (struct __pyx_obj_6pysdif_7_pysdif_Matrix *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->source);
  Py_CLEAR(p->data);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_Matrix(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *p = (struct __pyx_obj_6pysdif_7_pysdif_Matrix *)o;
  if (p->source) {
    e = (*v)(((PyObject *)p->source), a); if (e) return e;
  }
  if (p->data) {
    e = (*v)(((PyObject *)p->data), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_Matrix(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *p = (struct __pyx_obj_6pysdif_7_pysdif_Matrix *)o;
  tmp = ((PyObject*)p->source);
  p->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->data);
  p->data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6Matrix_4rows_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6Matrix_4cols_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_dtype(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6Matrix_5dtype_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6Matrix_9signature_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_numerical_signature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6Matrix_19numerical_signature_1__get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6Matrix_6status_1__get__(o);
}

static PyMethodDef __pyx_methods_6pysdif_7_pysdif_Matrix[] = {
  {"get_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_6Matrix_3get_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_6Matrix_2get_data},
  {"column_names", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6Matrix_5column_names, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6Matrix_4column_names},
  {"skip", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6Matrix_7skip, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6Matrix_6skip},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6Matrix_11__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6Matrix_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6Matrix_13__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_6Matrix_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_Matrix[] = {
  {(char *)"rows", __pyx_getprop_6pysdif_7_pysdif_6Matrix_rows, 0, (char *)0, 0},
  {(char *)"cols", __pyx_getprop_6pysdif_7_pysdif_6Matrix_cols, 0, (char *)0, 0},
  {(char *)"dtype", __pyx_getprop_6pysdif_7_pysdif_6Matrix_dtype, 0, (char *)0, 0},
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_6Matrix_signature, 0, (char *)0, 0},
  {(char *)"numerical_signature", __pyx_getprop_6pysdif_7_pysdif_6Matrix_numerical_signature, 0, (char *)0, 0},
  {(char *)"status", __pyx_getprop_6pysdif_7_pysdif_6Matrix_status, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pysdif_7_pysdif_Matrix = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.Matrix", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_Matrix), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_Matrix, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pysdif_7_pysdif_6Matrix_9__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Matrix is a placeholder class to iterate through data while reading a SdifFile\n\n    In particular the default behaviour is that when you are given a Matrix, \n    this is only valid until a new one is read.\n    \n    See the methods `get_data` and `copy` for a better explanation of how to \n    make the data in the Matrix persistent\n\n    Args:\n        source (SdifFile): The source sdiffile this matrix belongs to\n    \n    ## Example\n\n    ```python\n    from pysdif import *\n    sdif = SdifFile(\"1trc.sdif\")\n    for frame in sdif:\n        print(f\"Frame signature: {frame.signature}, time: {frame.time}\")\n        for matrix in frame:\n            print(f\"Matrix shape: {matrix.rows} x {matrix.cols}, \"\n                  f\"dtype={matrix.dtype}, signature: {matrix.signature}\")\n            print(\"Data\", matrix.get_data())\n\n    ```\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_Matrix, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_Matrix, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_Matrix, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_Matrix, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_Matrix, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameW(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)o);
  p->sdiffile = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  p->matrices = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->signatures = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_FrameW(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameW *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->sdiffile);
  Py_CLEAR(p->matrices);
  Py_CLEAR(p->signatures);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_FrameW(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameW *)o;
  if (p->sdiffile) {
    e = (*v)(((PyObject *)p->sdiffile), a); if (e) return e;
  }
  if (p->matrices) {
    e = (*v)(p->matrices, a); if (e) return e;
  }
  if (p->signatures) {
    e = (*v)(p->signatures, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_FrameW(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameW *)o;
  tmp = ((PyObject*)p->sdiffile);
  p->sdiffile = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->matrices);
  p->matrices = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->signatures);
  p->signatures = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameW_written(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pysdif_7_pysdif_6FrameW_7written_1__get__(o);
}

static PyMethodDef __pyx_methods_6pysdif_7_pysdif_FrameW[] = {
  {"__enter__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameW_3__enter__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6FrameW_2__enter__},
  {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_6FrameW_5__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_6FrameW_4__exit__},
  {"add_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pysdif_7_pysdif_6FrameW_7add_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pysdif_7_pysdif_6FrameW_6add_matrix},
  {"write", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameW_9write, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6FrameW_8write},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameW_11__reduce_cython__, METH_NOARGS, __pyx_doc_6pysdif_7_pysdif_6FrameW_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6pysdif_7_pysdif_6FrameW_13__setstate_cython__, METH_O, __pyx_doc_6pysdif_7_pysdif_6FrameW_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_FrameW[] = {
  {(char *)"written", __pyx_getprop_6pysdif_7_pysdif_6FrameW_written, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pysdif_7_pysdif_FrameW = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.FrameW", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_FrameW), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_FrameW, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pysdif_7_pysdif_6FrameW_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Class to write frames to a SdifFile\n    \n    A FrameW is not created directly but is returned by sdiffile.new_frame(...)\n    After creating a new frame, you add matrices via:\n\n    ```python\n\n    framew.add_matrix(signature, numpy_array)\n    \n    ```\n\n    After finishing adding matrices, `.write` must be called:\n    \n    ```python\n    framew.write()\n    ```\n\n    Alternatively you can do:\n\n    ```python\n    with sdiffile.new_frame(sig, time) as frame:\n        frame.add_matrix(matrix_sig, data1) \n        frame.add_matrix(matrix_sig, data2)\n        ...\n    ```\n\n    There is no need to call .write in this case\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_FrameW, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_FrameW, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_FrameW, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_FrameW, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_FrameW, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *__pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct____init__[8];
static int __pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct____init__ = 0;

static PyObject *__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct____init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct____init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__)))) {
    o = (PyObject*)__pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct____init__[--__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct____init__];
    memset(o, 0, sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif___pyx_scope_struct____init__(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_components);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct____init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__)))) {
    __pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct____init__[__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct____init__++] = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6pysdif_7_pysdif___pyx_scope_struct____init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *)o;
  if (p->__pyx_v_components) {
    e = (*v)(p->__pyx_v_components, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif___pyx_scope_struct____init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_components);
  p->__pyx_v_components = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6pysdif_7_pysdif___pyx_scope_struct____init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.__pyx_scope_struct____init__", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct____init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif___pyx_scope_struct____init__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif___pyx_scope_struct____init__, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif___pyx_scope_struct____init__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct____init__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *__pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr[--__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_c);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr[__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *__pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames[8];
static int __pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames = 0;

static PyObject *__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames)))) {
    o = (PyObject*)__pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames[--__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames];
    memset(o, 0, sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_signatures_to_clone);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames)))) {
    __pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames[__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames++] = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *)o;
  if (p->__pyx_v_signatures_to_clone) {
    e = (*v)(p->__pyx_v_signatures_to_clone, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames *)o;
  tmp = ((PyObject*)p->__pyx_v_signatures_to_clone);
  p->__pyx_v_signatures_to_clone = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.__pyx_scope_struct_2_clone_frames", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *__pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr = 0;

static PyObject *__pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr[--__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_sig);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr[__pyx_freecount_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_sig) {
    e = (*v)(p->__pyx_v_sig, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pysdif._pysdif.__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__pysdif(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__pysdif},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "_pysdif",
    __pyx_k_GPL_This_file_is_part_of_pysdif, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1FTD_signature_s_components_s, __pyx_k_1FTD_signature_s_components_s, sizeof(__pyx_k_1FTD_signature_s_components_s), 0, 0, 1, 0},
  {&__pyx_kp_s_1MTD_signature_s_column_names_s, __pyx_k_1MTD_signature_s_column_names_s, sizeof(__pyx_k_1MTD_signature_s_column_names_s), 0, 0, 1, 0},
  {&__pyx_kp_s_A_Frame_can_only_be_iterated_onc, __pyx_k_A_Frame_can_only_be_iterated_onc, sizeof(__pyx_k_A_Frame_can_only_be_iterated_onc), 0, 0, 1, 0},
  {&__pyx_n_s_AllDataRead, __pyx_k_AllDataRead, sizeof(__pyx_k_AllDataRead), 0, 0, 1, 1},
  {&__pyx_kp_s_Attempted_to_read_matrix_header, __pyx_k_Attempted_to_read_matrix_header, sizeof(__pyx_k_Attempted_to_read_matrix_header), 0, 0, 1, 0},
  {&__pyx_kp_s_Attempted_to_read_past_end_of_fi, __pyx_k_Attempted_to_read_past_end_of_fi, sizeof(__pyx_k_Attempted_to_read_past_end_of_fi), 0, 0, 1, 0},
  {&__pyx_kp_s_Can_t_get_the_data_since_it_was, __pyx_k_Can_t_get_the_data_since_it_was, sizeof(__pyx_k_Can_t_get_the_data_since_it_was), 0, 0, 1, 0},
  {&__pyx_kp_s_Can_t_skip_the_matrix_status_is, __pyx_k_Can_t_skip_the_matrix_status_is, sizeof(__pyx_k_Can_t_skip_the_matrix_status_is), 0, 0, 1, 0},
  {&__pyx_n_s_Component, __pyx_k_Component, sizeof(__pyx_k_Component), 0, 0, 1, 1},
  {&__pyx_n_s_Component___reduce_cython, __pyx_k_Component___reduce_cython, sizeof(__pyx_k_Component___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_Component___setstate_cython, __pyx_k_Component___setstate_cython, sizeof(__pyx_k_Component___setstate_cython), 0, 0, 1, 1},
  {&__pyx_kp_s_Component_signature_s_name_s_num, __pyx_k_Component_signature_s_name_s_num, sizeof(__pyx_k_Component_signature_s_name_s_num), 0, 0, 1, 0},
  {&__pyx_kp_s_Could_not_create_frametype, __pyx_k_Could_not_create_frametype, sizeof(__pyx_k_Could_not_create_frametype), 0, 0, 1, 0},
  {&__pyx_kp_s_Could_not_create_matrixtype, __pyx_k_Could_not_create_matrixtype, sizeof(__pyx_k_Could_not_create_matrixtype), 0, 0, 1, 0},
  {&__pyx_kp_s_Could_not_open_s, __pyx_k_Could_not_open_s, sizeof(__pyx_k_Could_not_open_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Could_not_read_matrix_header, __pyx_k_Could_not_read_matrix_header, sizeof(__pyx_k_Could_not_read_matrix_header), 0, 0, 1, 0},
  {&__pyx_n_s_Darwin, __pyx_k_Darwin, sizeof(__pyx_k_Darwin), 0, 0, 1, 1},
  {&__pyx_n_s_DataRead, __pyx_k_DataRead, sizeof(__pyx_k_DataRead), 0, 0, 1, 1},
  {&__pyx_n_s_DataSkipped, __pyx_k_DataSkipped, sizeof(__pyx_k_DataSkipped), 0, 0, 1, 1},
  {&__pyx_n_s_EOFError, __pyx_k_EOFError, sizeof(__pyx_k_EOFError), 0, 0, 1, 1},
  {&__pyx_kp_s_Error_finalizing_Frame, __pyx_k_Error_finalizing_Frame, sizeof(__pyx_k_Error_finalizing_Frame), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_finalizing_matrix, __pyx_k_Error_finalizing_matrix, sizeof(__pyx_k_Error_finalizing_matrix), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_fetch_the_column_names, __pyx_k_Failed_to_fetch_the_column_names, sizeof(__pyx_k_Failed_to_fetch_the_column_names), 0, 0, 1, 0},
  {&__pyx_n_s_FrameR, __pyx_k_FrameR, sizeof(__pyx_k_FrameR), 0, 0, 1, 1},
  {&__pyx_n_s_FrameR___reduce_cython, __pyx_k_FrameR___reduce_cython, sizeof(__pyx_k_FrameR___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_FrameR___setstate_cython, __pyx_k_FrameR___setstate_cython, sizeof(__pyx_k_FrameR___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_FrameR_get_matrix, __pyx_k_FrameR_get_matrix, sizeof(__pyx_k_FrameR_get_matrix), 0, 0, 1, 1},
  {&__pyx_kp_s_FrameR_signature_sig_time_t_matr, __pyx_k_FrameR_signature_sig_time_t_matr, sizeof(__pyx_k_FrameR_signature_sig_time_t_matr), 0, 0, 1, 0},
  {&__pyx_n_s_FrameTypeDefinition, __pyx_k_FrameTypeDefinition, sizeof(__pyx_k_FrameTypeDefinition), 0, 0, 1, 1},
  {&__pyx_n_s_FrameTypeDefinition___reduce_cyt, __pyx_k_FrameTypeDefinition___reduce_cyt, sizeof(__pyx_k_FrameTypeDefinition___reduce_cyt), 0, 0, 1, 1},
  {&__pyx_n_s_FrameTypeDefinition___setstate_c, __pyx_k_FrameTypeDefinition___setstate_c, sizeof(__pyx_k_FrameTypeDefinition___setstate_c), 0, 0, 1, 1},
  {&__pyx_n_s_FrameW, __pyx_k_FrameW, sizeof(__pyx_k_FrameW), 0, 0, 1, 1},
  {&__pyx_n_s_FrameW___enter, __pyx_k_FrameW___enter, sizeof(__pyx_k_FrameW___enter), 0, 0, 1, 1},
  {&__pyx_n_s_FrameW___exit, __pyx_k_FrameW___exit, sizeof(__pyx_k_FrameW___exit), 0, 0, 1, 1},
  {&__pyx_n_s_FrameW___reduce_cython, __pyx_k_FrameW___reduce_cython, sizeof(__pyx_k_FrameW___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_FrameW___setstate_cython, __pyx_k_FrameW___setstate_cython, sizeof(__pyx_k_FrameW___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_FrameW_add_matrix, __pyx_k_FrameW_add_matrix, sizeof(__pyx_k_FrameW_add_matrix), 0, 0, 1, 1},
  {&__pyx_kp_s_FrameW_signature_s_time_f_stream, __pyx_k_FrameW_signature_s_time_f_stream, sizeof(__pyx_k_FrameW_signature_s_time_f_stream), 0, 0, 1, 0},
  {&__pyx_n_s_FrameW_write, __pyx_k_FrameW_write, sizeof(__pyx_k_FrameW_write), 0, 0, 1, 1},
  {&__pyx_kp_s_Frame_has_already_been_written, __pyx_k_Frame_has_already_been_written, sizeof(__pyx_k_Frame_has_already_been_written), 0, 0, 1, 0},
  {&__pyx_kp_s_Frame_header_has_not_been_read, __pyx_k_Frame_header_has_not_been_read, sizeof(__pyx_k_Frame_header_has_not_been_read), 0, 0, 1, 0},
  {&__pyx_n_s_HeaderRead, __pyx_k_HeaderRead, sizeof(__pyx_k_HeaderRead), 0, 0, 1, 1},
  {&__pyx_n_s_INFO, __pyx_k_INFO, sizeof(__pyx_k_INFO), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x0c, __pyx_k_Incompatible_checksums_s_vs_0x0c, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x0c), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x13, __pyx_k_Incompatible_checksums_s_vs_0x13, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x13), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x36, __pyx_k_Incompatible_checksums_s_vs_0x36, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x36), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x3f, __pyx_k_Incompatible_checksums_s_vs_0x3f, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x3f), 0, 0, 1, 0},
  {&__pyx_kp_b_Index_Frequency_Amplitude_Phase, __pyx_k_Index_Frequency_Amplitude_Phase, sizeof(__pyx_k_Index_Frequency_Amplitude_Phase), 0, 0, 0, 0},
  {&__pyx_n_s_Invalid, __pyx_k_Invalid, sizeof(__pyx_k_Invalid), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_Linux, __pyx_k_Linux, sizeof(__pyx_k_Linux), 0, 0, 1, 1},
  {&__pyx_n_s_Matrix, __pyx_k_Matrix, sizeof(__pyx_k_Matrix), 0, 0, 1, 1},
  {&__pyx_n_s_MatrixTypeDefinition, __pyx_k_MatrixTypeDefinition, sizeof(__pyx_k_MatrixTypeDefinition), 0, 0, 1, 1},
  {&__pyx_n_s_MatrixTypeDefinition___reduce_cy, __pyx_k_MatrixTypeDefinition___reduce_cy, sizeof(__pyx_k_MatrixTypeDefinition___reduce_cy), 0, 0, 1, 1},
  {&__pyx_n_s_MatrixTypeDefinition___setstate, __pyx_k_MatrixTypeDefinition___setstate, sizeof(__pyx_k_MatrixTypeDefinition___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_Matrix___reduce_cython, __pyx_k_Matrix___reduce_cython, sizeof(__pyx_k_Matrix___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_Matrix___setstate_cython, __pyx_k_Matrix___setstate_cython, sizeof(__pyx_k_Matrix___setstate_cython), 0, 0, 1, 1},
  {&__pyx_kp_s_Matrix_can_only_be_skipped_if_da, __pyx_k_Matrix_can_only_be_skipped_if_da, sizeof(__pyx_k_Matrix_can_only_be_skipped_if_da), 0, 0, 1, 0},
  {&__pyx_n_s_Matrix_column_names, __pyx_k_Matrix_column_names, sizeof(__pyx_k_Matrix_column_names), 0, 0, 1, 1},
  {&__pyx_kp_s_Matrix_data_can_only_be_skipped, __pyx_k_Matrix_data_can_only_be_skipped, sizeof(__pyx_k_Matrix_data_can_only_be_skipped), 0, 0, 1, 0},
  {&__pyx_n_s_Matrix_get_data, __pyx_k_Matrix_get_data, sizeof(__pyx_k_Matrix_get_data), 0, 0, 1, 1},
  {&__pyx_kp_s_Matrix_header_was_already_read, __pyx_k_Matrix_header_was_already_read, sizeof(__pyx_k_Matrix_header_was_already_read), 0, 0, 1, 0},
  {&__pyx_kp_s_Matrix_sig_s_rows_d_cols_d_dtype, __pyx_k_Matrix_sig_s_rows_d_cols_d_dtype, sizeof(__pyx_k_Matrix_sig_s_rows_d_cols_d_dtype), 0, 0, 1, 0},
  {&__pyx_n_s_Matrix_skip, __pyx_k_Matrix_skip, sizeof(__pyx_k_Matrix_skip), 0, 0, 1, 1},
  {&__pyx_n_s_NameError, __pyx_k_NameError, sizeof(__pyx_k_NameError), 0, 0, 1, 1},
  {&__pyx_n_s_NoFrame, __pyx_k_NoFrame, sizeof(__pyx_k_NoFrame), 0, 0, 1, 1},
  {&__pyx_n_s_NoMatrix, __pyx_k_NoMatrix, sizeof(__pyx_k_NoMatrix), 0, 0, 1, 1},
  {&__pyx_kp_s_No_current_matrix, __pyx_k_No_current_matrix, sizeof(__pyx_k_No_current_matrix), 0, 0, 1, 0},
  {&__pyx_kp_s_No_current_matrix_2, __pyx_k_No_current_matrix_2, sizeof(__pyx_k_No_current_matrix_2), 0, 0, 1, 0},
  {&__pyx_kp_s_No_matrices_were_added_Frame_not, __pyx_k_No_matrices_were_added_Frame_not, sizeof(__pyx_k_No_matrices_were_added_Frame_not), 0, 0, 1, 0},
  {&__pyx_n_s_NothingRead, __pyx_k_NothingRead, sizeof(__pyx_k_NothingRead), 0, 0, 1, 1},
  {&__pyx_n_s_Offline, __pyx_k_Offline, sizeof(__pyx_k_Offline), 0, 0, 1, 1},
  {&__pyx_kp_s_Only_strings_or_bytestrings_are, __pyx_k_Only_strings_or_bytestrings_are, sizeof(__pyx_k_Only_strings_or_bytestrings_are), 0, 0, 1, 0},
  {&__pyx_kp_s_Path_s_does_not_exist_can_t_crea, __pyx_k_Path_s_does_not_exist_can_t_crea, sizeof(__pyx_k_Path_s_does_not_exist_can_t_crea), 0, 0, 1, 0},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_kp_s_Platform_unknown, __pyx_k_Platform_unknown, sizeof(__pyx_k_Platform_unknown), 0, 0, 1, 0},
  {&__pyx_n_b_RBEP, __pyx_k_RBEP, sizeof(__pyx_k_RBEP), 0, 0, 0, 1},
  {&__pyx_kp_b_RBEP_ReassignedBandEnhancedParti, __pyx_k_RBEP_ReassignedBandEnhancedParti, sizeof(__pyx_k_RBEP_ReassignedBandEnhancedParti), 0, 0, 0, 0},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_SDIF_PREDEFINEDTYPES, __pyx_k_SDIF_PREDEFINEDTYPES, sizeof(__pyx_k_SDIF_PREDEFINEDTYPES), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile, __pyx_k_SdifFile, sizeof(__pyx_k_SdifFile), 0, 0, 1, 1},
  {&__pyx_kp_s_SdifFile_NULL, __pyx_k_SdifFile_NULL, sizeof(__pyx_k_SdifFile_NULL), 0, 0, 1, 0},
  {&__pyx_n_s_SdifFile___enter, __pyx_k_SdifFile___enter, sizeof(__pyx_k_SdifFile___enter), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile___exit, __pyx_k_SdifFile___exit, sizeof(__pyx_k_SdifFile___exit), 0, 0, 1, 1},
  {&__pyx_kp_s_SdifFile___init, __pyx_k_SdifFile___init, sizeof(__pyx_k_SdifFile___init), 0, 0, 1, 0},
  {&__pyx_n_s_SdifFile___reduce_cython, __pyx_k_SdifFile___reduce_cython, sizeof(__pyx_k_SdifFile___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile___setstate_cython, __pyx_k_SdifFile___setstate_cython, sizeof(__pyx_k_SdifFile___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile__read_padding, __pyx_k_SdifFile__read_padding, sizeof(__pyx_k_SdifFile__read_padding), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile__read_signature, __pyx_k_SdifFile__read_signature, sizeof(__pyx_k_SdifFile__read_signature), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile__rewind, __pyx_k_SdifFile__rewind, sizeof(__pyx_k_SdifFile__rewind), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_add_NVT, __pyx_k_SdifFile_add_NVT, sizeof(__pyx_k_SdifFile_add_NVT), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_add_frame_type, __pyx_k_SdifFile_add_frame_type, sizeof(__pyx_k_SdifFile_add_frame_type), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_add_matrix_type, __pyx_k_SdifFile_add_matrix_type, sizeof(__pyx_k_SdifFile_add_matrix_type), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_add_predefined_frametyp, __pyx_k_SdifFile_add_predefined_frametyp, sizeof(__pyx_k_SdifFile_add_predefined_frametyp), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_add_streamID, __pyx_k_SdifFile_add_streamID, sizeof(__pyx_k_SdifFile_add_streamID), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_clone_NVTs, __pyx_k_SdifFile_clone_NVTs, sizeof(__pyx_k_SdifFile_clone_NVTs), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_clone_definitions, __pyx_k_SdifFile_clone_definitions, sizeof(__pyx_k_SdifFile_clone_definitions), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_clone_frames, __pyx_k_SdifFile_clone_frames, sizeof(__pyx_k_SdifFile_clone_frames), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_clone_type_definitions, __pyx_k_SdifFile_clone_type_definitions, sizeof(__pyx_k_SdifFile_clone_type_definitions), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_close, __pyx_k_SdifFile_close, sizeof(__pyx_k_SdifFile_close), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_curr_frame_available, __pyx_k_SdifFile_curr_frame_available, sizeof(__pyx_k_SdifFile_curr_frame_available), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_curr_frame_is_selected, __pyx_k_SdifFile_curr_frame_is_selected, sizeof(__pyx_k_SdifFile_curr_frame_is_selected), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_curr_matrix_available, __pyx_k_SdifFile_curr_matrix_available, sizeof(__pyx_k_SdifFile_curr_matrix_available), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_curr_matrix_datatype, __pyx_k_SdifFile_curr_matrix_datatype, sizeof(__pyx_k_SdifFile_curr_matrix_datatype), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_curr_matrix_is_selected, __pyx_k_SdifFile_curr_matrix_is_selected, sizeof(__pyx_k_SdifFile_curr_matrix_is_selected), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_curr_matrix_signature, __pyx_k_SdifFile_curr_matrix_signature, sizeof(__pyx_k_SdifFile_curr_matrix_signature), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_curr_matrix_size, __pyx_k_SdifFile_curr_matrix_size, sizeof(__pyx_k_SdifFile_curr_matrix_size), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_curr_signature, __pyx_k_SdifFile_curr_signature, sizeof(__pyx_k_SdifFile_curr_signature), 0, 0, 1, 1},
  {&__pyx_kp_s_SdifFile_dealloc, __pyx_k_SdifFile_dealloc, sizeof(__pyx_k_SdifFile_dealloc), 0, 0, 1, 0},
  {&__pyx_n_s_SdifFile_frame_id, __pyx_k_SdifFile_frame_id, sizeof(__pyx_k_SdifFile_frame_id), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_frame_num_matrix, __pyx_k_SdifFile_frame_num_matrix, sizeof(__pyx_k_SdifFile_frame_num_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_frame_numerical_signatu, __pyx_k_SdifFile_frame_numerical_signatu, sizeof(__pyx_k_SdifFile_frame_numerical_signatu), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_frame_read_header, __pyx_k_SdifFile_frame_read_header, sizeof(__pyx_k_SdifFile_frame_read_header), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_frame_signature, __pyx_k_SdifFile_frame_signature, sizeof(__pyx_k_SdifFile_frame_signature), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_frame_skip_data, __pyx_k_SdifFile_frame_skip_data, sizeof(__pyx_k_SdifFile_frame_skip_data), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_frame_skip_rest, __pyx_k_SdifFile_frame_skip_rest, sizeof(__pyx_k_SdifFile_frame_skip_rest), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_frame_time, __pyx_k_SdifFile_frame_time, sizeof(__pyx_k_SdifFile_frame_time), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_frame_types_to_string, __pyx_k_SdifFile_frame_types_to_string, sizeof(__pyx_k_SdifFile_frame_types_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_get_NVTs, __pyx_k_SdifFile_get_NVTs, sizeof(__pyx_k_SdifFile_get_NVTs), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_get_frame_types, __pyx_k_SdifFile_get_frame_types, sizeof(__pyx_k_SdifFile_get_frame_types), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_get_matrix_types, __pyx_k_SdifFile_get_matrix_types, sizeof(__pyx_k_SdifFile_get_matrix_types), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_get_num_NVTs, __pyx_k_SdifFile_get_num_NVTs, sizeof(__pyx_k_SdifFile_get_num_NVTs), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_get_stream_IDs, __pyx_k_SdifFile_get_stream_IDs, sizeof(__pyx_k_SdifFile_get_stream_IDs), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_last_error, __pyx_k_SdifFile_last_error, sizeof(__pyx_k_SdifFile_last_error), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_matrix_read_data, __pyx_k_SdifFile_matrix_read_data, sizeof(__pyx_k_SdifFile_matrix_read_data), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_matrix_read_header, __pyx_k_SdifFile_matrix_read_header, sizeof(__pyx_k_SdifFile_matrix_read_header), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_matrix_skip, __pyx_k_SdifFile_matrix_skip, sizeof(__pyx_k_SdifFile_matrix_skip), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_matrix_skip_data, __pyx_k_SdifFile_matrix_skip_data, sizeof(__pyx_k_SdifFile_matrix_skip_data), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_matrix_types_to_string, __pyx_k_SdifFile_matrix_types_to_string, sizeof(__pyx_k_SdifFile_matrix_types_to_string), 0, 0, 1, 1},
  {&__pyx_kp_s_SdifFile_name_name_mode_mode, __pyx_k_SdifFile_name_name_mode_mode, sizeof(__pyx_k_SdifFile_name_name_mode_mode), 0, 0, 1, 0},
  {&__pyx_n_s_SdifFile_new_frame, __pyx_k_SdifFile_new_frame, sizeof(__pyx_k_SdifFile_new_frame), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_new_frame_one_matrix, __pyx_k_SdifFile_new_frame_one_matrix, sizeof(__pyx_k_SdifFile_new_frame_one_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_next_frame, __pyx_k_SdifFile_next_frame, sizeof(__pyx_k_SdifFile_next_frame), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_next_matrix, __pyx_k_SdifFile_next_matrix, sizeof(__pyx_k_SdifFile_next_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_print_NVT, __pyx_k_SdifFile_print_NVT, sizeof(__pyx_k_SdifFile_print_NVT), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_print_all_ascii_chunks, __pyx_k_SdifFile_print_all_ascii_chunks, sizeof(__pyx_k_SdifFile_print_all_ascii_chunks), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_print_all_stream_ID, __pyx_k_SdifFile_print_all_stream_ID, sizeof(__pyx_k_SdifFile_print_all_stream_ID), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_print_all_types, __pyx_k_SdifFile_print_all_types, sizeof(__pyx_k_SdifFile_print_all_types), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_print_frame_header, __pyx_k_SdifFile_print_frame_header, sizeof(__pyx_k_SdifFile_print_frame_header), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_print_general_header, __pyx_k_SdifFile_print_general_header, sizeof(__pyx_k_SdifFile_print_general_header), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_print_matrix_header, __pyx_k_SdifFile_print_matrix_header, sizeof(__pyx_k_SdifFile_print_matrix_header), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_print_one_row, __pyx_k_SdifFile_print_one_row, sizeof(__pyx_k_SdifFile_print_one_row), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_rewind, __pyx_k_SdifFile_rewind, sizeof(__pyx_k_SdifFile_rewind), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_status, __pyx_k_SdifFile_status, sizeof(__pyx_k_SdifFile_status), 0, 0, 1, 1},
  {&__pyx_n_s_SdifFile_write_all_ascii_chunks, __pyx_k_SdifFile_write_all_ascii_chunks, sizeof(__pyx_k_SdifFile_write_all_ascii_chunks), 0, 0, 1, 1},
  {&__pyx_n_s_SdifOrderError, __pyx_k_SdifOrderError, sizeof(__pyx_k_SdifOrderError), 0, 0, 1, 1},
  {&__pyx_kp_s_SdifTypes_STYP, __pyx_k_SdifTypes_STYP, sizeof(__pyx_k_SdifTypes_STYP), 0, 0, 1, 0},
  {&__pyx_kp_s_Sdif_initialized_using_path_s, __pyx_k_Sdif_initialized_using_path_s, sizeof(__pyx_k_Sdif_initialized_using_path_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Sdif_initialized_without_SdifTyp, __pyx_k_Sdif_initialized_without_SdifTyp, sizeof(__pyx_k_Sdif_initialized_without_SdifTyp), 0, 0, 1, 0},
  {&__pyx_n_s_SignatureRead, __pyx_k_SignatureRead, sizeof(__pyx_k_SignatureRead), 0, 0, 1, 1},
  {&__pyx_n_s_SomeDataRead, __pyx_k_SomeDataRead, sizeof(__pyx_k_SomeDataRead), 0, 0, 1, 1},
  {&__pyx_kp_s_Some_data_of_the_matrix_has_been, __pyx_k_Some_data_of_the_matrix_has_been, sizeof(__pyx_k_Some_data_of_the_matrix_has_been), 0, 0, 1, 0},
  {&__pyx_kp_s_Status_Frame_frame_MatrixIdx_mid, __pyx_k_Status_Frame_frame_MatrixIdx_mid, sizeof(__pyx_k_Status_Frame_frame_MatrixIdx_mid), 0, 0, 1, 0},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s_StreamID, __pyx_k_StreamID, sizeof(__pyx_k_StreamID), 0, 0, 1, 1},
  {&__pyx_n_s_StreamID___reduce_cython, __pyx_k_StreamID___reduce_cython, sizeof(__pyx_k_StreamID___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_StreamID___setstate_cython, __pyx_k_StreamID___setstate_cython, sizeof(__pyx_k_StreamID___setstate_cython), 0, 0, 1, 1},
  {&__pyx_kp_s_StreamID_numid_d_source_s_treewa, __pyx_k_StreamID_numid_d_source_s_treewa, sizeof(__pyx_k_StreamID_numid_d_source_s_treewa), 0, 0, 1, 0},
  {&__pyx_kp_s_The_frame_should_be_read_or_skip, __pyx_k_The_frame_should_be_read_or_skip, sizeof(__pyx_k_The_frame_should_be_read_or_skip), 0, 0, 1, 0},
  {&__pyx_kp_s_The_header_of_the_current_frame, __pyx_k_The_header_of_the_current_frame, sizeof(__pyx_k_The_header_of_the_current_frame), 0, 0, 1, 0},
  {&__pyx_kp_s_The_header_was_already_read, __pyx_k_The_header_was_already_read, sizeof(__pyx_k_The_header_was_already_read), 0, 0, 1, 0},
  {&__pyx_kp_s_This_function_is_only_possible_f, __pyx_k_This_function_is_only_possible_f, sizeof(__pyx_k_This_function_is_only_possible_f), 0, 0, 1, 0},
  {&__pyx_kp_s_This_matrix_type_sig_does_not_se, __pyx_k_This_matrix_type_sig_does_not_se, sizeof(__pyx_k_This_matrix_type_sig_does_not_se), 0, 0, 1, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Undefined_frametype_sig_You_must, __pyx_k_Undefined_frametype_sig_You_must, sizeof(__pyx_k_Undefined_frametype_sig_You_must), 0, 0, 1, 0},
  {&__pyx_n_s_Windows, __pyx_k_Windows, sizeof(__pyx_k_Windows), 0, 0, 1, 1},
  {&__pyx_kp_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 0},
  {&__pyx_kp_b__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 0, 0},
  {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0},
  {&__pyx_kp_b__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 0, 0},
  {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
  {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0},
  {&__pyx_n_s_abspath, __pyx_k_abspath, sizeof(__pyx_k_abspath), 0, 0, 1, 1},
  {&__pyx_n_s_add_NVT, __pyx_k_add_NVT, sizeof(__pyx_k_add_NVT), 0, 0, 1, 1},
  {&__pyx_n_s_add_frame_type, __pyx_k_add_frame_type, sizeof(__pyx_k_add_frame_type), 0, 0, 1, 1},
  {&__pyx_n_s_add_matrix, __pyx_k_add_matrix, sizeof(__pyx_k_add_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_add_matrix_type, __pyx_k_add_matrix_type, sizeof(__pyx_k_add_matrix_type), 0, 0, 1, 1},
  {&__pyx_n_s_add_predefined_frametype, __pyx_k_add_predefined_frametype, sizeof(__pyx_k_add_predefined_frametype), 0, 0, 1, 1},
  {&__pyx_n_s_add_streamID, __pyx_k_add_streamID, sizeof(__pyx_k_add_streamID), 0, 0, 1, 1},
  {&__pyx_n_s_allframetypes, __pyx_k_allframetypes, sizeof(__pyx_k_allframetypes), 0, 0, 1, 1},
  {&__pyx_n_s_allmatrixtypes, __pyx_k_allmatrixtypes, sizeof(__pyx_k_allmatrixtypes), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
  {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1},
  {&__pyx_n_s_bytes_read, __pyx_k_bytes_read, sizeof(__pyx_k_bytes_read), 0, 0, 1, 1},
  {&__pyx_n_s_bytesread, __pyx_k_bytesread, sizeof(__pyx_k_bytesread), 0, 0, 1, 1},
  {&__pyx_n_s_c_contiguous, __pyx_k_c_contiguous, sizeof(__pyx_k_c_contiguous), 0, 0, 1, 1},
  {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_clone_NVTs, __pyx_k_clone_NVTs, sizeof(__pyx_k_clone_NVTs), 0, 0, 1, 1},
  {&__pyx_n_s_clone_definitions, __pyx_k_clone_definitions, sizeof(__pyx_k_clone_definitions), 0, 0, 1, 1},
  {&__pyx_n_s_clone_frames, __pyx_k_clone_frames, sizeof(__pyx_k_clone_frames), 0, 0, 1, 1},
  {&__pyx_n_s_clone_frames_locals_genexpr, __pyx_k_clone_frames_locals_genexpr, sizeof(__pyx_k_clone_frames_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_clone_type_definitions, __pyx_k_clone_type_definitions, sizeof(__pyx_k_clone_type_definitions), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_kp_s_close_can_t_close_SdifFile_it_is, __pyx_k_close_can_t_close_SdifFile_it_is, sizeof(__pyx_k_close_can_t_close_SdifFile_it_is), 0, 0, 1, 0},
  {&__pyx_kp_s_close_can_t_close_SdifFile_since, __pyx_k_close_can_t_close_SdifFile_since, sizeof(__pyx_k_close_can_t_close_SdifFile_since), 0, 0, 1, 0},
  {&__pyx_n_s_colnames, __pyx_k_colnames, sizeof(__pyx_k_colnames), 0, 0, 1, 1},
  {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1},
  {&__pyx_n_s_column_names, __pyx_k_column_names, sizeof(__pyx_k_column_names), 0, 0, 1, 1},
  {&__pyx_n_s_comp, __pyx_k_comp, sizeof(__pyx_k_comp), 0, 0, 1, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 0, 0, 1, 1},
  {&__pyx_kp_s_components_should_be_a_seq_of_Co, __pyx_k_components_should_be_a_seq_of_Co, sizeof(__pyx_k_components_should_be_a_seq_of_Co), 0, 0, 1, 0},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_curr_frame_available, __pyx_k_curr_frame_available, sizeof(__pyx_k_curr_frame_available), 0, 0, 1, 1},
  {&__pyx_n_s_curr_frame_is_selected, __pyx_k_curr_frame_is_selected, sizeof(__pyx_k_curr_frame_is_selected), 0, 0, 1, 1},
  {&__pyx_n_s_curr_matrix_available, __pyx_k_curr_matrix_available, sizeof(__pyx_k_curr_matrix_available), 0, 0, 1, 1},
  {&__pyx_n_s_curr_matrix_datatype, __pyx_k_curr_matrix_datatype, sizeof(__pyx_k_curr_matrix_datatype), 0, 0, 1, 1},
  {&__pyx_n_s_curr_matrix_is_selected, __pyx_k_curr_matrix_is_selected, sizeof(__pyx_k_curr_matrix_is_selected), 0, 0, 1, 1},
  {&__pyx_n_s_curr_matrix_signature, __pyx_k_curr_matrix_signature, sizeof(__pyx_k_curr_matrix_signature), 0, 0, 1, 1},
  {&__pyx_n_s_curr_matrix_size, __pyx_k_curr_matrix_size, sizeof(__pyx_k_curr_matrix_size), 0, 0, 1, 1},
  {&__pyx_n_s_curr_signature, __pyx_k_curr_signature, sizeof(__pyx_k_curr_signature), 0, 0, 1, 1},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_data_array, __pyx_k_data_array, sizeof(__pyx_k_data_array), 0, 0, 1, 1},
  {&__pyx_n_s_datadir, __pyx_k_datadir, sizeof(__pyx_k_datadir), 0, 0, 1, 1},
  {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_kp_s_error_finishing_matrix, __pyx_k_error_finishing_matrix, sizeof(__pyx_k_error_finishing_matrix), 0, 0, 1, 0},
  {&__pyx_kp_s_error_opening_file, __pyx_k_error_opening_file, sizeof(__pyx_k_error_opening_file), 0, 0, 1, 0},
  {&__pyx_n_s_exception_type, __pyx_k_exception_type, sizeof(__pyx_k_exception_type), 0, 0, 1, 1},
  {&__pyx_n_s_exception_value, __pyx_k_exception_value, sizeof(__pyx_k_exception_value), 0, 0, 1, 1},
  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_expanduser, __pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_file_2, __pyx_k_file_2, sizeof(__pyx_k_file_2), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  {&__pyx_n_s_finalize_frame, __pyx_k_finalize_frame, sizeof(__pyx_k_finalize_frame), 0, 0, 1, 1},
  {&__pyx_kp_s_finalize_frame_called_but_heade, __pyx_k_finalize_frame_called_but_heade, sizeof(__pyx_k_finalize_frame_called_but_heade), 0, 0, 1, 0},
  {&__pyx_kp_s_finalize_frame_without_having_r, __pyx_k_finalize_frame_without_having_r, sizeof(__pyx_k_finalize_frame_without_having_r), 0, 0, 1, 0},
  {&__pyx_n_s_finalize_matrix, __pyx_k_finalize_matrix, sizeof(__pyx_k_finalize_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_find_sdiftypes, __pyx_k_find_sdiftypes, sizeof(__pyx_k_find_sdiftypes), 0, 0, 1, 1},
  {&__pyx_n_s_find_sdiftypes_locals_get_packa, __pyx_k_find_sdiftypes_locals_get_packa, sizeof(__pyx_k_find_sdiftypes_locals_get_packa), 0, 0, 1, 1},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1},
  {&__pyx_n_s_frame0, __pyx_k_frame0, sizeof(__pyx_k_frame0), 0, 0, 1, 1},
  {&__pyx_n_s_frame1, __pyx_k_frame1, sizeof(__pyx_k_frame1), 0, 0, 1, 1},
  {&__pyx_n_s_frame_id, __pyx_k_frame_id, sizeof(__pyx_k_frame_id), 0, 0, 1, 1},
  {&__pyx_n_s_frame_num_matrix, __pyx_k_frame_num_matrix, sizeof(__pyx_k_frame_num_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_frame_numerical_signature, __pyx_k_frame_numerical_signature, sizeof(__pyx_k_frame_numerical_signature), 0, 0, 1, 1},
  {&__pyx_n_s_frame_read_header, __pyx_k_frame_read_header, sizeof(__pyx_k_frame_read_header), 0, 0, 1, 1},
  {&__pyx_kp_s_frame_read_header_finalizing_las, __pyx_k_frame_read_header_finalizing_las, sizeof(__pyx_k_frame_read_header_finalizing_las), 0, 0, 1, 0},
  {&__pyx_n_s_frame_sig, __pyx_k_frame_sig, sizeof(__pyx_k_frame_sig), 0, 0, 1, 1},
  {&__pyx_n_s_frame_signature, __pyx_k_frame_signature, sizeof(__pyx_k_frame_signature), 0, 0, 1, 1},
  {&__pyx_n_s_frame_size, __pyx_k_frame_size, sizeof(__pyx_k_frame_size), 0, 0, 1, 1},
  {&__pyx_n_s_frame_skip_data, __pyx_k_frame_skip_data, sizeof(__pyx_k_frame_skip_data), 0, 0, 1, 1},
  {&__pyx_kp_s_frame_skip_data_calling_finalize, __pyx_k_frame_skip_data_calling_finalize, sizeof(__pyx_k_frame_skip_data_calling_finalize), 0, 0, 1, 0},
  {&__pyx_n_s_frame_skip_rest, __pyx_k_frame_skip_rest, sizeof(__pyx_k_frame_skip_rest), 0, 0, 1, 1},
  {&__pyx_kp_s_frame_skip_rest_Attempted_to_sk, __pyx_k_frame_skip_rest_Attempted_to_sk, sizeof(__pyx_k_frame_skip_rest_Attempted_to_sk), 0, 0, 1, 0},
  {&__pyx_n_s_frame_time, __pyx_k_frame_time, sizeof(__pyx_k_frame_time), 0, 0, 1, 1},
  {&__pyx_n_s_frame_types_to_string, __pyx_k_frame_types_to_string, sizeof(__pyx_k_frame_types_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_framestatus2str, __pyx_k_framestatus2str, sizeof(__pyx_k_framestatus2str), 0, 0, 1, 1},
  {&__pyx_n_s_frametype, __pyx_k_frametype, sizeof(__pyx_k_frametype), 0, 0, 1, 1},
  {&__pyx_n_s_frametypes, __pyx_k_frametypes, sizeof(__pyx_k_frametypes), 0, 0, 1, 1},
  {&__pyx_n_s_frametypes_populate, __pyx_k_frametypes_populate, sizeof(__pyx_k_frametypes_populate), 0, 0, 1, 1},
  {&__pyx_n_s_frametypeslist, __pyx_k_frametypeslist, sizeof(__pyx_k_frametypeslist), 0, 0, 1, 1},
  {&__pyx_n_s_fsz, __pyx_k_fsz, sizeof(__pyx_k_fsz), 0, 0, 1, 1},
  {&__pyx_n_s_ft, __pyx_k_ft, sizeof(__pyx_k_ft), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1},
  {&__pyx_n_s_get_NVTs, __pyx_k_get_NVTs, sizeof(__pyx_k_get_NVTs), 0, 0, 1, 1},
  {&__pyx_n_s_get_data, __pyx_k_get_data, sizeof(__pyx_k_get_data), 0, 0, 1, 1},
  {&__pyx_n_s_get_frame_types, __pyx_k_get_frame_types, sizeof(__pyx_k_get_frame_types), 0, 0, 1, 1},
  {&__pyx_n_s_get_matrix, __pyx_k_get_matrix, sizeof(__pyx_k_get_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_get_matrix_types, __pyx_k_get_matrix_types, sizeof(__pyx_k_get_matrix_types), 0, 0, 1, 1},
  {&__pyx_n_s_get_num_NVTs, __pyx_k_get_num_NVTs, sizeof(__pyx_k_get_num_NVTs), 0, 0, 1, 1},
  {&__pyx_n_s_get_packaged_sdiftypes, __pyx_k_get_packaged_sdiftypes, sizeof(__pyx_k_get_packaged_sdiftypes), 0, 0, 1, 1},
  {&__pyx_n_s_get_stream_IDs, __pyx_k_get_stream_IDs, sizeof(__pyx_k_get_stream_IDs), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
  {&__pyx_n_s_init___locals_genexpr, __pyx_k_init___locals_genexpr, sizeof(__pyx_k_init___locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_last_error, __pyx_k_last_error, sizeof(__pyx_k_last_error), 0, 0, 1, 1},
  {&__pyx_kp_s_local_share, __pyx_k_local_share, sizeof(__pyx_k_local_share), 0, 0, 1, 0},
  {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
  {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_matrix, __pyx_k_matrix, sizeof(__pyx_k_matrix), 0, 0, 1, 1},
  {&__pyx_kp_s_matrix_empty_or_could_not_read_m, __pyx_k_matrix_empty_or_could_not_read_m, sizeof(__pyx_k_matrix_empty_or_could_not_read_m), 0, 0, 1, 0},
  {&__pyx_n_s_matrix_idx, __pyx_k_matrix_idx, sizeof(__pyx_k_matrix_idx), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_read_data, __pyx_k_matrix_read_data, sizeof(__pyx_k_matrix_read_data), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_read_header, __pyx_k_matrix_read_header, sizeof(__pyx_k_matrix_read_header), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_sig, __pyx_k_matrix_sig, sizeof(__pyx_k_matrix_sig), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_skip, __pyx_k_matrix_skip, sizeof(__pyx_k_matrix_skip), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_skip_data, __pyx_k_matrix_skip_data, sizeof(__pyx_k_matrix_skip_data), 0, 0, 1, 1},
  {&__pyx_kp_s_matrix_skip_data_no_current_fram, __pyx_k_matrix_skip_data_no_current_fram, sizeof(__pyx_k_matrix_skip_data_no_current_fram), 0, 0, 1, 0},
  {&__pyx_kp_s_matrix_skip_no_current_frame, __pyx_k_matrix_skip_no_current_frame, sizeof(__pyx_k_matrix_skip_no_current_frame), 0, 0, 1, 0},
  {&__pyx_n_s_matrix_status, __pyx_k_matrix_status, sizeof(__pyx_k_matrix_status), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_types_to_string, __pyx_k_matrix_types_to_string, sizeof(__pyx_k_matrix_types_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_matrixdata, __pyx_k_matrixdata, sizeof(__pyx_k_matrixdata), 0, 0, 1, 1},
  {&__pyx_n_s_matrixrole, __pyx_k_matrixrole, sizeof(__pyx_k_matrixrole), 0, 0, 1, 1},
  {&__pyx_n_s_matrixsig, __pyx_k_matrixsig, sizeof(__pyx_k_matrixsig), 0, 0, 1, 1},
  {&__pyx_n_s_matrixstatus2str, __pyx_k_matrixstatus2str, sizeof(__pyx_k_matrixstatus2str), 0, 0, 1, 1},
  {&__pyx_n_s_matrixtype, __pyx_k_matrixtype, sizeof(__pyx_k_matrixtype), 0, 0, 1, 1},
  {&__pyx_n_s_matrixtypes, __pyx_k_matrixtypes, sizeof(__pyx_k_matrixtypes), 0, 0, 1, 1},
  {&__pyx_n_s_matrixtypeslist, __pyx_k_matrixtypeslist, sizeof(__pyx_k_matrixtypeslist), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_midx, __pyx_k_midx, sizeof(__pyx_k_midx), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_kp_s_mode_should_be_on_of_r_w_rw, __pyx_k_mode_should_be_on_of_r_w_rw, sizeof(__pyx_k_mode_should_be_on_of_r_w_rw), 0, 0, 1, 0},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mt, __pyx_k_mt, sizeof(__pyx_k_mt), 0, 0, 1, 1},
  {&__pyx_n_s_mtd, __pyx_k_mtd, sizeof(__pyx_k_mtd), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_new_frame, __pyx_k_new_frame, sizeof(__pyx_k_new_frame), 0, 0, 1, 1},
  {&__pyx_n_s_new_frame_one_matrix, __pyx_k_new_frame_one_matrix, sizeof(__pyx_k_new_frame_one_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
  {&__pyx_n_s_next_frame, __pyx_k_next_frame, sizeof(__pyx_k_next_frame), 0, 0, 1, 1},
  {&__pyx_n_s_next_matrix, __pyx_k_next_matrix, sizeof(__pyx_k_next_matrix), 0, 0, 1, 1},
  {&__pyx_kp_s_no_current_frame, __pyx_k_no_current_frame, sizeof(__pyx_k_no_current_frame), 0, 0, 1, 0},
  {&__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},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
  {&__pyx_n_s_num_matrices, __pyx_k_num_matrices, sizeof(__pyx_k_num_matrices), 0, 0, 1, 1},
  {&__pyx_n_s_numid, __pyx_k_numid, sizeof(__pyx_k_numid), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
  {&__pyx_n_s_nvt, __pyx_k_nvt, sizeof(__pyx_k_nvt), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_os_path, __pyx_k_os_path, sizeof(__pyx_k_os_path), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_n_s_p2, __pyx_k_p2, sizeof(__pyx_k_p2), 0, 0, 1, 1},
  {&__pyx_n_s_packaged_sdiftypes, __pyx_k_packaged_sdiftypes, sizeof(__pyx_k_packaged_sdiftypes), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_kp_s_path_not_found_cannot_open_sdif, __pyx_k_path_not_found_cannot_open_sdif, sizeof(__pyx_k_path_not_found_cannot_open_sdif), 0, 0, 1, 0},
  {&__pyx_n_s_paths, __pyx_k_paths, sizeof(__pyx_k_paths), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_pl, __pyx_k_pl, sizeof(__pyx_k_pl), 0, 0, 1, 1},
  {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
  {&__pyx_n_s_predefined_frametypes, __pyx_k_predefined_frametypes, sizeof(__pyx_k_predefined_frametypes), 0, 0, 1, 1},
  {&__pyx_n_s_predefined_matrixtypes, __pyx_k_predefined_matrixtypes, sizeof(__pyx_k_predefined_matrixtypes), 0, 0, 1, 1},
  {&__pyx_n_s_predefined_type, __pyx_k_predefined_type, sizeof(__pyx_k_predefined_type), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_print_NVT, __pyx_k_print_NVT, sizeof(__pyx_k_print_NVT), 0, 0, 1, 1},
  {&__pyx_n_s_print_all_ascii_chunks, __pyx_k_print_all_ascii_chunks, sizeof(__pyx_k_print_all_ascii_chunks), 0, 0, 1, 1},
  {&__pyx_n_s_print_all_stream_ID, __pyx_k_print_all_stream_ID, sizeof(__pyx_k_print_all_stream_ID), 0, 0, 1, 1},
  {&__pyx_n_s_print_all_types, __pyx_k_print_all_types, sizeof(__pyx_k_print_all_types), 0, 0, 1, 1},
  {&__pyx_n_s_print_frame_header, __pyx_k_print_frame_header, sizeof(__pyx_k_print_frame_header), 0, 0, 1, 1},
  {&__pyx_n_s_print_general_header, __pyx_k_print_general_header, sizeof(__pyx_k_print_general_header), 0, 0, 1, 1},
  {&__pyx_n_s_print_matrix_header, __pyx_k_print_matrix_header, sizeof(__pyx_k_print_matrix_header), 0, 0, 1, 1},
  {&__pyx_n_s_print_one_row, __pyx_k_print_one_row, sizeof(__pyx_k_print_one_row), 0, 0, 1, 1},
  {&__pyx_n_s_pysdif, __pyx_k_pysdif, sizeof(__pyx_k_pysdif), 0, 0, 1, 1},
  {&__pyx_n_s_pysdif__pysdif, __pyx_k_pysdif__pysdif, sizeof(__pyx_k_pysdif__pysdif), 0, 0, 1, 1},
  {&__pyx_kp_s_pysdif__pysdif_pyx, __pyx_k_pysdif__pysdif_pyx, sizeof(__pyx_k_pysdif__pysdif_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Component, __pyx_k_pyx_unpickle_Component, sizeof(__pyx_k_pyx_unpickle_Component), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_FrameTypeDefiniti, __pyx_k_pyx_unpickle_FrameTypeDefiniti, sizeof(__pyx_k_pyx_unpickle_FrameTypeDefiniti), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_FrameW, __pyx_k_pyx_unpickle_FrameW, sizeof(__pyx_k_pyx_unpickle_FrameW), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_MatrixTypeDefinit, __pyx_k_pyx_unpickle_MatrixTypeDefinit, sizeof(__pyx_k_pyx_unpickle_MatrixTypeDefinit), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_read_padding, __pyx_k_read_padding, sizeof(__pyx_k_read_padding), 0, 0, 1, 1},
  {&__pyx_n_s_read_sdiftypes, __pyx_k_read_sdiftypes, sizeof(__pyx_k_read_sdiftypes), 0, 0, 1, 1},
  {&__pyx_n_s_read_signature, __pyx_k_read_signature, sizeof(__pyx_k_read_signature), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1},
  {&__pyx_n_s_rewind, __pyx_k_rewind, sizeof(__pyx_k_rewind), 0, 0, 1, 1},
  {&__pyx_n_s_rewind_2, __pyx_k_rewind_2, sizeof(__pyx_k_rewind_2), 0, 0, 1, 1},
  {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
  {&__pyx_n_s_rw, __pyx_k_rw, sizeof(__pyx_k_rw), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_kp_s_s_should_be_either_a_str_or_byte, __pyx_k_s_should_be_either_a_str_or_byte, sizeof(__pyx_k_s_should_be_either_a_str_or_byte), 0, 0, 1, 0},
  {&__pyx_n_s_sdif_cleanup, __pyx_k_sdif_cleanup, sizeof(__pyx_k_sdif_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_sdif_init, __pyx_k_sdif_init, sizeof(__pyx_k_sdif_init), 0, 0, 1, 1},
  {&__pyx_n_s_sdifstr, __pyx_k_sdifstr, sizeof(__pyx_k_sdifstr), 0, 0, 1, 1},
  {&__pyx_n_s_sdiftypes_data, __pyx_k_sdiftypes_data, sizeof(__pyx_k_sdiftypes_data), 0, 0, 1, 1},
  {&__pyx_n_s_sdiftypes_path, __pyx_k_sdiftypes_path, sizeof(__pyx_k_sdiftypes_path), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_setLevel, __pyx_k_setLevel, sizeof(__pyx_k_setLevel), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_sig, __pyx_k_sig, sizeof(__pyx_k_sig), 0, 0, 1, 1},
  {&__pyx_n_s_signature, __pyx_k_signature, sizeof(__pyx_k_signature), 0, 0, 1, 1},
  {&__pyx_n_s_signature2str, __pyx_k_signature2str, sizeof(__pyx_k_signature2str), 0, 0, 1, 1},
  {&__pyx_kp_s_signature_not_found, __pyx_k_signature_not_found, sizeof(__pyx_k_signature_not_found), 0, 0, 1, 0},
  {&__pyx_n_s_signatures_to_clone, __pyx_k_signatures_to_clone, sizeof(__pyx_k_signatures_to_clone), 0, 0, 1, 1},
  {&__pyx_n_s_signaturesture, __pyx_k_signaturesture, sizeof(__pyx_k_signaturesture), 0, 0, 1, 1},
  {&__pyx_n_s_sigs, __pyx_k_sigs, sizeof(__pyx_k_sigs), 0, 0, 1, 1},
  {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
  {&__pyx_n_s_str2signature, __pyx_k_str2signature, sizeof(__pyx_k_str2signature), 0, 0, 1, 1},
  {&__pyx_n_s_streamID, __pyx_k_streamID, sizeof(__pyx_k_streamID), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_system, __pyx_k_system, sizeof(__pyx_k_system), 0, 0, 1, 1},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_thisfile, __pyx_k_thisfile, sizeof(__pyx_k_thisfile), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_treeway, __pyx_k_treeway, sizeof(__pyx_k_treeway), 0, 0, 1, 1},
  {&__pyx_kp_s_tried_to_finalize_matrix_but_sta, __pyx_k_tried_to_finalize_matrix_but_sta, sizeof(__pyx_k_tried_to_finalize_matrix_but_sta), 0, 0, 1, 0},
  {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1},
  {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
  {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
  {&__pyx_kp_s_usr_local_share, __pyx_k_usr_local_share, sizeof(__pyx_k_usr_local_share), 0, 0, 1, 0},
  {&__pyx_kp_s_usr_share, __pyx_k_usr_share, sizeof(__pyx_k_usr_share), 0, 0, 1, 0},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_wr, __pyx_k_wr, sizeof(__pyx_k_wr), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_write_all_ascii_chunks, __pyx_k_write_all_ascii_chunks, sizeof(__pyx_k_write_all_ascii_chunks), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 214, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) __PYX_ERR(0, 494, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 758, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 885, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 903, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 1176, __pyx_L1_error)
  __pyx_builtin_EOFError = __Pyx_GetBuiltinName(__pyx_n_s_EOFError); if (!__pyx_builtin_EOFError) __PYX_ERR(0, 1768, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __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)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __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)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "pysdif/_pysdif.pyx":279
 * 
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper             # <<<<<<<<<<<<<<
 *     out.this = this
 *     out.own_this = 0
 */
  __pyx_tuple__3 = PyTuple_Pack(3, __pyx_int_neg_1, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "pysdif/_pysdif.pyx":491
 * def _find_sdiftypes():
 * 
 *     def get_packaged_sdiftypes():             # <<<<<<<<<<<<<<
 *         try:
 *             thisfile = __file__
 */
  __pyx_tuple__6 = PyTuple_Pack(3, __pyx_n_s_thisfile, __pyx_n_s_datadir, __pyx_n_s_sdiftypes_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);
  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_get_packaged_sdiftypes, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 491, __pyx_L1_error)

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "pysdif/_pysdif.pyx":885
 *     def __iter__(self):
 *         if self.source.frame_status >= eFrameSomeDataRead:
 *             raise RuntimeError("A Frame can only be iterated once")             # <<<<<<<<<<<<<<
 *         self.source.frame_status = eFrameSomeDataRead
 *         return self
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_A_Frame_can_only_be_iterated_onc); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __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)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __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)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "pysdif/_pysdif.pyx":993
 *     def __enter__(self):
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Frame_has_already_been_written); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pysdif/_pysdif.pyx":998
 *     def __exit__(self, exception_type, exception_value, traceback):
 *         if self.num_matrices == 0:
 *             raise RuntimeError("No matrices were added! Frame not written")             # <<<<<<<<<<<<<<
 *         self.write()
 * 
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_No_matrices_were_added_Frame_not); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pysdif/_pysdif.pyx":1642
 *                     raise SdifOrderError("Attempted to read matrix header, but there are no more matrices in this frame")
 *                 else:
 *                     raise IOError("Could not read matrix header. ")             # <<<<<<<<<<<<<<
 *             status = eMatrixHeaderRead
 *         if status == eMatrixHeaderRead:
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Could_not_read_matrix_header); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "pysdif/_pysdif.pyx":1647
 *             bytesread = self._matrix_read_data()
 *             if not bytesread:
 *                 raise IOError("matrix empty or could not read matrix data")             # <<<<<<<<<<<<<<
 *         if copy:
 *             return _array_from_matrix_data_copy(self.this.CurrMtrxData)
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_matrix_empty_or_could_not_read_m); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "pysdif/_pysdif.pyx":1768
 *         logger.debug("frame_skip_rest")
 *         if self.eof:
 *             raise EOFError("Attempted to read past end of file")             # <<<<<<<<<<<<<<
 *         cdef int error = self._frame_skip_rest()
 *         return False if error else True
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_read_past_end_of_fi); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "pysdif/_pysdif.pyx":1900
 *         sig = asbytes(signature)
 *         if isinstance(column_names, (str, bytes)):
 *             column_names = asbytes(column_names).replace(b",", b" ").split()             # <<<<<<<<<<<<<<
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 *         if mt == NULL:
 */
  __pyx_tuple__22 = PyTuple_Pack(2, __pyx_kp_b__21, __pyx_kp_b__4); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "pysdif/_pysdif.pyx":1903
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 *         if mt == NULL:
 *             raise RuntimeError("Could not create matrixtype")             # <<<<<<<<<<<<<<
 *         SdifPutMatrixType(self.this.MatrixTypesTable, mt)
 *         # TODO: is this a memory leak? who destroys the MatrixType?
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Could_not_create_matrixtype); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "pysdif/_pysdif.pyx":1945
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)
 *         if ft == NULL:
 *             raise RuntimeError("Could not create frametype")             # <<<<<<<<<<<<<<
 *         SdifPutFrameType(self.this.FrameTypesTable, ft)
 *         # TODO: is this a memory leak? who destroys the FrameType?
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Could_not_create_frametype); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "pysdif/_pysdif.pyx":1963
 *         """
 *         if not(self.this.Mode == eWriteFile or self.this.Mode == eReadWriteFile):
 *             raise IOError("This function is only possible for SdifFiles opened in write mode")             # <<<<<<<<<<<<<<
 *         frametypes = source.get_frame_types()
 *         matrixtypes = source.get_matrix_types()
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_This_function_is_only_possible_f); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "pysdif/_pysdif.pyx":2091
 *         # a component is a strings '{Signature} {Description}'
 *         if not components:
 *             raise KeyError("signature not found")             # <<<<<<<<<<<<<<
 *         self.add_frame_type(sig, components)
 *         for comp in components:
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_signature_not_found); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __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)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __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)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":945
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":951
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "pysdif/_pysdif.pyx":36
 * from numpy cimport ndarray, npy_intp
 * import logging
 * logger = logging.getLogger("pysdif")             # <<<<<<<<<<<<<<
 * logger.setLevel(logging.INFO)
 * 
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_pysdif); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "pysdif/_pysdif.pyx":147
 * 
 * 
 * def signature2str(int sig):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a numeric signature into a string signature
 */
  __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_sig, __pyx_n_s_sig); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 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_pysdif__pysdif_pyx, __pyx_n_s_signature2str, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 147, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":160
 * 
 * 
 * def str2signature(s):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a 4-byte string signature into a numeric signature
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_pysdif__pysdif_pyx, __pyx_n_s_str2signature, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 160, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_MatrixTypeDefinition__set_state(self, __pyx_state)
 */
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(1, 16, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__44 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Component__set_state(self, __pyx_state)
 */
  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 16, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FrameTypeDefinition__set_state(self, __pyx_state)
 */
  __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 16, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":443
 * }
 * 
 * def read_sdiftypes():             # <<<<<<<<<<<<<<
 *     """
 *     Retrieves predefined types definitions parsed from SdifTypes.STYP
 */
  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_frametypes, __pyx_n_s_matrixtypes); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_read_sdiftypes, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 443, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":455
 *     return frametypes, matrixtypes
 * 
 * def _frametypes_populate():             # <<<<<<<<<<<<<<
 *     frametypeslist, matrixtypeslist = read_sdiftypes()
 *     frametypes = {f.signature: f.components for f in frametypeslist}
 */
  __pyx_tuple__54 = PyTuple_Pack(13, __pyx_n_s_frametypeslist, __pyx_n_s_matrixtypeslist, __pyx_n_s_frametypes, __pyx_n_s_matrixtypes, __pyx_n_s_allframetypes, __pyx_n_s_f, __pyx_n_s_components, __pyx_n_s_allmatrixtypes, __pyx_n_s_matrixsig, __pyx_n_s_column_names, __pyx_n_s_f, __pyx_n_s_m, __pyx_n_s_comp); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frametypes_populate, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 455, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":468
 * 
 * 
 * def predefined_frametypes():             # <<<<<<<<<<<<<<
 *     """
 *     Returns a dict of predefined sdif frame types
 */
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_predefined_frametypes, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 468, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":478
 * 
 * 
 * def predefined_matrixtypes():             # <<<<<<<<<<<<<<
 *     """
 *     Returns a list of predefined sdif matrix types
 */
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_predefined_matrixtypes, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 478, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":489
 * # ----------------------------------------------------------------------
 * 
 * def _find_sdiftypes():             # <<<<<<<<<<<<<<
 * 
 *     def get_packaged_sdiftypes():
 */
  __pyx_tuple__58 = PyTuple_Pack(8, __pyx_n_s_get_packaged_sdiftypes, __pyx_n_s_get_packaged_sdiftypes, __pyx_n_s_pl, __pyx_n_s_paths, __pyx_n_s_warnings, __pyx_n_s_p, __pyx_n_s_p2, __pyx_n_s_packaged_sdiftypes); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_find_sdiftypes, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 489, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":525
 * 
 * 
 * def sdif_init(sdiftypes_path=None):             # <<<<<<<<<<<<<<
 *     """
 *     Initialize the sdif library
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_sdiftypes_path); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_sdif_init, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 525, __pyx_L1_error)
  __pyx_tuple__62 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "pysdif/_pysdif.pyx":563
 * 
 * 
 * def sdif_cleanup():             # <<<<<<<<<<<<<<
 *     SdifGenKill()
 * 
 */
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_sdif_cleanup, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 563, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":598
 * 
 * cdef tuple _framestatus2str = (
 *     "Invalid",             # <<<<<<<<<<<<<<
 *     "NothingRead",
 *     "HeaderRead",
 */
  __pyx_tuple__64 = PyTuple_Pack(6, __pyx_n_s_Invalid, __pyx_n_s_NothingRead, __pyx_n_s_HeaderRead, __pyx_n_s_SomeDataRead, __pyx_n_s_AllDataRead, __pyx_n_s_SignatureRead); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "pysdif/_pysdif.pyx":606
 * )
 * 
 * def framestatus2str(int status):             # <<<<<<<<<<<<<<
 *     if 0 <= status < 6:
 *         return _framestatus2str[status]
 */
  __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_status, __pyx_n_s_status); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_framestatus2str, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 606, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":612
 * 
 * cdef tuple _matrixstatus2str = (
 *     "Invalid",             # <<<<<<<<<<<<<<
 *     "NothingRead",
 *     "HeaderRead",
 */
  __pyx_tuple__67 = PyTuple_Pack(6, __pyx_n_s_Invalid, __pyx_n_s_NothingRead, __pyx_n_s_HeaderRead, __pyx_n_s_DataRead, __pyx_n_s_DataSkipped, __pyx_n_s_Offline); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "pysdif/_pysdif.pyx":620
 * )
 * 
 * def matrixstatus2str(int status):             # <<<<<<<<<<<<<<
 *     """
 *     Return a string identifier for a matrix status.
 */
  __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_status, __pyx_n_s_status); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_matrixstatus2str, 620, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 620, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":718
 *                 return self._signature
 * 
 *     def get_data(self, copy=True):             # <<<<<<<<<<<<<<
 *         """
 *         Read the data from the matrix as a numpy array
 */
  __pyx_tuple__70 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_copy); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_get_data, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 718, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":747
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 * 
 *     def column_names(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of column names for the current matrix
 */
  __pyx_tuple__72 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sig, __pyx_n_s_matrixtypes, __pyx_n_s_colnames, __pyx_n_s_mtd); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_column_names, 747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 747, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":761
 *         return colnames
 * 
 *     def skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skip reading the data
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_skip, 761, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 761, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":906
 *         return matrix
 * 
 *     def get_matrix(self, copy=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reads the next matrix entirely, returns (matrixsig, data)
 */
  __pyx_tuple__80 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_copy, __pyx_n_s_matrix); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_get_matrix, 906, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 906, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__84 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":991
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_enter, 991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 991, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":996
 *         return self
 * 
 *     def __exit__(self, exception_type, exception_value, traceback):             # <<<<<<<<<<<<<<
 *         if self.num_matrices == 0:
 *             raise RuntimeError("No matrices were added! Frame not written")
 */
  __pyx_tuple__88 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exception_type, __pyx_n_s_exception_value, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_exit, 996, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 996, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1004
 *         def __get__(self): return bool(self._written)
 * 
 *     def add_matrix(self, str signature, c_numpy.ndarray data_array):             # <<<<<<<<<<<<<<
 *         """
 *         Add a matrix to this Frame
 */
  __pyx_tuple__90 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_signature, __pyx_n_s_data_array); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_add_matrix, 1004, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 1004, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1023
 *             data_array.shape[0], data_array.shape[1]) # rows, cols
 * 
 *     def write(self):             # <<<<<<<<<<<<<<
 *         """
 *         Write the current frame to disk.
 */
  __pyx_tuple__92 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_fsz, __pyx_n_s_matrix_sig, __pyx_n_s_dtype, __pyx_n_s_matrix, __pyx_n_s_i); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_write, 1023, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 1023, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__94 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FrameW__set_state(self, __pyx_state)
 */
  __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(1, 16, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1232
 *         self.close()  # fails silently if already closed
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close this SdifFile
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_close, 1232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 1232, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1286
 *         return self.this.CurrFramPos
 * 
 *     def curr_matrix_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of rows and number of columns in the current matrix
 */
  __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_m); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_curr_matrix_size, 1286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 1286, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1305
 *         return (m.NbRow, m.NbCol)
 * 
 *     def curr_matrix_datatype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the datatype code (an int) or 0 if go current matrix
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_curr_matrix_datatype, 1305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 1305, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1316
 *         return self.this.CurrMtrxH.DataType
 * 
 *     def curr_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level interface** - Return the current frame's numerical signature
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_curr_signature, 1316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 1316, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1330
 *         return self.this.CurrMtrxH.Signature
 * 
 *     def curr_matrix_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the string signature of the current matrix, or None if no current matrix
 */
  __pyx_tuple__106 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sig); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_curr_matrix_signature, 1330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 1330, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1344
 *         return None
 * 
 *     def frame_num_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of matrices in current frame.
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_num_matrix, 1344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 1344, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1357
 *         return self.this.CurrFramH.NbMatrix
 * 
 *     def frame_id(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the id of the current frame, or -1 if no current frame
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);
  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_id, 1357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 1357, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1382
 *         SdifFSetPos(self.this, &pos)
 * 
 *     def frame_numerical_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the num. signature of current frame, or -1 if no current frame
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);
  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_numerical_signature, 1382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 1382, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1394
 *         return self.this.CurrFramH.Signature
 * 
 *     def frame_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the str. signature of the current frame, or None if no current frame
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 1394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_signature, 1394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 1394, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1405
 *         return sig2str(self.this.CurrFramH.Signature)
 * 
 *     def frame_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the time of the current frame, or -1 if no current frame
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_time, 1405, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 1405, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1416
 *         return self.this.CurrFramH.Time
 * 
 *     def last_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns (error_tag, error_level) or None if there is no last error
 */
  __pyx_tuple__118 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_error); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_last_error, 1416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 1416, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1426
 *         return (error.Tag, error.Level)
 * 
 *     def curr_frame_is_selected(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the current frame is selected.
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);
  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_curr_frame_is_selected, 1426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 1426, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1443
 *         return bool(SdifFCurrFrameIsSelected(self.this))
 * 
 *     def curr_matrix_is_selected(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the current matrix is selected.
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_curr_matrix_is_selected, 1443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 1443, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1458
 *         return bool(SdifFCurrMatrixIsSelected(self.this))
 * 
 *     def get_num_NVTs(self):             # <<<<<<<<<<<<<<
 *         if SdifNameValuesLIsNotEmpty(self.this.NameValues):
 *             return SdifFNameValueNum(self.this)
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_get_num_NVTs, 1458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 1458, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1485
 *         return bytes_read
 * 
 *     def frame_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         ** Low level interface ** - Read the frame header.
 */
  __pyx_tuple__126 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_error, __pyx_n_s_bytesread); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_read_header, 1485, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 1485, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1514
 *                 raise SdifOrderError("The frame should be read or skipped before a new header is read")
 * 
 *     def frame_skip_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low level interface** - Skip frame and all its matrices
 */
  __pyx_tuple__128 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_bytes_read, __pyx_n_s_error); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_skip_data, 1514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1514, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1525
 *         return bytes_read
 * 
 *     cpdef int _read_signature(self):             # <<<<<<<<<<<<<<
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_read_signature, 1525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 1525, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1544
 *         return SdifFReadMatrixHeader(self.this)
 * 
 *     def matrix_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low level interface** - Read the matrix header
 */
  __pyx_tuple__132 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bytesread); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_matrix_read_header, 1544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 1544, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1571
 *         return bytesread
 * 
 *     def curr_frame_available(self):             # <<<<<<<<<<<<<<
 *        return self.this.CurrFramH != NULL
 * 
 */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_curr_frame_available, 1571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 1571, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1574
 *        return self.this.CurrFramH != NULL
 * 
 *     def curr_matrix_available(self):             # <<<<<<<<<<<<<<
 *        return self.this.CurrMtrxH != NULL
 * 
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_curr_matrix_available, 1574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 1574, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1577
 *        return self.this.CurrMtrxH != NULL
 * 
 *     def matrix_skip_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level Interface** - Skip the matrix data without reading it.
 */
  __pyx_tuple__138 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_bytes_read, __pyx_n_s_error); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_matrix_skip_data, 1577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 1577, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1615
 *         return bytesread
 * 
 *     def matrix_read_data(self, copy=False):             # <<<<<<<<<<<<<<
 *         """
 *         Read the data of the current matrix as a numpy array
 */
  __pyx_tuple__140 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_copy, __pyx_n_s_status, __pyx_n_s_bytesread); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_matrix_read_data, 1615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 1615, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1670
 *         return 0
 * 
 *     def matrix_skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         Low level Interface. Skip the matrix altogether.
 */
  __pyx_tuple__142 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_matrix_status, __pyx_n_s_bytes_read, __pyx_n_s_error); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_matrix_skip, 1670, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 1670, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1697
 *         return bytes_read
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple (curr_frame_status, curr_matrix_index, curr_matrix_status)
 */
  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_status, 1697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 1697, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1722
 *             return
 * 
 *     def next_frame(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the next frame, returns a Frame or None if no more frames left.
 */
  __pyx_tuple__146 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_next_frame, 1722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 1722, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1753
 *         return self.frame if self.eof == 0 else None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);
  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_enter, 1753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 1753, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1756
 *         return self
 * 
 *     def __exit__(self):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */
  __pyx_tuple__150 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 1756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);
  __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_exit, 1756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 1756, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1759
 *         self.close()
 * 
 *     def frame_skip_rest(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skipts the rest of the frame, so that a new frame can be read.
 */
  __pyx_tuple__152 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_error); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_skip_rest, 1759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 1759, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1804
 *         return 0
 * 
 *     def next_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the next matrix header and return a Matrix with its data **still not read**.
 */
  __pyx_tuple__154 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_matrix_status); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);
  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_next_matrix, 1804, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(0, 1804, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1828
 *         return self.matrix
 * 
 *     def rewind(self):             # <<<<<<<<<<<<<<
 *         """
 *         Rewind the SdifFile.
 */
  __pyx_tuple__156 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 1828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);
  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_rewind, 1828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 1828, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1838
 *         self.reinit()
 * 
 *     def _rewind(self):             # <<<<<<<<<<<<<<
 *         SdifFRewind(self.this)
 * 
 */
  __pyx_tuple__158 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_rewind_2, 1838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 1838, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1847
 *             self.init_write()
 * 
 *     def _read_padding(self):             # <<<<<<<<<<<<<<
 *         return SdifFReadPadding(self.this, SdifFPaddingCalculate(self.this.Stream, self.this.Pos))
 * 
 */
  __pyx_tuple__160 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_read_padding, 1847, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 1847, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1854
 *     # ------------------------------------------------
 * 
 *     def add_NVT(self, dict d):             # <<<<<<<<<<<<<<
 *         """
 *         The NVT (Name Value Table) is a place to put metadata about the file.
 */
  __pyx_tuple__162 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_d, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_add_NVT, 1854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(0, 1854, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1882
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, asbytes(name), asbytes(value))
 * 
 *     def add_matrix_type(self, signature, column_names):             # <<<<<<<<<<<<<<
 *         """
 *         Adds a matrix type to this Sdif
 */
  __pyx_tuple__164 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_signature, __pyx_n_s_column_names, __pyx_n_s_sig, __pyx_n_s_mt); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);
  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_add_matrix_type, 1882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(0, 1882, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1908
 *         #self.frame_status = eFrameInvalid
 * 
 *     def add_frame_type(self, signature, list components):             # <<<<<<<<<<<<<<
 *         """
 *         Adds a frame type to this sdif.
 */
  __pyx_tuple__166 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_signature, __pyx_n_s_components, __pyx_n_s_ft); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_add_frame_type, 1908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(0, 1908, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1949
 *         # TODO: is this a memory leak? who destroys the FrameType?
 * 
 *     def clone_type_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 * 
 */
  __pyx_tuple__168 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_frametypes, __pyx_n_s_matrixtypes, __pyx_n_s_frametype, __pyx_n_s_matrixtype); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);
  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_clone_type_definitions, 1949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(0, 1949, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":1971
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 * 
 *     def clone_NVTs(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         Clone the NVT (name:value table) from source (an open SdifFile)
 */
  __pyx_tuple__170 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_nvt); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 1971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_clone_NVTs, 1971, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 1971, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2000
 *             self.add_NVT(nvt)
 * 
 *     def clone_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         Only for writing mode - Clone both NVT(s), frame and matrix definitions
 */
  __pyx_tuple__172 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_source); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_clone_definitions, 2000, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(0, 2000, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2030
 *         return self
 * 
 *     def clone_frames(self, SdifFile source, signatures_to_clone=None):             # <<<<<<<<<<<<<<
 *         """
 *         Clone all the frames in source which are included in
 */
  __pyx_tuple__174 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_signatures_to_clone, __pyx_n_s_sigs, __pyx_n_s_frame0, __pyx_n_s_frame1, __pyx_n_s_matrix, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 2030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);
  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_clone_frames, 2030, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(0, 2030, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2060
 *                 frame1.write()
 * 
 *     def add_streamID(self, unsigned int numid, char *source, char *treeway):             # <<<<<<<<<<<<<<
 *         """
 *         This method is only there for completion.
 */
  __pyx_tuple__176 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_numid, __pyx_n_s_source, __pyx_n_s_treeway); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 2060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_add_streamID, 2060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 2060, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2077
 *             numid, source, treeway)
 * 
 *     def add_predefined_frametype(self, signature):             # <<<<<<<<<<<<<<
 *         """
 *         Add a predefined frame type with corresponding matrix definitions
 */
  __pyx_tuple__178 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_signature, __pyx_n_s_sig, __pyx_n_s_components, __pyx_n_s_comp, __pyx_n_s_matrixsig, __pyx_n_s_matrixrole, __pyx_n_s_column_names); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);
  __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_add_predefined_frametype, 2077, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(0, 2077, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2102
 *             self.add_matrix_type(matrixsig, column_names)
 * 
 *     def write_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level Interface**
 */
  __pyx_tuple__180 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 2102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_write_all_ascii_chunks, 2102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 2102, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2117
 *         self.write_status = eSdifAllASCIIChunks
 * 
 *     def new_frame(self, signature, SdifFloat8 time, SdifUInt4 streamID=0):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new frame with given signature and at given time
 */
  __pyx_tuple__182 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_signature, __pyx_n_s_time, __pyx_n_s_streamID); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_new_frame, 2117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 2117, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2162
 *         return FrameW_new(self, str2sig(asbytes(signature)), time, streamID)
 * 
 *     def new_frame_one_matrix(self, frame_sig, SdifFloat8 time, matrix_sig,             # <<<<<<<<<<<<<<
 *                              c_numpy.ndarray matrixdata, SdifUInt4 streamID=0):
 *         """
 */
  __pyx_tuple__184 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_frame_sig, __pyx_n_s_time, __pyx_n_s_matrix_sig, __pyx_n_s_matrixdata, __pyx_n_s_streamID, __pyx_n_s_frame_size); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 2162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);
  __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_new_frame_one_matrix, 2162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 2162, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2206
 * 
 *     # low level functions to print info
 *     def print_NVT(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllNameValueNVT(self.this)
 */
  __pyx_tuple__186 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 2206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_print_NVT, 2206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 2206, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2210
 *         SdifFPrintAllNameValueNVT(self.this)
 * 
 *     def print_general_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)
 */
  __pyx_tuple__188 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);
  __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_print_general_header, 2210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 2210, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2214
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)
 * 
 *     def print_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllASCIIChunks(self.this)
 */
  __pyx_tuple__190 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);
  __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_print_all_ascii_chunks, 2214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 2214, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2218
 *         SdifFPrintAllASCIIChunks(self.this)
 * 
 *     def print_all_types(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllType(self.this)
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);
  __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_print_all_types, 2218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 2218, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2222
 *         SdifFPrintAllType(self.this)
 * 
 *     def print_matrix_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintMatrixHeader(self.this)
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);
  __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_print_matrix_header, 2222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 2222, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2226
 *         SdifFPrintMatrixHeader(self.this)
 * 
 *     def print_one_row(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintOneRow(self.this)
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);
  __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_print_one_row, 2226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 2226, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2230
 *         SdifFPrintOneRow(self.this)
 * 
 *     def print_frame_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintFrameHeader(self.this)
 */
  __pyx_tuple__198 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_print_frame_header, 2230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 2230, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2234
 *         SdifFPrintFrameHeader(self.this)
 * 
 *     def print_all_stream_ID(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllStreamID(self.this)
 */
  __pyx_tuple__200 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_print_all_stream_ID, 2234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 2234, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2238
 *         SdifFPrintAllStreamID(self.this)
 * 
 *     def frame_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         returns a string with all frame types
 */
  __pyx_tuple__202 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sdifstr, __pyx_n_s_out); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_frame_types_to_string, 2238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 2238, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2250
 *         return out
 * 
 *     def get_frame_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of Frame Type Definitions (1FTD)
 */
  __pyx_tuple__204 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 2250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_get_frame_types, 2250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 2250, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2259
 *         return FrameTypesTable_to_list(self.this.FrameTypesTable)
 * 
 *     def matrix_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string with all matrix types
 */
  __pyx_tuple__206 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sdifstr, __pyx_n_s_out); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_matrix_types_to_string, 2259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 2259, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2273
 *         return out
 * 
 *     def get_matrix_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get a list of matrix type definitions (1MTD)
 */
  __pyx_tuple__208 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 2273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_get_matrix_types, 2273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 2273, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2283
 *         return MatrixTypesTable_to_list(self.this.MatrixTypesTable)
 * 
 *     def get_NVTs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list with all defined NameValueTables
 */
  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_get_NVTs, 2283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 2283, __pyx_L1_error)

  /* "pysdif/_pysdif.pyx":2295
 *         return valuetables_to_dicts(self.this.NameValues)
 * 
 *     def get_stream_IDs(self):             # <<<<<<<<<<<<<<
 *         return streamidtable_to_list(self.this.StreamIDsTable)
 * 
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysdif__pysdif_pyx, __pyx_n_s_get_stream_IDs, 2295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 2295, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__214 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__216 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);
  __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_MatrixTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__218 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);
  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_MatrixTypeDefinit, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__220 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Component, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__222 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FrameTypeDefiniti, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__224 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FrameW, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyBytes_Type_split.type = (PyObject*)&PyBytes_Type;
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_257 = PyInt_FromLong(257); if (unlikely(!__pyx_int_257)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_258 = PyInt_FromLong(258); if (unlikely(!__pyx_int_258)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_260 = PyInt_FromLong(260); if (unlikely(!__pyx_int_260)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_264 = PyInt_FromLong(264); if (unlikely(!__pyx_int_264)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_513 = PyInt_FromLong(513); if (unlikely(!__pyx_int_513)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_514 = PyInt_FromLong(514); if (unlikely(!__pyx_int_514)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_516 = PyInt_FromLong(516); if (unlikely(!__pyx_int_516)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_520 = PyInt_FromLong(520); if (unlikely(!__pyx_int_520)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_769 = PyInt_FromLong(769); if (unlikely(!__pyx_int_769)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_13398827 = PyInt_FromLong(13398827L); if (unlikely(!__pyx_int_13398827)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_20897590 = PyInt_FromLong(20897590L); if (unlikely(!__pyx_int_20897590)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_57246580 = PyInt_FromLong(57246580L); if (unlikely(!__pyx_int_57246580)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_66826235 = PyInt_FromLong(66826235L); if (unlikely(!__pyx_int_66826235)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_6pysdif_7_pysdif_FILEMODE_STR2MODE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_6pysdif_7_pysdif_FILEMODE_MODE2STR = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_6pysdif_7_pysdif__framestatus2str = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_6pysdif_7_pysdif__matrixstatus2str = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_StreamID) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif_StreamID.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif_StreamID.tp_dictoffset && __pyx_type_6pysdif_7_pysdif_StreamID.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif_StreamID.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StreamID, (PyObject *)&__pyx_type_6pysdif_7_pysdif_StreamID) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pysdif_7_pysdif_StreamID) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
  __pyx_ptype_6pysdif_7_pysdif_StreamID = &__pyx_type_6pysdif_7_pysdif_StreamID;
  __pyx_vtabptr_6pysdif_7_pysdif_MatrixTypeDefinition = &__pyx_vtable_6pysdif_7_pysdif_MatrixTypeDefinition;
  __pyx_vtable_6pysdif_7_pysdif_MatrixTypeDefinition.toSdifMatrixType = (SdifMatrixTypeT *(*)(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *))__pyx_f_6pysdif_7_pysdif_20MatrixTypeDefinition_toSdifMatrixType;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition.tp_dictoffset && __pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 327, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_6pysdif_7_pysdif_20MatrixTypeDefinition___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6pysdif_7_pysdif_20MatrixTypeDefinition___init__.doc = __pyx_doc_6pysdif_7_pysdif_20MatrixTypeDefinition___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pysdif_7_pysdif_20MatrixTypeDefinition___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition.tp_dict, __pyx_vtabptr_6pysdif_7_pysdif_MatrixTypeDefinition) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MatrixTypeDefinition, (PyObject *)&__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  __pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition = &__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_Component) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif_Component.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif_Component.tp_dictoffset && __pyx_type_6pysdif_7_pysdif_Component.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif_Component.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Component, (PyObject *)&__pyx_type_6pysdif_7_pysdif_Component) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pysdif_7_pysdif_Component) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
  __pyx_ptype_6pysdif_7_pysdif_Component = &__pyx_type_6pysdif_7_pysdif_Component;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif_FrameTypeDefinition.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition.tp_dictoffset && __pyx_type_6pysdif_7_pysdif_FrameTypeDefinition.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif_FrameTypeDefinition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 410, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_6pysdif_7_pysdif_19FrameTypeDefinition___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6pysdif_7_pysdif_19FrameTypeDefinition___init__.doc = __pyx_doc_6pysdif_7_pysdif_19FrameTypeDefinition___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pysdif_7_pysdif_19FrameTypeDefinition___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FrameTypeDefinition, (PyObject *)&__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
  __pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition = &__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_FrameR) < 0) __PYX_ERR(0, 786, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif_FrameR.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif_FrameR.tp_dictoffset && __pyx_type_6pysdif_7_pysdif_FrameR.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif_FrameR.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pysdif_7_pysdif_FrameR, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 786, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_6pysdif_7_pysdif_6FrameR_10__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6pysdif_7_pysdif_6FrameR_10__next__.doc = __pyx_doc_6pysdif_7_pysdif_6FrameR_10__next__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pysdif_7_pysdif_6FrameR_10__next__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FrameR, (PyObject *)&__pyx_type_6pysdif_7_pysdif_FrameR) < 0) __PYX_ERR(0, 786, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pysdif_7_pysdif_FrameR) < 0) __PYX_ERR(0, 786, __pyx_L1_error)
  __pyx_ptype_6pysdif_7_pysdif_FrameR = &__pyx_type_6pysdif_7_pysdif_FrameR;
  __pyx_vtabptr_6pysdif_7_pysdif_SdifFile = &__pyx_vtable_6pysdif_7_pysdif_SdifFile;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.init_read = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_read;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.init_containers = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_containers;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.init_write = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_write;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.curr_matrix_numerical_signature = (int (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_curr_matrix_numerical_signature;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile._frame_read_header = (int (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile__frame_read_header;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile._read_signature = (int (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *, int __pyx_skip_dispatch))__pyx_f_6pysdif_7_pysdif_8SdifFile__read_signature;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile._read_matrix_header = (size_t (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile__read_matrix_header;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile._matrix_read_data = (int (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile__matrix_read_data;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile._finalize_matrix = (int (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_matrix;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile._next_frame = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile__next_frame;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile._frame_skip_rest = (int (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile__frame_skip_rest;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile._finalize_frame = (int (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile__finalize_frame;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.reinit = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_reinit;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_SdifFile) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif_SdifFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif_SdifFile.tp_dictoffset && __pyx_type_6pysdif_7_pysdif_SdifFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif_SdifFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pysdif_7_pysdif_SdifFile, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1069, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_6pysdif_7_pysdif_8SdifFile_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6pysdif_7_pysdif_8SdifFile_2__init__.doc = __pyx_doc_6pysdif_7_pysdif_8SdifFile_2__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pysdif_7_pysdif_8SdifFile_2__init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_6pysdif_7_pysdif_SdifFile.tp_dict, __pyx_vtabptr_6pysdif_7_pysdif_SdifFile) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SdifFile, (PyObject *)&__pyx_type_6pysdif_7_pysdif_SdifFile) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pysdif_7_pysdif_SdifFile) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
  __pyx_ptype_6pysdif_7_pysdif_SdifFile = &__pyx_type_6pysdif_7_pysdif_SdifFile;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_Matrix) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif_Matrix.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif_Matrix.tp_dictoffset && __pyx_type_6pysdif_7_pysdif_Matrix.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif_Matrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Matrix, (PyObject *)&__pyx_type_6pysdif_7_pysdif_Matrix) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pysdif_7_pysdif_Matrix) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  __pyx_ptype_6pysdif_7_pysdif_Matrix = &__pyx_type_6pysdif_7_pysdif_Matrix;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_FrameW) < 0) __PYX_ERR(0, 947, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif_FrameW.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif_FrameW.tp_dictoffset && __pyx_type_6pysdif_7_pysdif_FrameW.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif_FrameW.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FrameW, (PyObject *)&__pyx_type_6pysdif_7_pysdif_FrameW) < 0) __PYX_ERR(0, 947, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6pysdif_7_pysdif_FrameW) < 0) __PYX_ERR(0, 947, __pyx_L1_error)
  __pyx_ptype_6pysdif_7_pysdif_FrameW = &__pyx_type_6pysdif_7_pysdif_FrameW;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif___pyx_scope_struct____init__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif___pyx_scope_struct____init__.tp_dictoffset && __pyx_type_6pysdif_7_pysdif___pyx_scope_struct____init__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif___pyx_scope_struct____init__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct____init__ = &__pyx_type_6pysdif_7_pysdif___pyx_scope_struct____init__;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr = &__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames) < 0) __PYX_ERR(0, 2030, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames.tp_dictoffset && __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames = &__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_2_clone_frames;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 2052, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr = &__pyx_type_6pysdif_7_pysdif___pyx_scope_struct_3_genexpr;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC init_pysdif(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC init_pysdif(void)
#else
__Pyx_PyMODINIT_FUNC PyInit__pysdif(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__pysdif(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
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) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec__pysdif(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '_pysdif' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__pysdif(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_pysdif", __pyx_methods, __pyx_k_GPL_This_file_is_part_of_pysdif, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_pysdif___pysdif) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "pysdif._pysdif")) {
      if (unlikely(PyDict_SetItemString(modules, "pysdif._pysdif", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "pysdif/_pysdif.pyx":30
 *     void import_array()
 * 
 * import os.path             # <<<<<<<<<<<<<<
 * import platform
 * import numpy as np
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":31
 * 
 * import os.path
 * import platform             # <<<<<<<<<<<<<<
 * import numpy as np
 * cimport numpy as c_numpy
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_platform, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":32
 * import os.path
 * import platform
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as c_numpy
 * from numpy cimport ndarray, npy_intp
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":35
 * cimport numpy as c_numpy
 * from numpy cimport ndarray, npy_intp
 * import logging             # <<<<<<<<<<<<<<
 * logger = logging.getLogger("pysdif")
 * logger.setLevel(logging.INFO)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":36
 * from numpy cimport ndarray, npy_intp
 * import logging
 * logger = logging.getLogger("pysdif")             # <<<<<<<<<<<<<<
 * logger.setLevel(logging.INFO)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logging); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":37
 * import logging
 * logger = logging.getLogger("pysdif")
 * logger.setLevel(logging.INFO)             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "numpy/arrayobject.h":
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setLevel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logging); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_INFO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":48
 * ######################################
 * 
 * class NoFrame(Exception): pass             # <<<<<<<<<<<<<<
 * class NoMatrix(Exception): pass
 * class SdifOrderError(Exception): pass
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_NoFrame, __pyx_n_s_NoFrame, (PyObject *) NULL, __pyx_n_s_pysdif__pysdif, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_NoFrame, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoFrame, __pyx_t_4) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":49
 * 
 * class NoFrame(Exception): pass
 * class NoMatrix(Exception): pass             # <<<<<<<<<<<<<<
 * class SdifOrderError(Exception): pass
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_NoMatrix, __pyx_n_s_NoMatrix, (PyObject *) NULL, __pyx_n_s_pysdif__pysdif, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_NoMatrix, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoMatrix, __pyx_t_4) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":50
 * class NoFrame(Exception): pass
 * class NoMatrix(Exception): pass
 * class SdifOrderError(Exception): pass             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SdifOrderError, __pyx_n_s_SdifOrderError, (PyObject *) NULL, __pyx_n_s_pysdif__pysdif, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SdifOrderError, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SdifOrderError, __pyx_t_4) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":60
 * # ----------------------------------------------------------------------------------
 * 
 * cdef int SDIF_CLOSED = 2             # <<<<<<<<<<<<<<
 * cdef int _g_sdif_initiated = 0
 * 
 */
  __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED = 2;

  /* "pysdif/_pysdif.pyx":61
 * 
 * cdef int SDIF_CLOSED = 2
 * cdef int _g_sdif_initiated = 0             # <<<<<<<<<<<<<<
 * 
 * cdef dict FILEMODE_STR2MODE = {
 */
  __pyx_v_6pysdif_7_pysdif__g_sdif_initiated = 0;

  /* "pysdif/_pysdif.pyx":64
 * 
 * cdef dict FILEMODE_STR2MODE = {
 *     'r' : eReadFile,             # <<<<<<<<<<<<<<
 *     'w' : eWriteFile,
 *     'rw': eReadWriteFile,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_enum__SdifFileModeE(eReadFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_r, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":65
 * cdef dict FILEMODE_STR2MODE = {
 *     'r' : eReadFile,
 *     'w' : eWriteFile,             # <<<<<<<<<<<<<<
 *     'rw': eReadWriteFile,
 *     'wr': eReadWriteFile
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__SdifFileModeE(eWriteFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_w, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":66
 *     'r' : eReadFile,
 *     'w' : eWriteFile,
 *     'rw': eReadWriteFile,             # <<<<<<<<<<<<<<
 *     'wr': eReadWriteFile
 * }
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__SdifFileModeE(eReadWriteFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rw, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":67
 *     'w' : eWriteFile,
 *     'rw': eReadWriteFile,
 *     'wr': eReadWriteFile             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__SdifFileModeE(eReadWriteFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_wr, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_6pysdif_7_pysdif_FILEMODE_STR2MODE);
  __Pyx_DECREF_SET(__pyx_v_6pysdif_7_pysdif_FILEMODE_STR2MODE, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":71
 * 
 * cdef dict FILEMODE_MODE2STR = {
 *     eReadFile: 'r',             # <<<<<<<<<<<<<<
 *     eWriteFile: 'w',
 *     eReadWriteFile: 'rw'
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_enum__SdifFileModeE(eReadFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_s_r) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":72
 * cdef dict FILEMODE_MODE2STR = {
 *     eReadFile: 'r',
 *     eWriteFile: 'w',             # <<<<<<<<<<<<<<
 *     eReadWriteFile: 'rw'
 * }
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__SdifFileModeE(eWriteFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_s_w) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":73
 *     eReadFile: 'r',
 *     eWriteFile: 'w',
 *     eReadWriteFile: 'rw'             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__SdifFileModeE(eReadWriteFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_n_s_rw) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_6pysdif_7_pysdif_FILEMODE_MODE2STR);
  __Pyx_DECREF_SET(__pyx_v_6pysdif_7_pysdif_FILEMODE_MODE2STR, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":77
 * 
 * cdef dict _SDIF_DATATYPES = {
 *     0x0301:"char",             # <<<<<<<<<<<<<<
 *     0x0004:"float32",
 *     0x0008:"float64",
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_769, __pyx_n_s_char) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, __pyx_n_s_float32) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, __pyx_n_s_float64) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_257, __pyx_n_s_int8) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_258, __pyx_n_s_int16) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_260, __pyx_n_s_int32) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_264, __pyx_n_s_int64) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_513, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_514, __pyx_n_s_uint16) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_516, __pyx_n_s_uint32) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_520, __pyx_n_s_uint64) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES);
  __Pyx_DECREF_SET(__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":91
 * 
 * cdef dict _SDIF_TO_NUMPY_TYPENUM = {
 *     0x0301:c_numpy.NPY_BYTE,             # <<<<<<<<<<<<<<
 *     0x0004:c_numpy.NPY_FLOAT,
 *     0x0008:c_numpy.NPY_DOUBLE,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_769, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":92
 * cdef dict _SDIF_TO_NUMPY_TYPENUM = {
 *     0x0301:c_numpy.NPY_BYTE,
 *     0x0004:c_numpy.NPY_FLOAT,             # <<<<<<<<<<<<<<
 *     0x0008:c_numpy.NPY_DOUBLE,
 *     0x0101:c_numpy.NPY_BYTE,
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":93
 *     0x0301:c_numpy.NPY_BYTE,
 *     0x0004:c_numpy.NPY_FLOAT,
 *     0x0008:c_numpy.NPY_DOUBLE,             # <<<<<<<<<<<<<<
 *     0x0101:c_numpy.NPY_BYTE,
 *     0x0102:c_numpy.NPY_SHORT,
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":94
 *     0x0004:c_numpy.NPY_FLOAT,
 *     0x0008:c_numpy.NPY_DOUBLE,
 *     0x0101:c_numpy.NPY_BYTE,             # <<<<<<<<<<<<<<
 *     0x0102:c_numpy.NPY_SHORT,
 *     0x0104:c_numpy.NPY_INT,
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_257, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":95
 *     0x0008:c_numpy.NPY_DOUBLE,
 *     0x0101:c_numpy.NPY_BYTE,
 *     0x0102:c_numpy.NPY_SHORT,             # <<<<<<<<<<<<<<
 *     0x0104:c_numpy.NPY_INT,
 *     0x0108:c_numpy.NPY_LONG,
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_258, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":96
 *     0x0101:c_numpy.NPY_BYTE,
 *     0x0102:c_numpy.NPY_SHORT,
 *     0x0104:c_numpy.NPY_INT,             # <<<<<<<<<<<<<<
 *     0x0108:c_numpy.NPY_LONG,
 *     0x0201:c_numpy.NPY_UBYTE,
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_260, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":97
 *     0x0102:c_numpy.NPY_SHORT,
 *     0x0104:c_numpy.NPY_INT,
 *     0x0108:c_numpy.NPY_LONG,             # <<<<<<<<<<<<<<
 *     0x0201:c_numpy.NPY_UBYTE,
 *     0x0202:c_numpy.NPY_USHORT,
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_264, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":98
 *     0x0104:c_numpy.NPY_INT,
 *     0x0108:c_numpy.NPY_LONG,
 *     0x0201:c_numpy.NPY_UBYTE,             # <<<<<<<<<<<<<<
 *     0x0202:c_numpy.NPY_USHORT,
 *     0x0204:c_numpy.NPY_UINT,
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_513, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":99
 *     0x0108:c_numpy.NPY_LONG,
 *     0x0201:c_numpy.NPY_UBYTE,
 *     0x0202:c_numpy.NPY_USHORT,             # <<<<<<<<<<<<<<
 *     0x0204:c_numpy.NPY_UINT,
 *     0x0208:c_numpy.NPY_ULONG
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_514, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":100
 *     0x0201:c_numpy.NPY_UBYTE,
 *     0x0202:c_numpy.NPY_USHORT,
 *     0x0204:c_numpy.NPY_UINT,             # <<<<<<<<<<<<<<
 *     0x0208:c_numpy.NPY_ULONG
 *     }
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_516, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":101
 *     0x0202:c_numpy.NPY_USHORT,
 *     0x0204:c_numpy.NPY_UINT,
 *     0x0208:c_numpy.NPY_ULONG             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_520, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM);
  __Pyx_DECREF_SET(__pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":147
 * 
 * 
 * def signature2str(int sig):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a numeric signature into a string signature
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_1signature2str, 0, __pyx_n_s_signature2str, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_signature2str, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":160
 * 
 * 
 * def str2signature(s):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a 4-byte string signature into a numeric signature
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_3str2signature, 0, __pyx_n_s_str2signature, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_str2signature, __pyx_t_1) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8StreamID_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StreamID___reduce_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8StreamID_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StreamID___setstate_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_20MatrixTypeDefinition_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MatrixTypeDefinition___reduce_cy, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_MatrixTypeDefinition, (type(self), 0x3fbaffb, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_MatrixTypeDefinition__set_state(self, __pyx_state)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_20MatrixTypeDefinition_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MatrixTypeDefinition___setstate, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_9Component_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Component___reduce_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_Component->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_Component);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Component, (type(self), 0x13edf36, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Component__set_state(self, __pyx_state)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_9Component_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Component___setstate_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_Component->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_Component);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_19FrameTypeDefinition_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameTypeDefinition___reduce_cyt, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FrameTypeDefinition, (type(self), 0x3698374, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FrameTypeDefinition__set_state(self, __pyx_state)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_19FrameTypeDefinition_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameTypeDefinition___setstate_c, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition);

  /* "pysdif/_pysdif.pyx":435
 * 
 * SDIF_PREDEFINEDTYPES = {
 *     'frametypes': {             # <<<<<<<<<<<<<<
 *         b'RBEP': [b'RBEP ReassignedBandEnhancedPartials']
 *     },
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pysdif/_pysdif.pyx":436
 * SDIF_PREDEFINEDTYPES = {
 *     'frametypes': {
 *         b'RBEP': [b'RBEP ReassignedBandEnhancedPartials']             # <<<<<<<<<<<<<<
 *     },
 *     'matrixtypes': {
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_kp_b_RBEP_ReassignedBandEnhancedParti);
  __Pyx_GIVEREF(__pyx_kp_b_RBEP_ReassignedBandEnhancedParti);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_RBEP_ReassignedBandEnhancedParti);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_b_RBEP, __pyx_t_2) < 0) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_frametypes, __pyx_t_3) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysdif/_pysdif.pyx":439
 *     },
 *     'matrixtypes': {
 *         b'RBEP': b'Index, Frequency, Amplitude, Phase, Bandwidth, Offset'             # <<<<<<<<<<<<<<
 *     }
 * }
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_b_RBEP, __pyx_kp_b_Index_Frequency_Amplitude_Phase) < 0) __PYX_ERR(0, 439, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_matrixtypes, __pyx_t_3) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SDIF_PREDEFINEDTYPES, __pyx_t_1) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":443
 * }
 * 
 * def read_sdiftypes():             # <<<<<<<<<<<<<<
 *     """
 *     Retrieves predefined types definitions parsed from SdifTypes.STYP
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_5read_sdiftypes, 0, __pyx_n_s_read_sdiftypes, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_sdiftypes, __pyx_t_1) < 0) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":455
 *     return frametypes, matrixtypes
 * 
 * def _frametypes_populate():             # <<<<<<<<<<<<<<
 *     frametypeslist, matrixtypeslist = read_sdiftypes()
 *     frametypes = {f.signature: f.components for f in frametypeslist}
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_7_frametypes_populate, 0, __pyx_n_s_frametypes_populate, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frametypes_populate, __pyx_t_1) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":468
 * 
 * 
 * def predefined_frametypes():             # <<<<<<<<<<<<<<
 *     """
 *     Returns a dict of predefined sdif frame types
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_9predefined_frametypes, 0, __pyx_n_s_predefined_frametypes, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_predefined_frametypes, __pyx_t_1) < 0) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":478
 * 
 * 
 * def predefined_matrixtypes():             # <<<<<<<<<<<<<<
 *     """
 *     Returns a list of predefined sdif matrix types
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_11predefined_matrixtypes, 0, __pyx_n_s_predefined_matrixtypes, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_predefined_matrixtypes, __pyx_t_1) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":489
 * # ----------------------------------------------------------------------
 * 
 * def _find_sdiftypes():             # <<<<<<<<<<<<<<
 * 
 *     def get_packaged_sdiftypes():
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_13_find_sdiftypes, 0, __pyx_n_s_find_sdiftypes, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_sdiftypes, __pyx_t_1) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":525
 * 
 * 
 * def sdif_init(sdiftypes_path=None):             # <<<<<<<<<<<<<<
 *     """
 *     Initialize the sdif library
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_15sdif_init, 0, __pyx_n_s_sdif_init, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__62);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sdif_init, __pyx_t_1) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":563
 * 
 * 
 * def sdif_cleanup():             # <<<<<<<<<<<<<<
 *     SdifGenKill()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_17sdif_cleanup, 0, __pyx_n_s_sdif_cleanup, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sdif_cleanup, __pyx_t_1) < 0) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":598
 * 
 * cdef tuple _framestatus2str = (
 *     "Invalid",             # <<<<<<<<<<<<<<
 *     "NothingRead",
 *     "HeaderRead",
 */
  __Pyx_INCREF(__pyx_tuple__64);
  __Pyx_XGOTREF(__pyx_v_6pysdif_7_pysdif__framestatus2str);
  __Pyx_DECREF_SET(__pyx_v_6pysdif_7_pysdif__framestatus2str, __pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "pysdif/_pysdif.pyx":606
 * )
 * 
 * def framestatus2str(int status):             # <<<<<<<<<<<<<<
 *     if 0 <= status < 6:
 *         return _framestatus2str[status]
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_19framestatus2str, 0, __pyx_n_s_framestatus2str, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_framestatus2str, __pyx_t_1) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":612
 * 
 * cdef tuple _matrixstatus2str = (
 *     "Invalid",             # <<<<<<<<<<<<<<
 *     "NothingRead",
 *     "HeaderRead",
 */
  __Pyx_INCREF(__pyx_tuple__67);
  __Pyx_XGOTREF(__pyx_v_6pysdif_7_pysdif__matrixstatus2str);
  __Pyx_DECREF_SET(__pyx_v_6pysdif_7_pysdif__matrixstatus2str, __pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "pysdif/_pysdif.pyx":620
 * )
 * 
 * def matrixstatus2str(int status):             # <<<<<<<<<<<<<<
 *     """
 *     Return a string identifier for a matrix status.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_21matrixstatus2str, 0, __pyx_n_s_matrixstatus2str, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_matrixstatus2str, __pyx_t_1) < 0) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":718
 *                 return self._signature
 * 
 *     def get_data(self, copy=True):             # <<<<<<<<<<<<<<
 *         """
 *         Read the data from the matrix as a numpy array
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6Matrix_3get_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Matrix_get_data, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_Matrix->tp_dict, __pyx_n_s_get_data, __pyx_t_1) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_Matrix);

  /* "pysdif/_pysdif.pyx":747
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 * 
 *     def column_names(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of column names for the current matrix
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6Matrix_5column_names, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Matrix_column_names, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_Matrix->tp_dict, __pyx_n_s_column_names, __pyx_t_1) < 0) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_Matrix);

  /* "pysdif/_pysdif.pyx":761
 *         return colnames
 * 
 *     def skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skip reading the data
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6Matrix_7skip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Matrix_skip, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_Matrix->tp_dict, __pyx_n_s_skip, __pyx_t_1) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_Matrix);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6Matrix_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Matrix___reduce_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6Matrix_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Matrix___setstate_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":906
 *         return matrix
 * 
 *     def get_matrix(self, copy=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reads the next matrix entirely, returns (matrixsig, data)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameR_13get_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameR_get_matrix, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameR->tp_dict, __pyx_n_s_get_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameR);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameR_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameR___reduce_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameR_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameR___setstate_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":991
 *             sig2str(self.signature), self.time, self.streamID, bool(self._written))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self._written:
 *             raise RuntimeError("Frame has already been written!")
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameW_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameW___enter, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameW->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 991, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameW);

  /* "pysdif/_pysdif.pyx":996
 *         return self
 * 
 *     def __exit__(self, exception_type, exception_value, traceback):             # <<<<<<<<<<<<<<
 *         if self.num_matrices == 0:
 *             raise RuntimeError("No matrices were added! Frame not written")
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameW_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameW___exit, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameW->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameW);

  /* "pysdif/_pysdif.pyx":1004
 *         def __get__(self): return bool(self._written)
 * 
 *     def add_matrix(self, str signature, c_numpy.ndarray data_array):             # <<<<<<<<<<<<<<
 *         """
 *         Add a matrix to this Frame
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameW_7add_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameW_add_matrix, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameW->tp_dict, __pyx_n_s_add_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameW);

  /* "pysdif/_pysdif.pyx":1023
 *             data_array.shape[0], data_array.shape[1]) # rows, cols
 * 
 *     def write(self):             # <<<<<<<<<<<<<<
 *         """
 *         Write the current frame to disk.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameW_9write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameW_write, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameW->tp_dict, __pyx_n_s_write, __pyx_t_1) < 0) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameW);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameW_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameW___reduce_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameW->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameW);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FrameW, (type(self), 0x0cc732b, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FrameW__set_state(self, __pyx_state)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_6FrameW_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FrameW___setstate_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_FrameW->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_FrameW);

  /* "pysdif/_pysdif.pyx":1232
 *         self.close()  # fails silently if already closed
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close this SdifFile
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_9close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_close, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_close, __pyx_t_1) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1286
 *         return self.this.CurrFramPos
 * 
 *     def curr_matrix_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of rows and number of columns in the current matrix
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_11curr_matrix_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_curr_matrix_size, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_curr_matrix_size, __pyx_t_1) < 0) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1305
 *         return (m.NbRow, m.NbCol)
 * 
 *     def curr_matrix_datatype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the datatype code (an int) or 0 if go current matrix
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_13curr_matrix_datatype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_curr_matrix_datatype, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_curr_matrix_datatype, __pyx_t_1) < 0) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1316
 *         return self.this.CurrMtrxH.DataType
 * 
 *     def curr_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level interface** - Return the current frame's numerical signature
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_15curr_signature, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_curr_signature, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_curr_signature, __pyx_t_1) < 0) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1330
 *         return self.this.CurrMtrxH.Signature
 * 
 *     def curr_matrix_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the string signature of the current matrix, or None if no current matrix
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_17curr_matrix_signature, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_curr_matrix_signature, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_curr_matrix_signature, __pyx_t_1) < 0) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1344
 *         return None
 * 
 *     def frame_num_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of matrices in current frame.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_19frame_num_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_num_matrix, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_num_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1357
 *         return self.this.CurrFramH.NbMatrix
 * 
 *     def frame_id(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the id of the current frame, or -1 if no current frame
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_21frame_id, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_id, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_id, __pyx_t_1) < 0) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1382
 *         SdifFSetPos(self.this, &pos)
 * 
 *     def frame_numerical_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the num. signature of current frame, or -1 if no current frame
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_23frame_numerical_signature, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_numerical_signatu, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_numerical_signature, __pyx_t_1) < 0) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1394
 *         return self.this.CurrFramH.Signature
 * 
 *     def frame_signature(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the str. signature of the current frame, or None if no current frame
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_25frame_signature, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_signature, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_signature, __pyx_t_1) < 0) __PYX_ERR(0, 1394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1405
 *         return sig2str(self.this.CurrFramH.Signature)
 * 
 *     def frame_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the time of the current frame, or -1 if no current frame
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_27frame_time, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_time, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_time, __pyx_t_1) < 0) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1416
 *         return self.this.CurrFramH.Time
 * 
 *     def last_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns (error_tag, error_level) or None if there is no last error
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_29last_error, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_last_error, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_last_error, __pyx_t_1) < 0) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1426
 *         return (error.Tag, error.Level)
 * 
 *     def curr_frame_is_selected(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the current frame is selected.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_31curr_frame_is_selected, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_curr_frame_is_selected, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_curr_frame_is_selected, __pyx_t_1) < 0) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1443
 *         return bool(SdifFCurrFrameIsSelected(self.this))
 * 
 *     def curr_matrix_is_selected(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the current matrix is selected.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_33curr_matrix_is_selected, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_curr_matrix_is_selected, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_curr_matrix_is_selected, __pyx_t_1) < 0) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1458
 *         return bool(SdifFCurrMatrixIsSelected(self.this))
 * 
 *     def get_num_NVTs(self):             # <<<<<<<<<<<<<<
 *         if SdifNameValuesLIsNotEmpty(self.this.NameValues):
 *             return SdifFNameValueNum(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_35get_num_NVTs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_get_num_NVTs, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_get_num_NVTs, __pyx_t_1) < 0) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1485
 *         return bytes_read
 * 
 *     def frame_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         ** Low level interface ** - Read the frame header.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_37frame_read_header, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_read_header, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_read_header, __pyx_t_1) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1514
 *                 raise SdifOrderError("The frame should be read or skipped before a new header is read")
 * 
 *     def frame_skip_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low level interface** - Skip frame and all its matrices
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_39frame_skip_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_skip_data, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_skip_data, __pyx_t_1) < 0) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1525
 *         return bytes_read
 * 
 *     cpdef int _read_signature(self):             # <<<<<<<<<<<<<<
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_41_read_signature, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile__read_signature, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_read_signature, __pyx_t_1) < 0) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1544
 *         return SdifFReadMatrixHeader(self.this)
 * 
 *     def matrix_read_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low level interface** - Read the matrix header
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_43matrix_read_header, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_matrix_read_header, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_matrix_read_header, __pyx_t_1) < 0) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1571
 *         return bytesread
 * 
 *     def curr_frame_available(self):             # <<<<<<<<<<<<<<
 *        return self.this.CurrFramH != NULL
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_45curr_frame_available, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_curr_frame_available, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_curr_frame_available, __pyx_t_1) < 0) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1574
 *        return self.this.CurrFramH != NULL
 * 
 *     def curr_matrix_available(self):             # <<<<<<<<<<<<<<
 *        return self.this.CurrMtrxH != NULL
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_47curr_matrix_available, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_curr_matrix_available, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_curr_matrix_available, __pyx_t_1) < 0) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1577
 *        return self.this.CurrMtrxH != NULL
 * 
 *     def matrix_skip_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level Interface** - Skip the matrix data without reading it.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_49matrix_skip_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_matrix_skip_data, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_matrix_skip_data, __pyx_t_1) < 0) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1615
 *         return bytesread
 * 
 *     def matrix_read_data(self, copy=False):             # <<<<<<<<<<<<<<
 *         """
 *         Read the data of the current matrix as a numpy array
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_51matrix_read_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_matrix_read_data, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_matrix_read_data, __pyx_t_1) < 0) __PYX_ERR(0, 1615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1670
 *         return 0
 * 
 *     def matrix_skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         Low level Interface. Skip the matrix altogether.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_53matrix_skip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_matrix_skip, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_matrix_skip, __pyx_t_1) < 0) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1697
 *         return bytes_read
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple (curr_frame_status, curr_matrix_index, curr_matrix_status)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_55status, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_status, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_status, __pyx_t_1) < 0) __PYX_ERR(0, 1697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1722
 *             return
 * 
 *     def next_frame(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the next frame, returns a Frame or None if no more frames left.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_61next_frame, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_next_frame, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_next_frame, __pyx_t_1) < 0) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1753
 *         return self.frame if self.eof == 0 else None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_63__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile___enter, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1756
 *         return self
 * 
 *     def __exit__(self):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_65__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile___exit, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 1756, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1759
 *         self.close()
 * 
 *     def frame_skip_rest(self):             # <<<<<<<<<<<<<<
 *         """
 *         Skipts the rest of the frame, so that a new frame can be read.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_67frame_skip_rest, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_skip_rest, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_skip_rest, __pyx_t_1) < 0) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1804
 *         return 0
 * 
 *     def next_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read the next matrix header and return a Matrix with its data **still not read**.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_69next_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_next_matrix, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_next_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1828
 *         return self.matrix
 * 
 *     def rewind(self):             # <<<<<<<<<<<<<<
 *         """
 *         Rewind the SdifFile.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_71rewind, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_rewind, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_rewind, __pyx_t_1) < 0) __PYX_ERR(0, 1828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1838
 *         self.reinit()
 * 
 *     def _rewind(self):             # <<<<<<<<<<<<<<
 *         SdifFRewind(self.this)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_73_rewind, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile__rewind, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_rewind_2, __pyx_t_1) < 0) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1847
 *             self.init_write()
 * 
 *     def _read_padding(self):             # <<<<<<<<<<<<<<
 *         return SdifFReadPadding(self.this, SdifFPaddingCalculate(self.this.Stream, self.this.Pos))
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_75_read_padding, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile__read_padding, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_read_padding, __pyx_t_1) < 0) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1854
 *     # ------------------------------------------------
 * 
 *     def add_NVT(self, dict d):             # <<<<<<<<<<<<<<
 *         """
 *         The NVT (Name Value Table) is a place to put metadata about the file.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_77add_NVT, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_add_NVT, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_add_NVT, __pyx_t_1) < 0) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1882
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, asbytes(name), asbytes(value))
 * 
 *     def add_matrix_type(self, signature, column_names):             # <<<<<<<<<<<<<<
 *         """
 *         Adds a matrix type to this Sdif
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_79add_matrix_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_add_matrix_type, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_add_matrix_type, __pyx_t_1) < 0) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1908
 *         #self.frame_status = eFrameInvalid
 * 
 *     def add_frame_type(self, signature, list components):             # <<<<<<<<<<<<<<
 *         """
 *         Adds a frame type to this sdif.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_81add_frame_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_add_frame_type, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_add_frame_type, __pyx_t_1) < 0) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1949
 *         # TODO: is this a memory leak? who destroys the FrameType?
 * 
 *     def clone_type_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_83clone_type_definitions, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_clone_type_definitions, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_clone_type_definitions, __pyx_t_1) < 0) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":1971
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 * 
 *     def clone_NVTs(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         Clone the NVT (name:value table) from source (an open SdifFile)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_85clone_NVTs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_clone_NVTs, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_clone_NVTs, __pyx_t_1) < 0) __PYX_ERR(0, 1971, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2000
 *             self.add_NVT(nvt)
 * 
 *     def clone_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         Only for writing mode - Clone both NVT(s), frame and matrix definitions
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_87clone_definitions, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_clone_definitions, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_clone_definitions, __pyx_t_1) < 0) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2030
 *         return self
 * 
 *     def clone_frames(self, SdifFile source, signatures_to_clone=None):             # <<<<<<<<<<<<<<
 *         """
 *         Clone all the frames in source which are included in
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_89clone_frames, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_clone_frames, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_clone_frames, __pyx_t_1) < 0) __PYX_ERR(0, 2030, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2060
 *                 frame1.write()
 * 
 *     def add_streamID(self, unsigned int numid, char *source, char *treeway):             # <<<<<<<<<<<<<<
 *         """
 *         This method is only there for completion.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_91add_streamID, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_add_streamID, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_add_streamID, __pyx_t_1) < 0) __PYX_ERR(0, 2060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2077
 *             numid, source, treeway)
 * 
 *     def add_predefined_frametype(self, signature):             # <<<<<<<<<<<<<<
 *         """
 *         Add a predefined frame type with corresponding matrix definitions
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_93add_predefined_frametype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_add_predefined_frametyp, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_add_predefined_frametype, __pyx_t_1) < 0) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2102
 *             self.add_matrix_type(matrixsig, column_names)
 * 
 *     def write_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         **Low-level Interface**
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_95write_all_ascii_chunks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_write_all_ascii_chunks, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_write_all_ascii_chunks, __pyx_t_1) < 0) __PYX_ERR(0, 2102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2117
 *         self.write_status = eSdifAllASCIIChunks
 * 
 *     def new_frame(self, signature, SdifFloat8 time, SdifUInt4 streamID=0):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new frame with given signature and at given time
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_97new_frame, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_new_frame, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_new_frame, __pyx_t_1) < 0) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2162
 *         return FrameW_new(self, str2sig(asbytes(signature)), time, streamID)
 * 
 *     def new_frame_one_matrix(self, frame_sig, SdifFloat8 time, matrix_sig,             # <<<<<<<<<<<<<<
 *                              c_numpy.ndarray matrixdata, SdifUInt4 streamID=0):
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_99new_frame_one_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_new_frame_one_matrix, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_new_frame_one_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 2162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2206
 * 
 *     # low level functions to print info
 *     def print_NVT(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllNameValueNVT(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_101print_NVT, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_print_NVT, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_print_NVT, __pyx_t_1) < 0) __PYX_ERR(0, 2206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2210
 *         SdifFPrintAllNameValueNVT(self.this)
 * 
 *     def print_general_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_103print_general_header, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_print_general_header, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_print_general_header, __pyx_t_1) < 0) __PYX_ERR(0, 2210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2214
 *         cdef size_t n = SdifFPrintGeneralHeader(self.this)
 * 
 *     def print_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllASCIIChunks(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_105print_all_ascii_chunks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_print_all_ascii_chunks, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_print_all_ascii_chunks, __pyx_t_1) < 0) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2218
 *         SdifFPrintAllASCIIChunks(self.this)
 * 
 *     def print_all_types(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllType(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_107print_all_types, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_print_all_types, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_print_all_types, __pyx_t_1) < 0) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2222
 *         SdifFPrintAllType(self.this)
 * 
 *     def print_matrix_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintMatrixHeader(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_109print_matrix_header, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_print_matrix_header, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_print_matrix_header, __pyx_t_1) < 0) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2226
 *         SdifFPrintMatrixHeader(self.this)
 * 
 *     def print_one_row(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintOneRow(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_111print_one_row, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_print_one_row, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_print_one_row, __pyx_t_1) < 0) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2230
 *         SdifFPrintOneRow(self.this)
 * 
 *     def print_frame_header(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintFrameHeader(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_113print_frame_header, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_print_frame_header, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_print_frame_header, __pyx_t_1) < 0) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2234
 *         SdifFPrintFrameHeader(self.this)
 * 
 *     def print_all_stream_ID(self):             # <<<<<<<<<<<<<<
 *         """ **Low-Level Interface** """
 *         SdifFPrintAllStreamID(self.this)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_115print_all_stream_ID, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_print_all_stream_ID, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_print_all_stream_ID, __pyx_t_1) < 0) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2238
 *         SdifFPrintAllStreamID(self.this)
 * 
 *     def frame_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         returns a string with all frame types
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_117frame_types_to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_frame_types_to_string, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_frame_types_to_string, __pyx_t_1) < 0) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2250
 *         return out
 * 
 *     def get_frame_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of Frame Type Definitions (1FTD)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_119get_frame_types, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_get_frame_types, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_get_frame_types, __pyx_t_1) < 0) __PYX_ERR(0, 2250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2259
 *         return FrameTypesTable_to_list(self.this.FrameTypesTable)
 * 
 *     def matrix_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string with all matrix types
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_121matrix_types_to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_matrix_types_to_string, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_matrix_types_to_string, __pyx_t_1) < 0) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2273
 *         return out
 * 
 *     def get_matrix_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get a list of matrix type definitions (1MTD)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_123get_matrix_types, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_get_matrix_types, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_get_matrix_types, __pyx_t_1) < 0) __PYX_ERR(0, 2273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2283
 *         return MatrixTypesTable_to_list(self.this.MatrixTypesTable)
 * 
 *     def get_NVTs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list with all defined NameValueTables
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_125get_NVTs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_get_NVTs, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_get_NVTs, __pyx_t_1) < 0) __PYX_ERR(0, 2283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "pysdif/_pysdif.pyx":2295
 *         return valuetables_to_dicts(self.this.NameValues)
 * 
 *     def get_stream_IDs(self):             # <<<<<<<<<<<<<<
 *         return streamidtable_to_list(self.this.StreamIDsTable)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_127get_stream_IDs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile_get_stream_IDs, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pysdif_7_pysdif_SdifFile->tp_dict, __pyx_n_s_get_stream_IDs, __pyx_t_1) < 0) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pysdif_7_pysdif_SdifFile);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_129__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile___reduce_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_8SdifFile_131__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SdifFile___setstate_cython, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_MatrixTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_23__pyx_unpickle_MatrixTypeDefinition, 0, __pyx_n_s_pyx_unpickle_MatrixTypeDefinit, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_MatrixTypeDefinit, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_MatrixTypeDefinition__set_state(<MatrixTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_MatrixTypeDefinition__set_state(MatrixTypeDefinition __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.column_names = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_25__pyx_unpickle_Component, 0, __pyx_n_s_pyx_unpickle_Component, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Component, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_FrameTypeDefinition(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_27__pyx_unpickle_FrameTypeDefinition, 0, __pyx_n_s_pyx_unpickle_FrameTypeDefiniti, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FrameTypeDefiniti, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_FrameTypeDefinition__set_state(<FrameTypeDefinition> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FrameTypeDefinition__set_state(FrameTypeDefinition __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.components = __pyx_state[0]; __pyx_result.signature = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6pysdif_7_pysdif_29__pyx_unpickle_FrameW, 0, __pyx_n_s_pyx_unpickle_FrameW, NULL, __pyx_n_s_pysdif__pysdif, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FrameW, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysdif/_pysdif.pyx":1
 * #cython: embedsignature=True             # <<<<<<<<<<<<<<
 * #cython: binding=True
 * """
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* ".eggs/numpy-1.21.4-py3.8-linux-x86_64.egg/numpy/__init__.pxd":1014
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pysdif._pysdif", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pysdif._pysdif");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod0 */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_ASSUME_SAFE_MACROS
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (__Pyx_PyFastCFunction_Check(func)) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* StringJoin */
#if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

/* py_dict_items */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
    else
        return PyDict_Items(d);
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunctionShared */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    if (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
#if PY_MAJOR_VERSION < 3
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
#endif
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* pyfrozenset_new */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result)))
            return result;
        Py_DECREF(result);
#endif
    }
#if CYTHON_USE_TYPE_SLOTS
    return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#else
    return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#endif
}

/* PySetContains */
static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* decode_c_bytes */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* Print */
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file_2, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

/* Declarations */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned int) -1;
        }
    } else {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyInt_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SdifUInt4(SdifUInt4 value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const SdifUInt4 neg_one = (SdifUInt4) -1, const_zero = (SdifUInt4) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(SdifUInt4) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(SdifUInt4) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(SdifUInt4) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(SdifUInt4) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(SdifUInt4) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(SdifUInt4),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE SdifUInt4 __Pyx_PyInt_As_SdifUInt4(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const SdifUInt4 neg_one = (SdifUInt4) -1, const_zero = (SdifUInt4) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(SdifUInt4) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(SdifUInt4, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (SdifUInt4) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (SdifUInt4) 0;
                case  1: __PYX_VERIFY_RETURN_INT(SdifUInt4, digit, digits[0])
                case 2:
                    if (8 * sizeof(SdifUInt4) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) >= 2 * PyLong_SHIFT) {
                            return (SdifUInt4) (((((SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(SdifUInt4) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) >= 3 * PyLong_SHIFT) {
                            return (SdifUInt4) (((((((SdifUInt4)digits[2]) << PyLong_SHIFT) | (SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(SdifUInt4) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) >= 4 * PyLong_SHIFT) {
                            return (SdifUInt4) (((((((((SdifUInt4)digits[3]) << PyLong_SHIFT) | (SdifUInt4)digits[2]) << PyLong_SHIFT) | (SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (SdifUInt4) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(SdifUInt4) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(SdifUInt4, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(SdifUInt4) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(SdifUInt4, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (SdifUInt4) 0;
                case -1: __PYX_VERIFY_RETURN_INT(SdifUInt4, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(SdifUInt4,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(SdifUInt4) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) - 1 > 2 * PyLong_SHIFT) {
                            return (SdifUInt4) (((SdifUInt4)-1)*(((((SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(SdifUInt4) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) - 1 > 2 * PyLong_SHIFT) {
                            return (SdifUInt4) ((((((SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(SdifUInt4) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) - 1 > 3 * PyLong_SHIFT) {
                            return (SdifUInt4) (((SdifUInt4)-1)*(((((((SdifUInt4)digits[2]) << PyLong_SHIFT) | (SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(SdifUInt4) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) - 1 > 3 * PyLong_SHIFT) {
                            return (SdifUInt4) ((((((((SdifUInt4)digits[2]) << PyLong_SHIFT) | (SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(SdifUInt4) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) - 1 > 4 * PyLong_SHIFT) {
                            return (SdifUInt4) (((SdifUInt4)-1)*(((((((((SdifUInt4)digits[3]) << PyLong_SHIFT) | (SdifUInt4)digits[2]) << PyLong_SHIFT) | (SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(SdifUInt4) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(SdifUInt4, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(SdifUInt4) - 1 > 4 * PyLong_SHIFT) {
                            return (SdifUInt4) ((((((((((SdifUInt4)digits[3]) << PyLong_SHIFT) | (SdifUInt4)digits[2]) << PyLong_SHIFT) | (SdifUInt4)digits[1]) << PyLong_SHIFT) | (SdifUInt4)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(SdifUInt4) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(SdifUInt4, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(SdifUInt4) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(SdifUInt4, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            SdifUInt4 val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (SdifUInt4) -1;
        }
    } else {
        SdifUInt4 val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (SdifUInt4) -1;
        val = __Pyx_PyInt_As_SdifUInt4(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to SdifUInt4");
    return (SdifUInt4) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to SdifUInt4");
    return (SdifUInt4) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__SdifFileModeE(enum SdifFileModeE value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum SdifFileModeE neg_one = (enum SdifFileModeE) -1, const_zero = (enum SdifFileModeE) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum SdifFileModeE) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum SdifFileModeE) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum SdifFileModeE) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum SdifFileModeE) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum SdifFileModeE) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum SdifFileModeE),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__SdifDataTypeE(enum SdifDataTypeE value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum SdifDataTypeE neg_one = (enum SdifDataTypeE) -1, const_zero = (enum SdifDataTypeE) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum SdifDataTypeE) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum SdifDataTypeE) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum SdifDataTypeE) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum SdifDataTypeE) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum SdifDataTypeE) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum SdifDataTypeE),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_MatrixStatusE(enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE neg_one = (enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE) -1, const_zero = (enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE enum SdifFileModeE __Pyx_PyInt_As_enum__SdifFileModeE(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum SdifFileModeE neg_one = (enum SdifFileModeE) -1, const_zero = (enum SdifFileModeE) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum SdifFileModeE) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum SdifFileModeE) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum SdifFileModeE) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum SdifFileModeE) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) >= 2 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) (((((enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum SdifFileModeE) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) >= 3 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) (((((((enum SdifFileModeE)digits[2]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum SdifFileModeE) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) >= 4 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) (((((((((enum SdifFileModeE)digits[3]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[2]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum SdifFileModeE) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum SdifFileModeE) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum SdifFileModeE, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum SdifFileModeE) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum SdifFileModeE, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum SdifFileModeE) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum SdifFileModeE,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum SdifFileModeE) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) - 1 > 2 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) (((enum SdifFileModeE)-1)*(((((enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum SdifFileModeE) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) - 1 > 2 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) ((((((enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum SdifFileModeE) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) - 1 > 3 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) (((enum SdifFileModeE)-1)*(((((((enum SdifFileModeE)digits[2]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum SdifFileModeE) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) - 1 > 3 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) ((((((((enum SdifFileModeE)digits[2]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum SdifFileModeE) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) - 1 > 4 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) (((enum SdifFileModeE)-1)*(((((((((enum SdifFileModeE)digits[3]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[2]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum SdifFileModeE) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum SdifFileModeE, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum SdifFileModeE) - 1 > 4 * PyLong_SHIFT) {
                            return (enum SdifFileModeE) ((((((((((enum SdifFileModeE)digits[3]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[2]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[1]) << PyLong_SHIFT) | (enum SdifFileModeE)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum SdifFileModeE) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum SdifFileModeE, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum SdifFileModeE) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum SdifFileModeE, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum SdifFileModeE val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum SdifFileModeE) -1;
        }
    } else {
        enum SdifFileModeE val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum SdifFileModeE) -1;
        val = __Pyx_PyInt_As_enum__SdifFileModeE(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum SdifFileModeE");
    return (enum SdifFileModeE) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum SdifFileModeE");
    return (enum SdifFileModeE) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_6pysdif_7_pysdif_FrameStatusE(enum __pyx_t_6pysdif_7_pysdif_FrameStatusE value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_6pysdif_7_pysdif_FrameStatusE neg_one = (enum __pyx_t_6pysdif_7_pysdif_FrameStatusE) -1, const_zero = (enum __pyx_t_6pysdif_7_pysdif_FrameStatusE) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_6pysdif_7_pysdif_FrameStatusE) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_6pysdif_7_pysdif_FrameStatusE) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_6pysdif_7_pysdif_FrameStatusE) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum __pyx_t_6pysdif_7_pysdif_FrameStatusE) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_6pysdif_7_pysdif_FrameStatusE) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_6pysdif_7_pysdif_FrameStatusE),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SdiffPosT(SdiffPosT value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const SdiffPosT neg_one = (SdiffPosT) -1, const_zero = (SdiffPosT) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(SdiffPosT) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(SdiffPosT) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(SdiffPosT) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(SdiffPosT) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(SdiffPosT) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(SdiffPosT),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__SdifErrorTagE(enum SdifErrorTagE value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum SdifErrorTagE neg_one = (enum SdifErrorTagE) -1, const_zero = (enum SdifErrorTagE) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum SdifErrorTagE) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum SdifErrorTagE) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum SdifErrorTagE) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum SdifErrorTagE) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum SdifErrorTagE) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum SdifErrorTagE),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__SdifErrorLevelE(enum SdifErrorLevelE value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum SdifErrorLevelE neg_one = (enum SdifErrorLevelE) -1, const_zero = (enum SdifErrorLevelE) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum SdifErrorLevelE) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum SdifErrorLevelE) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum SdifErrorLevelE) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum SdifErrorLevelE) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum SdifErrorLevelE) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum SdifErrorLevelE),
                                     little, !is_unsigned);
    }
}

/* PrintOne */
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
            _PyGen_SetStopIterationValue(result);
        }
        Py_CLEAR(result);
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (Py_REFCNT(self) > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    __Pyx_SET_REFCNT(self, 1);
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(Py_REFCNT(self) > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = Py_REFCNT(self);
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, refcnt);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(Py_TYPE(self)) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            __pyx_d,                 /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        if (unlikely(!frame))
            return NULL;
        self->gi_frame = frame;
    }
    Py_INCREF(frame);
    return frame;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             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]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             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]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
