/* Generated by Cython 0.17.4 on Mon Aug 19 22:24:55 2013 */

#define 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 < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#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
#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_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#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, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #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
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #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_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #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_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#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
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#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
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  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) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif


#if PY_MAJOR_VERSION >= 3
  #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

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__epr
#define __PYX_HAVE_API__epr
#include "string.h"
#include "stdio.h"
#include "epr_api.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if 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

/* unused attribute */
#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

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


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#if CYTHON_COMPILING_IN_CPYTHON
#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))

#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

#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[] = {
  "epr.pyx",
  "numpy.pxd",
  "type.pxd",
};

/* "numpy.pxd":723
 * # 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;

/* "numpy.pxd":724
 * 
 * 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;

/* "numpy.pxd":725
 * 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;

/* "numpy.pxd":726
 * 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;

/* "numpy.pxd":730
 * #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;

/* "numpy.pxd":731
 * 
 * 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;

/* "numpy.pxd":732
 * 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;

/* "numpy.pxd":733
 * 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;

/* "numpy.pxd":737
 * #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;

/* "numpy.pxd":738
 * 
 * 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;

/* "numpy.pxd":747
 * # 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;

/* "numpy.pxd":748
 * # 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;

/* "numpy.pxd":749
 * 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;

/* "numpy.pxd":751
 * 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;

/* "numpy.pxd":752
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "numpy.pxd":753
 * 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;

/* "numpy.pxd":755
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "numpy.pxd":756
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "numpy.pxd":758
 * 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;

/* "numpy.pxd":759
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "numpy.pxd":760
 * 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;
#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

#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


/*--- Type declarations ---*/
struct __pyx_obj_3epr_EprObject;
struct __pyx_obj_3epr_Dataset;
struct __pyx_obj_3epr_Record;
struct __pyx_obj_3epr_Product;
struct __pyx_obj_3epr_Raster;
struct __pyx_obj_3epr_DSD;
struct __pyx_obj_3epr__CLib;
struct __pyx_obj_3epr_Field;
struct __pyx_obj_3epr_Band;

/* "numpy.pxd":762
 * 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;

/* "numpy.pxd":763
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "numpy.pxd":764
 * 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;

/* "numpy.pxd":766
 * 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_3epr__to_bytes;
struct __pyx_opt_args_3epr__to_str;
struct __pyx_opt_args_3epr_pyepr_null_ptr_error;
struct __pyx_opt_args_3epr_new_dsd;
struct __pyx_opt_args_3epr_new_field;
struct __pyx_opt_args_3epr_new_record;
struct __pyx_opt_args_3epr_new_raster;
struct __pyx_opt_args_3epr_4Band_read_raster;
struct __pyx_opt_args_3epr_new_band;
struct __pyx_opt_args_3epr_new_dataset;

/* "epr.pyx":381
 * 
 * 
 * cdef inline bytes _to_bytes(s, encoding='UTF-8'):             # <<<<<<<<<<<<<<
 *     if hasattr(s, 'encode'):
 *         return s.encode(encoding)
 */
struct __pyx_opt_args_3epr__to_bytes {
  int __pyx_n;
  PyObject *encoding;
};

/* "epr.pyx":388
 * 
 * 
 * cdef inline str _to_str(b, encoding='UTF-8'):             # <<<<<<<<<<<<<<
 *     if PY3:
 *         return b.decode(encoding)
 */
struct __pyx_opt_args_3epr__to_str {
  int __pyx_n;
  PyObject *encoding;
};

/* "epr.pyx":488
 * 
 * 
 * cdef int pyepr_null_ptr_error(msg='null pointer') except -1:             # <<<<<<<<<<<<<<
 *     cdef int code
 *     cdef char* eprmsg = <char*>epr_get_last_err_message()
 */
struct __pyx_opt_args_3epr_pyepr_null_ptr_error {
  int __pyx_n;
  PyObject *msg;
};

/* "epr.pyx":738
 * 
 * 
 * cdef new_dsd(EPR_SDSD* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */
struct __pyx_opt_args_3epr_new_dsd {
  int __pyx_n;
  PyObject *parent;
};

/* "epr.pyx":1109
 * 
 * 
 * cdef new_field(EPR_SField* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */
struct __pyx_opt_args_3epr_new_field {
  int __pyx_n;
  PyObject *parent;
};

/* "epr.pyx":1303
 * 
 * 
 * cdef new_record(EPR_SRecord* ptr, object parent=None, bint dealloc=False):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */
struct __pyx_opt_args_3epr_new_record {
  int __pyx_n;
  PyObject *parent;
  int dealloc;
};

/* "epr.pyx":1478
 * 
 * 
 * cdef new_raster(EPR_SRaster* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */
struct __pyx_opt_args_3epr_new_raster {
  int __pyx_n;
  PyObject *parent;
};

/* "epr.pyx":1827
 *         return new_raster(raster_ptr, self)
 * 
 *     cpdef read_raster(self, int xoffset=0, int yoffset=0, Raster raster=None):             # <<<<<<<<<<<<<<
 *         '''read_raster(self, xoffset=0, yoffset=0, Raster raster=None)
 * 
 */
struct __pyx_opt_args_3epr_4Band_read_raster {
  int __pyx_n;
  int xoffset;
  int yoffset;
  struct __pyx_obj_3epr_Raster *raster;
};

/* "epr.pyx":1945
 * 
 * 
 * cdef new_band(EPR_SBandId* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */
struct __pyx_opt_args_3epr_new_band {
  int __pyx_n;
  PyObject *parent;
};

/* "epr.pyx":2129
 * 
 * 
 * cdef new_dataset(EPR_SDatasetId* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */
struct __pyx_opt_args_3epr_new_dataset {
  int __pyx_n;
  PyObject *parent;
};

/* "epr.pyx":562
 * 
 * 
 * cdef class EprObject:             # <<<<<<<<<<<<<<
 *     cdef object epr_c_lib
 * 
 */
struct __pyx_obj_3epr_EprObject {
  PyObject_HEAD
  PyObject *epr_c_lib;
};


/* "epr.pyx":1957
 * 
 * 
 * cdef class Dataset(EprObject):             # <<<<<<<<<<<<<<
 *     '''ENVISAT dataset
 * 
 */
struct __pyx_obj_3epr_Dataset {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SDatasetId *_ptr;
  PyObject *_parent;
};


/* "epr.pyx":1121
 * 
 * 
 * cdef class Record(EprObject):             # <<<<<<<<<<<<<<
 *     '''Represents a record read from an ENVISAT dataset
 * 
 */
struct __pyx_obj_3epr_Record {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SRecord *_ptr;
  PyObject *_parent;
  int _dealloc;
};


/* "epr.pyx":2141
 * 
 * 
 * cdef class Product(EprObject):             # <<<<<<<<<<<<<<
 *     '''ENVISAT product
 * 
 */
struct __pyx_obj_3epr_Product {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SProductId *_ptr;
};


/* "epr.pyx":1316
 * 
 * 
 * cdef class Raster(EprObject):             # <<<<<<<<<<<<<<
 *     '''Represents a raster in which data will be stored
 * 
 */
struct __pyx_obj_3epr_Raster {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  struct __pyx_vtabstruct_3epr_Raster *__pyx_vtab;
  EPR_SRaster *_ptr;
  PyObject *_parent;
  PyObject *_data;
};


/* "epr.pyx":638
 * 
 * 
 * cdef class DSD(EprObject):             # <<<<<<<<<<<<<<
 *     '''Dataset descriptor
 * 
 */
struct __pyx_obj_3epr_DSD {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SDSD *_ptr;
  PyObject *_parent;
};


/* "epr.pyx":528
 * 
 * 
 * cdef class _CLib:             # <<<<<<<<<<<<<<
 *     '''Library object to handle C API initialization/finalization
 * 
 */
struct __pyx_obj_3epr__CLib {
  PyObject_HEAD
};


/* "epr.pyx":750
 * 
 * 
 * cdef class Field(EprObject):             # <<<<<<<<<<<<<<
 *     '''Represents a field within a record
 * 
 */
struct __pyx_obj_3epr_Field {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SField *_ptr;
  PyObject *_parent;
};


/* "epr.pyx":1576
 * 
 * 
 * cdef class Band(EprObject):             # <<<<<<<<<<<<<<
 *     '''The band of an ENVISAT product
 * 
 */
struct __pyx_obj_3epr_Band {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  struct __pyx_vtabstruct_3epr_Band *__pyx_vtab;
  EPR_SBandId *_ptr;
  PyObject *_parent;
};



/* "epr.pyx":1316
 * 
 * 
 * cdef class Raster(EprObject):             # <<<<<<<<<<<<<<
 *     '''Represents a raster in which data will be stored
 * 
 */

struct __pyx_vtabstruct_3epr_Raster {
  PyArrayObject *(*toarray)(struct __pyx_obj_3epr_Raster *);
};
static struct __pyx_vtabstruct_3epr_Raster *__pyx_vtabptr_3epr_Raster;


/* "epr.pyx":1576
 * 
 * 
 * cdef class Band(EprObject):             # <<<<<<<<<<<<<<
 *     '''The band of an ENVISAT product
 * 
 */

struct __pyx_vtabstruct_3epr_Band {
  PyObject *(*read_raster)(struct __pyx_obj_3epr_Band *, int __pyx_skip_dispatch, struct __pyx_opt_args_3epr_4Band_read_raster *__pyx_optional_args);
};
static struct __pyx_vtabstruct_3epr_Band *__pyx_vtabptr_3epr_Band;
#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); /*proto*/
  #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 /* CYTHON_REFNANNY */
#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)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

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

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
    const char* function_name); /*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); /*proto*/

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

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

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static CYTHON_INLINE PyObject* __Pyx_tp_new(PyObject* type_obj) {
    return (PyObject*) (((PyTypeObject*)(type_obj))->tp_new(
        (PyTypeObject*)(type_obj), __pyx_empty_tuple, NULL));
}

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

#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {  /* inlined PySequence_SetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return -1;
                i += l;
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PySequence_Check(o) && !PyDict_Check(o)) {
#else
    if (PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

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

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

#if CYTHON_COMPILING_IN_CPYTHON
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)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname); /*proto*/

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#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;
    int flags;
    PyObject *func_dict;
    PyObject *func_weakreflist;
    PyObject *func_name;
    PyObject *func_doc;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj; /* No-args super() class cell */
    void *defaults;
    int defaults_pyobjects;
    PyObject *defaults_tuple; /* Const defaults tuple */
    PyObject *(*defaults_getter)(PyObject *);
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, self, module, code) \
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, self, module, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *,
                                      PyMethodDef *ml, int flags,
                                      PyObject *self, PyObject *module,
                                      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 int __Pyx_CyFunction_init(void);

static CYTHON_INLINE uint __Pyx_PyInt_from_py_uint(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint(uint);

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uchar(uchar);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_ushort(ushort);

#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(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
    #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

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eqf(a, b)   ((a)==(b))
    #define __Pyx_c_sumf(a, b)  ((a)+(b))
    #define __Pyx_c_difff(a, b) ((a)-(b))
    #define __Pyx_c_prodf(a, b) ((a)*(b))
    #define __Pyx_c_quotf(a, b) ((a)/(b))
    #define __Pyx_c_negf(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zerof(z) ((z)==(float)0)
    #define __Pyx_c_conjf(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_absf(z)     (::std::abs(z))
        #define __Pyx_c_powf(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zerof(z) ((z)==0)
    #define __Pyx_c_conjf(z)    (conjf(z))
    #if 1
        #define __Pyx_c_absf(z)     (cabsf(z))
        #define __Pyx_c_powf(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq(a, b)   ((a)==(b))
    #define __Pyx_c_sum(a, b)  ((a)+(b))
    #define __Pyx_c_diff(a, b) ((a)-(b))
    #define __Pyx_c_prod(a, b) ((a)*(b))
    #define __Pyx_c_quot(a, b) ((a)/(b))
    #define __Pyx_c_neg(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero(z) ((z)==(double)0)
    #define __Pyx_c_conj(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (::std::abs(z))
        #define __Pyx_c_pow(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero(z) ((z)==0)
    #define __Pyx_c_conj(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (cabs(z))
        #define __Pyx_c_pow(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

static int __Pyx_check_binary_version(void);

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

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __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);

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

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


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

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

/* Module declarations from 'libc' */

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

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

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

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

/* 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 '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_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/

/* Module declarations from 'epr' */
static PyTypeObject *__pyx_ptype_3epr__CLib = 0;
static PyTypeObject *__pyx_ptype_3epr_EprObject = 0;
static PyTypeObject *__pyx_ptype_3epr_DSD = 0;
static PyTypeObject *__pyx_ptype_3epr_Field = 0;
static PyTypeObject *__pyx_ptype_3epr_Record = 0;
static PyTypeObject *__pyx_ptype_3epr_Raster = 0;
static PyTypeObject *__pyx_ptype_3epr_Band = 0;
static PyTypeObject *__pyx_ptype_3epr_Dataset = 0;
static PyTypeObject *__pyx_ptype_3epr_Product = 0;
static int __pyx_v_3epr_PY3;
static struct __pyx_obj_3epr__CLib *__pyx_v_3epr__EPR_C_LIB = 0;
static CYTHON_INLINE PyObject *__pyx_f_3epr__to_bytes(PyObject *, struct __pyx_opt_args_3epr__to_bytes *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_3epr__to_str(PyObject *, struct __pyx_opt_args_3epr__to_str *__pyx_optional_args); /*proto*/
static enum NPY_TYPES __pyx_f_3epr__epr_to_numpy_type_id(enum EPR_DataTypeId); /*proto*/
static int __pyx_f_3epr_pyepr_check_errors(void); /*proto*/
static int __pyx_f_3epr_pyepr_null_ptr_error(struct __pyx_opt_args_3epr_pyepr_null_ptr_error *__pyx_optional_args); /*proto*/
static FILE *__pyx_f_3epr_pyepr_get_file_stream(PyObject *); /*proto*/
static PyObject *__pyx_f_3epr_new_dsd(EPR_SDSD *, struct __pyx_opt_args_3epr_new_dsd *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_field(EPR_SField *, struct __pyx_opt_args_3epr_new_field *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_record(EPR_SRecord *, struct __pyx_opt_args_3epr_new_record *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_raster(EPR_SRaster *, struct __pyx_opt_args_3epr_new_raster *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_band(EPR_SBandId *, struct __pyx_opt_args_3epr_new_band *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_dataset(EPR_SDatasetId *, struct __pyx_opt_args_3epr_new_dataset *__pyx_optional_args); /*proto*/
#define __Pyx_MODULE_NAME "epr"
int __pyx_module_is_main_epr = 0;

/* Implementation of 'epr' */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_pf_3epr_8EPRError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_code, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static int __pyx_pf_3epr_5_CLib___cinit__(CYTHON_UNUSED struct __pyx_obj_3epr__CLib *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static void __pyx_pf_3epr_5_CLib_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_3epr__CLib *__pyx_v_self); /* proto */
static int __pyx_pf_3epr_5_CLib_4__init__(struct __pyx_obj_3epr__CLib *__pyx_v_self); /* proto */
static int __pyx_pf_3epr_9EprObject___cinit__(struct __pyx_obj_3epr_EprObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_ars, CYTHON_UNUSED PyObject *__pyx_v_kargs); /* proto */
static void __pyx_pf_3epr_9EprObject_2__dealloc__(struct __pyx_obj_3epr_EprObject *__pyx_v_self); /* proto */
static int __pyx_pf_3epr_9EprObject_4__init__(struct __pyx_obj_3epr_EprObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_get_data_type_size(CYTHON_UNUSED PyObject *__pyx_self, EPR_EDataTypeId __pyx_v_type_id); /* proto */
static PyObject *__pyx_pf_3epr_2data_type_id_to_str(CYTHON_UNUSED PyObject *__pyx_self, EPR_EDataTypeId __pyx_v_type_id); /* proto */
static PyObject *__pyx_pf_3epr_4get_scaling_method_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_method); /* proto */
static PyObject *__pyx_pf_3epr_6get_sample_model_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_model); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_5index___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_7ds_name___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_7ds_type___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_8filename___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_9ds_offset___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_7ds_size___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_7num_dsr___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_8dsr_size___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD___repr__(struct __pyx_obj_3epr_DSD *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_3DSD_2__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
static PyObject *__pyx_pf_3epr_5Field_print_(struct __pyx_obj_3epr_Field *__pyx_v_self, PyObject *__pyx_v_ostream); /* proto */
static PyObject *__pyx_pf_3epr_5Field_2get_unit(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_5Field_4get_description(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_5Field_6get_num_elems(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_5Field_8get_name(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_5Field_10get_type(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_5Field_12get_elem(struct __pyx_obj_3epr_Field *__pyx_v_self, uint __pyx_v_index); /* proto */
static PyObject *__pyx_pf_3epr_5Field_14get_elems(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_5Field_16__repr__(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_5Field_18__str__(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_5Field_20__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
static Py_ssize_t __pyx_pf_3epr_5Field_22__len__(struct __pyx_obj_3epr_Field *__pyx_v_self); /* proto */
static void __pyx_pf_3epr_6Record___dealloc__(struct __pyx_obj_3epr_Record *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Record_2get_num_fields(struct __pyx_obj_3epr_Record *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Record_4print_(struct __pyx_obj_3epr_Record *__pyx_v_self, PyObject *__pyx_v_ostream); /* proto */
static PyObject *__pyx_pf_3epr_6Record_6print_element(struct __pyx_obj_3epr_Record *__pyx_v_self, uint __pyx_v_field_index, uint __pyx_v_element_index, PyObject *__pyx_v_ostream); /* proto */
static PyObject *__pyx_pf_3epr_6Record_8get_field(struct __pyx_obj_3epr_Record *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_3epr_6Record_10get_field_at(struct __pyx_obj_3epr_Record *__pyx_v_self, uint __pyx_v_index); /* proto */
static PyObject *__pyx_pf_3epr_6Record_12get_field_names(struct __pyx_obj_3epr_Record *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Record_14fields(struct __pyx_obj_3epr_Record *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Record_16__iter__(struct __pyx_obj_3epr_Record *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Record_18__str__(struct __pyx_obj_3epr_Record *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Record_20__repr__(struct __pyx_obj_3epr_Record *__pyx_v_self); /* proto */
static void __pyx_pf_3epr_6Raster___dealloc__(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_9data_type___get__(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_12source_width___get__(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_13source_height___get__(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_13source_step_x___get__(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_13source_step_y___get__(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_2get_width(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_4get_height(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_6get_elem_size(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_8get_pixel(struct __pyx_obj_3epr_Raster *__pyx_v_self, int __pyx_v_x, int __pyx_v_y); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_4data___get__(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_6Raster_10__repr__(struct __pyx_obj_3epr_Raster *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_8create_raster(CYTHON_UNUSED PyObject *__pyx_self, EPR_EDataTypeId __pyx_v_data_type, uint __pyx_v_src_width, uint __pyx_v_src_height, uint __pyx_v_xstep, uint __pyx_v_ystep); /* proto */
static PyObject *__pyx_pf_3epr_10create_bitmask_raster(CYTHON_UNUSED PyObject *__pyx_self, uint __pyx_v_src_width, uint __pyx_v_src_height, uint __pyx_v_xstep, uint __pyx_v_ystep); /* proto */
static PyObject *__pyx_pf_3epr_4Band_7product___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_17spectr_band_index___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_12sample_model___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_9data_type___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_14scaling_method___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_14scaling_offset___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_14scaling_factor___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_7bm_expr___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_4unit___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_11description___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_14lines_mirrored___get__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_get_name(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_4Band_2create_compatible_raster(struct __pyx_obj_3epr_Band *__pyx_v_self, uint __pyx_v_src_width, uint __pyx_v_src_height, uint __pyx_v_xstep, uint __pyx_v_ystep); /* proto */
static PyObject *__pyx_pf_3epr_4Band_4read_raster(struct __pyx_obj_3epr_Band *__pyx_v_self, int __pyx_v_xoffset, int __pyx_v_yoffset, struct __pyx_obj_3epr_Raster *__pyx_v_raster); /* proto */
static PyObject *__pyx_pf_3epr_4Band_6read_as_array(struct __pyx_obj_3epr_Band *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, uint __pyx_v_xoffset, uint __pyx_v_yoffset, uint __pyx_v_xstep, uint __pyx_v_ystep); /* proto */
static PyObject *__pyx_pf_3epr_4Band_8__repr__(struct __pyx_obj_3epr_Band *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_7product___get__(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_11description___get__(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_get_name(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_2get_dsd_name(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_4get_num_records(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_6get_dsd(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_8create_record(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_10read_record(struct __pyx_obj_3epr_Dataset *__pyx_v_self, uint __pyx_v_index, struct __pyx_obj_3epr_Record *__pyx_v_record); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_12records(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_14__iter__(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_16__str__(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Dataset_18__repr__(struct __pyx_obj_3epr_Dataset *__pyx_v_self); /* proto */
static int __pyx_pf_3epr_7Product___cinit__(struct __pyx_obj_3epr_Product *__pyx_v_self, PyObject *__pyx_v_filename, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kargs); /* proto */
static void __pyx_pf_3epr_7Product_2__dealloc__(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static int __pyx_pf_3epr_7Product_4__init__(CYTHON_UNUSED struct __pyx_obj_3epr_Product *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_3epr_7Product_9file_path___get__(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_8tot_size___get__(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_9id_string___get__(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_18meris_iodd_version___get__(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_6get_scene_width(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_8get_scene_height(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_10get_num_datasets(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_12get_num_dsds(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_14get_num_bands(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_16get_dataset_at(struct __pyx_obj_3epr_Product *__pyx_v_self, uint __pyx_v_index); /* proto */
static PyObject *__pyx_pf_3epr_7Product_18get_dataset(struct __pyx_obj_3epr_Product *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_3epr_7Product_20get_dsd_at(struct __pyx_obj_3epr_Product *__pyx_v_self, uint __pyx_v_index); /* proto */
static PyObject *__pyx_pf_3epr_7Product_22get_mph(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_24get_sph(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_26get_band(struct __pyx_obj_3epr_Product *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_3epr_7Product_28get_band_at(struct __pyx_obj_3epr_Product *__pyx_v_self, uint __pyx_v_index); /* proto */
static PyObject *__pyx_pf_3epr_7Product_30read_bitmask_raster(struct __pyx_obj_3epr_Product *__pyx_v_self, PyObject *__pyx_v_bm_expr, int __pyx_v_xoffset, int __pyx_v_yoffset, struct __pyx_obj_3epr_Raster *__pyx_v_raster); /* proto */
static PyObject *__pyx_pf_3epr_7Product_32get_dataset_names(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_34get_band_names(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_36datasets(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_38bands(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_40__repr__(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_7Product_42__str__(struct __pyx_obj_3epr_Product *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3epr_12open(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_3epr_14_close_api(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static char __pyx_k_1[] = "UTF-8";
static char __pyx_k_2[] = "";
static char __pyx_k_3[] = "null pointer";
static char __pyx_k_4[] = "%s: %s";
static char __pyx_k_5[] = "bad output stream";
static char __pyx_k_7[] = "invalid ostream";
static char __pyx_k_9[] = "unable to inizialize EPR API library: %s";
static char __pyx_k_10[] = "\"%s\" class cannot be instantiated from Python";
static char __pyx_k_11[] = "invalid scaling method: \"%s\"";
static char __pyx_k_12[] = "invalid sample model: \"%s\"";
static char __pyx_k_13[] = "epr.DSD(\"%s\")";
static char __pyx_k_14[] = "DSD only implements \"==\" and \"!=\" operators";
static char __pyx_k_16[] = "invalid index: %d";
static char __pyx_k_17[] = "invalid field type";
static char __pyx_k_19[] = "Filed(\"%s\") elems pointer is null";
static char __pyx_k_21[] = "epr.Field(\"%s\") %d %s elements";
static char __pyx_k_22[] = "%s = \"%s\"";
static char __pyx_k_23[] = "%s = {d=%d, j=%d, m=%d}";
static char __pyx_k_24[] = "%u";
static char __pyx_k_25[] = "%d";
static char __pyx_k_26[] = "%f";
static char __pyx_k_27[] = "<<unknown data type>>";
static char __pyx_k_28[] = ", ";
static char __pyx_k_29[] = "%s = {%s}";
static char __pyx_k_30[] = "%s = <<unknown data type>>";
static char __pyx_k_31[] = "%s = %s";
static char __pyx_k_32[] = "Field only implements \"==\" and \"!=\" operators";
static char __pyx_k_34[] = "unable to get field \"%s\"";
static char __pyx_k_35[] = "unable to get field at index %d";
static char __pyx_k_36[] = "\n";
static char __pyx_k_37[] = "%s %d fields";
static char __pyx_k_38[] = "index out of range: x=%d, y=%d";
static char __pyx_k_39[] = "invalid data type: \"%s\"";
static char __pyx_k_40[] = "invalid data type";
static char __pyx_k_43[] = "%s %s (%dL x %dP)";
static char __pyx_k_44[] = "invalid step: xspet=%d, ystep=%d";
static char __pyx_k_45[] = "unable to create a new raster";
static char __pyx_k_46[] = "unable to create compatible raster with width=%d, height=%d xstep=%d, ystep=%d";
static char __pyx_k_47[] = "create_compatible_raster";
static char __pyx_k_48[] = "xoffset os larger that he scene width";
static char __pyx_k_50[] = "yoffset os larger that he scene height";
static char __pyx_k_52[] = "epr.Band(%s) of epr.Product(%s)";
static char __pyx_k_53[] = "unable to read record at index %d";
static char __pyx_k_54[] = "epr.Dataset(%s) %d records";
static char __pyx_k_55[] = "_DEFAULT_FS_ENCODING";
static char __pyx_k_56[] = "unable to open \"%s\"";
static char __pyx_k_57[] = "unable to get dataset at index %d";
static char __pyx_k_58[] = "unable to get dataset \"%s\"";
static char __pyx_k_59[] = "unable to get DSD at index \"%d\"";
static char __pyx_k_60[] = "unable to get MPH record";
static char __pyx_k_61[] = "unable to get SPH record";
static char __pyx_k_62[] = "unable to get band \"%s\"";
static char __pyx_k_63[] = "unable to get band at index \"%d\"";
static char __pyx_k_64[] = "epr.Product(%s) %d datasets, %d bands";
static char __pyx_k_65[] = "ndarray is not C contiguous";
static char __pyx_k_67[] = "ndarray is not Fortran contiguous";
static char __pyx_k_69[] = "Non-native byte order not supported";
static char __pyx_k_71[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_72[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_75[] = "Format string allocated too short.";
static char __pyx_k_77[] = "The index of this DSD (zero-based)";
static char __pyx_k_78[] = "The dataset name";
static char __pyx_k_79[] = "The dataset type descriptor";
static char __pyx_k_80[] = "The filename in the DDDB with the description of this dataset";
static char __pyx_k_81[] = "The offset of dataset-information the product file";
static char __pyx_k_82[] = "The size of dataset-information in dataset product file";
static char __pyx_k_83[] = "The number of dataset records for the given dataset name";
static char __pyx_k_84[] = "The size of dataset record for the given dataset name";
static char __pyx_k_85[] = "The data type of the band's pixels\n\n        All ``E_TID_*`` types are possible\n\n        ";
static char __pyx_k_86[] = "The width of the source";
static char __pyx_k_87[] = "The height of the source";
static char __pyx_k_88[] = "The sub-sampling for the across-track direction in pixel";
static char __pyx_k_89[] = "The sub-sampling for the along-track direction in pixel";
static char __pyx_k_90[] = "Raster data exposed as :class:`numpy.ndarray` object\n\n        .. note:: this property shares the data buffer with the\n                  :class:`Raster` object so any change in its contents\n                  is also reflected to the :class:`Raster` object\n\n        ";
static char __pyx_k_91[] = "The :class:`Product` instance to which this band belongs to";
static char __pyx_k_92[] = "The (zero-based) spectral band index\n\n        -1 if this is not a spectral band\n\n        ";
static char __pyx_k_93[] = "The sample model operation\n\n        The sample model operation applied to the source dataset for\n        getting the correct samples from the MDS (for example MERIS\n        L2).\n\n        Possible values are:\n\n        * ``*``     --> no operation (direct copy)\n        * ``1OF2``  --> first byte of 2-byte interleaved MDS\n        * ``2OF2``  --> second byte of 2-byte interleaved MDS\n        * ``0123``  --> combine 3-bytes interleaved to 4-byte integer\n\n        ";
static char __pyx_k_94[] = "The data type of the band's pixels\n\n        Possible values are:\n\n        * ``*``         --> the datatype remains unchanged.\n        * ``uint8_t``   --> 8-bit unsigned integer\n        * ``uint32_t``  --> 32-bit unsigned integer\n        * ``Float``     --> 32-bit IEEE floating point\n\n        ";
static char __pyx_k_95[] = "Scaling method\n\n        The scaling method which must be applied to the raw source data\n        in order to get the 'real' pixel values in geo-physical units.\n\n        Possible values are:\n\n        * ``*``            --> no scaling applied\n        * ``Linear_Scale`` --> linear scaling applied::\n\n            y = offset + scale * x\n\n        * ``Log_Scale``    --> logarithmic scaling applied::\n\n            y = log10(offset + scale * x)\n\n        ";
static char __pyx_k_96[] = "The scaling offset\n\n        Possible values are:\n\n        * ``*`` --> no offset provided (implies scaling_method=*)\n        * ``const`` --> a floating point constant\n        * ``GADS.field[.field2]` --> value is provided in global\n          annotation dataset with name ``GADS`` in field ``field``.\n          Optionally a second element index for multiple-element fields\n          can be given too\n\n        ";
static char __pyx_k_97[] = "The scaling factor\n\n        Possible values are:\n\n        * ``*`` --> no factor provided (implies scaling_method=*)\n        * ``const`` --> a floating point constant\n        * ``GADS.field[.field2]`` --> value is provided in global\n          annotation dataset with name `GADS` in field `field``.\n          Optionally a second element index for multiple-element fields\n          can be given too\n\n        ";
static char __pyx_k_98[] = "A bit-mask expression used to filter valid pixels\n\n        All others are set to zero\n\n        ";
static char __pyx_k_99[] = "The geophysical unit for the band's pixel values";
static char __pyx_k__B[] = "B";
static char __pyx_k__H[] = "H";
static char __pyx_k__I[] = "I";
static char __pyx_k__L[] = "L";
static char __pyx_k__O[] = "O";
static char __pyx_k__Q[] = "Q";
static char __pyx_k__b[] = "b";
static char __pyx_k__d[] = "d";
static char __pyx_k__f[] = "f";
static char __pyx_k__g[] = "g";
static char __pyx_k__h[] = "h";
static char __pyx_k__i[] = "i";
static char __pyx_k__l[] = "l";
static char __pyx_k__q[] = "q";
static char __pyx_k__w[] = "w";
static char __pyx_k__x[] = "x";
static char __pyx_k__y[] = "y";
static char __pyx_k_100[] = "A short description of the band's contents";
static char __pyx_k_101[] = "Mirrored lines flag\n\n        If true (=1) lines will be mirrored (flipped) after read into a\n        raster in order to ensure a pixel ordering in raster X\n        direction from WEST to EAST.\n\n        ";
static char __pyx_k_102[] = "The :class:`Product` instance to which this dataset belongs to";
static char __pyx_k_103[] = "The file's path including the file name";
static char __pyx_k_104[] = "The total size in bytes of the product file";
static char __pyx_k_105[] = "The product identifier string obtained from the MPH\n        parameter 'PRODUCT'\n\n        The first 10 characters of this string identify the product\n        type, e.g. \"MER_1P__FR\" for a MERIS Level 1b full resolution\n        product.\n        The rest of the string decodes product instance properties.\n\n        ";
static char __pyx_k_106[] = "For MERIS L1b and RR and FR to provide backward compatibility";
static char __pyx_k_107[] = "Python bindings for ENVISAT Product Reader C API\n\nPyEPR_ provides Python_ bindings for the ENVISAT Product Reader C API\n(`EPR API`_) for reading satellite data from ENVISAT_ ESA_ (European\nSpace Agency) mission.\n\nPyEPR_ is fully object oriented and, as well as the `EPR API`_ for C,\nsupports ENVISAT_ MERIS, AATSR Level 1B and Level 2 and also ASAR data\nproducts. It provides access to the data either on a geophysical\n(decoded, ready-to-use pixel samples) or on a raw data layer.\nThe raw data access makes it possible to read any data field contained\nin a product file.\n\n.. _PyEPR: http://avalentino.github.com/pyepr\n.. _Python: http://www.python.org\n.. _`EPR API`: https://github.com/bcdev/epr-api\n.. _ENVISAT: http://envisat.esa.int\n.. _ESA: http://earth.esa.int\n\n";
static char __pyx_k_108[] = "$Id: aff31bec5e779ad5a16424ee13c0f478debff716 $";
static char __pyx_k_109[] = "0.7.1";
static char __pyx_k_110[] = "getfilesystemencoding";
static char __pyx_k_115[] = "/home/antonio/projects/pyepr/src/epr.pyx";
static char __pyx_k_117[] = "EPR API error";
static char __pyx_k_124[] = "get_scaling_method_name";
static char __pyx_k_127[] = "get_sample_model_name";
static char __pyx_k_132[] = "create_bitmask_raster";
static char __pyx_k__Zd[] = "Zd";
static char __pyx_k__Zf[] = "Zf";
static char __pyx_k__Zg[] = "Zg";
static char __pyx_k__gc[] = "gc";
static char __pyx_k__np[] = "np";
static char __pyx_k__LIN[] = "LIN";
static char __pyx_k__LOG[] = "LOG";
static char __pyx_k__epr[] = "epr";
static char __pyx_k__int[] = "int";
static char __pyx_k__map[] = "map";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__1OF1[] = "1OF1";
static char __pyx_k__1OF2[] = "1OF2";
static char __pyx_k__2OF2[] = "2OF2";
static char __pyx_k__2TOF[] = "2TOF";
static char __pyx_k__3TOI[] = "3TOI";
static char __pyx_k__NONE[] = "NONE";
static char __pyx_k__args[] = "args";
static char __pyx_k__byte[] = "byte";
static char __pyx_k__code[] = "code";
static char __pyx_k__data[] = "data";
static char __pyx_k__days[] = "days";
static char __pyx_k__join[] = "join";
static char __pyx_k__mmap[] = "mmap";
static char __pyx_k__open[] = "open";
static char __pyx_k__repr[] = "repr";
static char __pyx_k__self[] = "self";
static char __pyx_k__uint[] = "uint";
static char __pyx_k__ascii[] = "ascii";
static char __pyx_k__bands[] = "bands";
static char __pyx_k__flush[] = "flush";
static char __pyx_k__index[] = "index";
static char __pyx_k__kargs[] = "kargs";
static char __pyx_k__model[] = "model";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__range[] = "range";
static char __pyx_k__short[] = "short";
static char __pyx_k__super[] = "super";
static char __pyx_k__width[] = "width";
static char __pyx_k__xstep[] = "xstep";
static char __pyx_k__ystep[] = "ystep";
static char __pyx_k__atexit[] = "atexit";
static char __pyx_k__decode[] = "decode";
static char __pyx_k__double[] = "double";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__extend[] = "extend";
static char __pyx_k__fields[] = "fields";
static char __pyx_k__height[] = "height";
static char __pyx_k__method[] = "method";
static char __pyx_k__raster[] = "raster";
static char __pyx_k__record[] = "record";
static char __pyx_k__stdout[] = "stdout";
static char __pyx_k__ushort[] = "ushort";
static char __pyx_k__EPRTime[] = "EPRTime";
static char __pyx_k__bm_expr[] = "bm_expr";
static char __pyx_k__collect[] = "collect";
static char __pyx_k__ds_name[] = "ds_name";
static char __pyx_k__float32[] = "float32";
static char __pyx_k__message[] = "message";
static char __pyx_k__ostream[] = "ostream";
static char __pyx_k__product[] = "product";
static char __pyx_k__records[] = "records";
static char __pyx_k__seconds[] = "seconds";
static char __pyx_k__type_id[] = "type_id";
static char __pyx_k__xoffset[] = "xoffset";
static char __pyx_k__yoffset[] = "yoffset";
static char __pyx_k__EPRError[] = "EPRError";
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____name__[] = "__name__";
static char __pyx_k____repr__[] = "__repr__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__datasets[] = "datasets";
static char __pyx_k__filename[] = "filename";
static char __pyx_k__get_elem[] = "get_elem";
static char __pyx_k__get_name[] = "get_name";
static char __pyx_k__get_type[] = "get_type";
static char __pyx_k__register[] = "register";
static char __pyx_k__E_TID_INT[] = "E_TID_INT";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k____class__[] = "__class__";
static char __pyx_k__data_type[] = "data_type";
static char __pyx_k__get_elems[] = "get_elems";
static char __pyx_k__get_width[] = "get_width";
static char __pyx_k__id_string[] = "id_string";
static char __pyx_k__src_width[] = "src_width";
static char __pyx_k__E_SMID_LIN[] = "E_SMID_LIN";
static char __pyx_k__E_SMID_LOG[] = "E_SMID_LOG";
static char __pyx_k__E_SMID_NON[] = "E_SMID_NON";
static char __pyx_k__E_TID_CHAR[] = "E_TID_CHAR";
static char __pyx_k__E_TID_TIME[] = "E_TID_TIME";
static char __pyx_k__E_TID_UINT[] = "E_TID_UINT";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k___close_api[] = "_close_api";
static char __pyx_k__get_height[] = "get_height";
static char __pyx_k__namedtuple[] = "namedtuple";
static char __pyx_k__raster_ptr[] = "raster_ptr";
static char __pyx_k__src_height[] = "src_height";
static char __pyx_k__E_SMOD_1OF1[] = "E_SMOD_1OF1";
static char __pyx_k__E_SMOD_1OF2[] = "E_SMOD_1OF2";
static char __pyx_k__E_SMOD_2OF2[] = "E_SMOD_2OF2";
static char __pyx_k__E_SMOD_2TOF[] = "E_SMOD_2TOF";
static char __pyx_k__E_SMOD_3TOI[] = "E_SMOD_3TOI";
static char __pyx_k__E_TID_FLOAT[] = "E_TID_FLOAT";
static char __pyx_k__E_TID_SHORT[] = "E_TID_SHORT";
static char __pyx_k__E_TID_SPARE[] = "E_TID_SPARE";
static char __pyx_k__E_TID_UCHAR[] = "E_TID_UCHAR";
static char __pyx_k__ImportError[] = "ImportError";
static char __pyx_k____version__[] = "__version__";
static char __pyx_k__collections[] = "collections";
static char __pyx_k__field_index[] = "field_index";
static char __pyx_k__get_band_at[] = "get_band_at";
static char __pyx_k__read_raster[] = "read_raster";
static char __pyx_k__read_record[] = "read_record";
static char __pyx_k__type_id_str[] = "type_id_str";
static char __pyx_k__E_TID_DOUBLE[] = "E_TID_DOUBLE";
static char __pyx_k__E_TID_STRING[] = "E_TID_STRING";
static char __pyx_k__E_TID_USHORT[] = "E_TID_USHORT";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k____revision__[] = "__revision__";
static char __pyx_k__get_field_at[] = "get_field_at";
static char __pyx_k__microseconds[] = "microseconds";
static char __pyx_k__EPRValueError[] = "EPRValueError";
static char __pyx_k__E_TID_UNKNOWN[] = "E_TID_UNKNOWN";
static char __pyx_k__create_raster[] = "create_raster";
static char __pyx_k__element_index[] = "element_index";
static char __pyx_k__get_num_bands[] = "get_num_bands";
static char __pyx_k__get_num_elems[] = "get_num_elems";
static char __pyx_k__AttributeError[] = "AttributeError";
static char __pyx_k__NotImplemented[] = "NotImplemented";
static char __pyx_k__get_dataset_at[] = "get_dataset_at";
static char __pyx_k__get_num_fields[] = "get_num_fields";
static char __pyx_k__get_num_records[] = "get_num_records";
static char __pyx_k__get_scene_width[] = "get_scene_width";
static char __pyx_k__get_num_datasets[] = "get_num_datasets";
static char __pyx_k__get_scene_height[] = "get_scene_height";
static char __pyx_k__EPR_C_API_VERSION[] = "EPR_C_API_VERSION";
static char __pyx_k__get_data_type_size[] = "get_data_type_size";
static char __pyx_k__data_type_id_to_str[] = "data_type_id_to_str";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_108;
static PyObject *__pyx_kp_s_109;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_n_s_110;
static PyObject *__pyx_kp_s_115;
static PyObject *__pyx_kp_s_117;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_n_s_124;
static PyObject *__pyx_n_s_127;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_n_s_132;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_35;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_n_s_47;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_50;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_53;
static PyObject *__pyx_kp_s_54;
static PyObject *__pyx_n_s_55;
static PyObject *__pyx_kp_s_56;
static PyObject *__pyx_kp_s_57;
static PyObject *__pyx_kp_s_58;
static PyObject *__pyx_kp_s_59;
static PyObject *__pyx_kp_s_60;
static PyObject *__pyx_kp_s_61;
static PyObject *__pyx_kp_s_62;
static PyObject *__pyx_kp_s_63;
static PyObject *__pyx_kp_s_64;
static PyObject *__pyx_kp_u_65;
static PyObject *__pyx_kp_u_67;
static PyObject *__pyx_kp_u_69;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_u_71;
static PyObject *__pyx_kp_u_72;
static PyObject *__pyx_kp_u_75;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_kp_s__1OF1;
static PyObject *__pyx_kp_s__1OF2;
static PyObject *__pyx_kp_s__2OF2;
static PyObject *__pyx_kp_s__2TOF;
static PyObject *__pyx_kp_s__3TOI;
static PyObject *__pyx_n_s__AttributeError;
static PyObject *__pyx_n_s__EPRError;
static PyObject *__pyx_n_s__EPRTime;
static PyObject *__pyx_n_s__EPRValueError;
static PyObject *__pyx_n_s__EPR_C_API_VERSION;
static PyObject *__pyx_n_s__E_SMID_LIN;
static PyObject *__pyx_n_s__E_SMID_LOG;
static PyObject *__pyx_n_s__E_SMID_NON;
static PyObject *__pyx_n_s__E_SMOD_1OF1;
static PyObject *__pyx_n_s__E_SMOD_1OF2;
static PyObject *__pyx_n_s__E_SMOD_2OF2;
static PyObject *__pyx_n_s__E_SMOD_2TOF;
static PyObject *__pyx_n_s__E_SMOD_3TOI;
static PyObject *__pyx_n_s__E_TID_CHAR;
static PyObject *__pyx_n_s__E_TID_DOUBLE;
static PyObject *__pyx_n_s__E_TID_FLOAT;
static PyObject *__pyx_n_s__E_TID_INT;
static PyObject *__pyx_n_s__E_TID_SHORT;
static PyObject *__pyx_n_s__E_TID_SPARE;
static PyObject *__pyx_n_s__E_TID_STRING;
static PyObject *__pyx_n_s__E_TID_TIME;
static PyObject *__pyx_n_s__E_TID_UCHAR;
static PyObject *__pyx_n_s__E_TID_UINT;
static PyObject *__pyx_n_s__E_TID_UNKNOWN;
static PyObject *__pyx_n_s__E_TID_USHORT;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__ImportError;
static PyObject *__pyx_n_s__KeyError;
static PyObject *__pyx_n_s__LIN;
static PyObject *__pyx_n_s__LOG;
static PyObject *__pyx_n_s__NONE;
static PyObject *__pyx_n_s__NotImplemented;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____class__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____name__;
static PyObject *__pyx_n_s____repr__;
static PyObject *__pyx_n_s____revision__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s____version__;
static PyObject *__pyx_n_s___close_api;
static PyObject *__pyx_n_s__args;
static PyObject *__pyx_n_s__ascii;
static PyObject *__pyx_n_s__atexit;
static PyObject *__pyx_n_s__bands;
static PyObject *__pyx_n_s__bm_expr;
static PyObject *__pyx_n_s__byte;
static PyObject *__pyx_n_s__code;
static PyObject *__pyx_n_s__collect;
static PyObject *__pyx_n_s__collections;
static PyObject *__pyx_n_s__create_raster;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__data_type;
static PyObject *__pyx_n_s__data_type_id_to_str;
static PyObject *__pyx_n_s__datasets;
static PyObject *__pyx_n_s__days;
static PyObject *__pyx_n_s__decode;
static PyObject *__pyx_n_s__double;
static PyObject *__pyx_n_s__ds_name;
static PyObject *__pyx_n_s__element_index;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__epr;
static PyObject *__pyx_n_s__extend;
static PyObject *__pyx_n_s__field_index;
static PyObject *__pyx_n_s__fields;
static PyObject *__pyx_n_s__filename;
static PyObject *__pyx_n_s__float32;
static PyObject *__pyx_n_s__flush;
static PyObject *__pyx_n_s__gc;
static PyObject *__pyx_n_s__get_band_at;
static PyObject *__pyx_n_s__get_data_type_size;
static PyObject *__pyx_n_s__get_dataset_at;
static PyObject *__pyx_n_s__get_elem;
static PyObject *__pyx_n_s__get_elems;
static PyObject *__pyx_n_s__get_field_at;
static PyObject *__pyx_n_s__get_height;
static PyObject *__pyx_n_s__get_name;
static PyObject *__pyx_n_s__get_num_bands;
static PyObject *__pyx_n_s__get_num_datasets;
static PyObject *__pyx_n_s__get_num_elems;
static PyObject *__pyx_n_s__get_num_fields;
static PyObject *__pyx_n_s__get_num_records;
static PyObject *__pyx_n_s__get_scene_height;
static PyObject *__pyx_n_s__get_scene_width;
static PyObject *__pyx_n_s__get_type;
static PyObject *__pyx_n_s__get_width;
static PyObject *__pyx_n_s__height;
static PyObject *__pyx_n_s__id_string;
static PyObject *__pyx_n_s__index;
static PyObject *__pyx_n_s__int;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__kargs;
static PyObject *__pyx_n_s__map;
static PyObject *__pyx_n_s__message;
static PyObject *__pyx_n_s__method;
static PyObject *__pyx_n_s__microseconds;
static PyObject *__pyx_n_s__mmap;
static PyObject *__pyx_n_s__model;
static PyObject *__pyx_n_s__namedtuple;
static PyObject *__pyx_n_s__np;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__ostream;
static PyObject *__pyx_n_s__product;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__raster;
static PyObject *__pyx_n_s__raster_ptr;
static PyObject *__pyx_n_s__read_raster;
static PyObject *__pyx_n_s__read_record;
static PyObject *__pyx_n_s__record;
static PyObject *__pyx_n_s__records;
static PyObject *__pyx_n_s__register;
static PyObject *__pyx_n_s__repr;
static PyObject *__pyx_n_s__seconds;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__short;
static PyObject *__pyx_n_s__src_height;
static PyObject *__pyx_n_s__src_width;
static PyObject *__pyx_n_s__stdout;
static PyObject *__pyx_n_s__super;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__type_id;
static PyObject *__pyx_n_s__type_id_str;
static PyObject *__pyx_n_s__uint;
static PyObject *__pyx_n_s__ushort;
static PyObject *__pyx_n_s__width;
static PyObject *__pyx_n_s__x;
static PyObject *__pyx_n_s__xoffset;
static PyObject *__pyx_n_s__xstep;
static PyObject *__pyx_n_s__y;
static PyObject *__pyx_n_s__yoffset;
static PyObject *__pyx_n_s__ystep;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_15;
static PyObject *__pyx_k_tuple_6;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_15;
static PyObject *__pyx_k_tuple_18;
static PyObject *__pyx_k_tuple_20;
static PyObject *__pyx_k_tuple_33;
static PyObject *__pyx_k_tuple_41;
static PyObject *__pyx_k_tuple_42;
static PyObject *__pyx_k_tuple_49;
static PyObject *__pyx_k_tuple_51;
static PyObject *__pyx_k_tuple_66;
static PyObject *__pyx_k_tuple_68;
static PyObject *__pyx_k_tuple_70;
static PyObject *__pyx_k_tuple_73;
static PyObject *__pyx_k_tuple_74;
static PyObject *__pyx_k_tuple_76;
static PyObject *__pyx_k_tuple_111;
static PyObject *__pyx_k_tuple_112;
static PyObject *__pyx_k_tuple_113;
static PyObject *__pyx_k_tuple_116;
static PyObject *__pyx_k_tuple_118;
static PyObject *__pyx_k_tuple_120;
static PyObject *__pyx_k_tuple_122;
static PyObject *__pyx_k_tuple_125;
static PyObject *__pyx_k_tuple_128;
static PyObject *__pyx_k_tuple_130;
static PyObject *__pyx_k_tuple_133;
static PyObject *__pyx_k_tuple_135;
static PyObject *__pyx_k_codeobj_114;
static PyObject *__pyx_k_codeobj_119;
static PyObject *__pyx_k_codeobj_121;
static PyObject *__pyx_k_codeobj_123;
static PyObject *__pyx_k_codeobj_126;
static PyObject *__pyx_k_codeobj_129;
static PyObject *__pyx_k_codeobj_131;
static PyObject *__pyx_k_codeobj_134;
static PyObject *__pyx_k_codeobj_136;

/* "epr.pyx":381
 * 
 * 
 * cdef inline bytes _to_bytes(s, encoding='UTF-8'):             # <<<<<<<<<<<<<<
 *     if hasattr(s, 'encode'):
 *         return s.encode(encoding)
 */

static CYTHON_INLINE PyObject *__pyx_f_3epr__to_bytes(PyObject *__pyx_v_s, struct __pyx_opt_args_3epr__to_bytes *__pyx_optional_args) {
  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_kp_s_1);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  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("_to_bytes", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_encoding = __pyx_optional_args->encoding;
    }
  }

  /* "epr.pyx":382
 * 
 * cdef inline bytes _to_bytes(s, encoding='UTF-8'):
 *     if hasattr(s, 'encode'):             # <<<<<<<<<<<<<<
 *         return s.encode(encoding)
 *     else:
 */
  __pyx_t_1 = ((PyObject *)__pyx_n_s__encode);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_s, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "epr.pyx":383
 * cdef inline bytes _to_bytes(s, encoding='UTF-8'):
 *     if hasattr(s, 'encode'):
 *         return s.encode(encoding)             # <<<<<<<<<<<<<<
 *     else:
 *         return s
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_encoding);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_encoding);
    __Pyx_GIVEREF(__pyx_v_encoding);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":385
 *         return s.encode(encoding)
 *     else:
 *         return s             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_s);
    __pyx_r = ((PyObject*)__pyx_v_s);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("epr._to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":388
 * 
 * 
 * cdef inline str _to_str(b, encoding='UTF-8'):             # <<<<<<<<<<<<<<
 *     if PY3:
 *         return b.decode(encoding)
 */

static CYTHON_INLINE PyObject *__pyx_f_3epr__to_str(PyObject *__pyx_v_b, struct __pyx_opt_args_3epr__to_str *__pyx_optional_args) {
  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_kp_s_1);
  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("_to_str", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_encoding = __pyx_optional_args->encoding;
    }
  }

  /* "epr.pyx":389
 * 
 * cdef inline str _to_str(b, encoding='UTF-8'):
 *     if PY3:             # <<<<<<<<<<<<<<
 *         return b.decode(encoding)
 *     else:
 */
  if (__pyx_v_3epr_PY3) {

    /* "epr.pyx":390
 * cdef inline str _to_str(b, encoding='UTF-8'):
 *     if PY3:
 *         return b.decode(encoding)             # <<<<<<<<<<<<<<
 *     else:
 *         return b
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_b, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_encoding);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_encoding);
    __Pyx_GIVEREF(__pyx_v_encoding);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":392
 *         return b.decode(encoding)
 *     else:
 *         return b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (!(likely(PyString_CheckExact(__pyx_v_b))||((__pyx_v_b) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_b)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_b);
    __pyx_r = ((PyObject*)__pyx_v_b);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = ((PyObject*)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("epr._to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":427
 * 
 * 
 * cdef np.NPY_TYPES _epr_to_numpy_type_id(EPR_DataTypeId epr_type):             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_UCHAR:
 *         return np.NPY_UBYTE
 */

static enum NPY_TYPES __pyx_f_3epr__epr_to_numpy_type_id(enum EPR_DataTypeId __pyx_v_epr_type) {
  enum NPY_TYPES __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_epr_to_numpy_type_id", 0);

  /* "epr.pyx":428
 * 
 * cdef np.NPY_TYPES _epr_to_numpy_type_id(EPR_DataTypeId epr_type):
 *     if epr_type == E_TID_UCHAR:             # <<<<<<<<<<<<<<
 *         return np.NPY_UBYTE
 *     if epr_type == E_TID_CHAR:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_UCHAR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":429
 * cdef np.NPY_TYPES _epr_to_numpy_type_id(EPR_DataTypeId epr_type):
 *     if epr_type == E_TID_UCHAR:
 *         return np.NPY_UBYTE             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_CHAR:
 *         return np.NPY_BYTE
 */
    __pyx_r = NPY_UBYTE;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":430
 *     if epr_type == E_TID_UCHAR:
 *         return np.NPY_UBYTE
 *     if epr_type == E_TID_CHAR:             # <<<<<<<<<<<<<<
 *         return np.NPY_BYTE
 *     if epr_type == E_TID_USHORT:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_CHAR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __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_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":431
 *         return np.NPY_UBYTE
 *     if epr_type == E_TID_CHAR:
 *         return np.NPY_BYTE             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_USHORT:
 *         return np.NPY_USHORT
 */
    __pyx_r = NPY_BYTE;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "epr.pyx":432
 *     if epr_type == E_TID_CHAR:
 *         return np.NPY_BYTE
 *     if epr_type == E_TID_USHORT:             # <<<<<<<<<<<<<<
 *         return np.NPY_USHORT
 *     if epr_type == E_TID_SHORT:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_USHORT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":433
 *         return np.NPY_BYTE
 *     if epr_type == E_TID_USHORT:
 *         return np.NPY_USHORT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_SHORT:
 *         return np.NPY_SHORT
 */
    __pyx_r = NPY_USHORT;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "epr.pyx":434
 *     if epr_type == E_TID_USHORT:
 *         return np.NPY_USHORT
 *     if epr_type == E_TID_SHORT:             # <<<<<<<<<<<<<<
 *         return np.NPY_SHORT
 *     if epr_type == E_TID_UINT:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_SHORT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __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_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":435
 *         return np.NPY_USHORT
 *     if epr_type == E_TID_SHORT:
 *         return np.NPY_SHORT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_UINT:
 *         return np.NPY_UINT
 */
    __pyx_r = NPY_SHORT;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "epr.pyx":436
 *     if epr_type == E_TID_SHORT:
 *         return np.NPY_SHORT
 *     if epr_type == E_TID_UINT:             # <<<<<<<<<<<<<<
 *         return np.NPY_UINT
 *     if epr_type == E_TID_INT:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_UINT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":437
 *         return np.NPY_SHORT
 *     if epr_type == E_TID_UINT:
 *         return np.NPY_UINT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_INT:
 *         return np.NPY_INT
 */
    __pyx_r = NPY_UINT;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "epr.pyx":438
 *     if epr_type == E_TID_UINT:
 *         return np.NPY_UINT
 *     if epr_type == E_TID_INT:             # <<<<<<<<<<<<<<
 *         return np.NPY_INT
 *     if epr_type == E_TID_FLOAT:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_INT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __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_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":439
 *         return np.NPY_UINT
 *     if epr_type == E_TID_INT:
 *         return np.NPY_INT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_FLOAT:
 *         return np.NPY_FLOAT
 */
    __pyx_r = NPY_INT;
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "epr.pyx":440
 *     if epr_type == E_TID_INT:
 *         return np.NPY_INT
 *     if epr_type == E_TID_FLOAT:             # <<<<<<<<<<<<<<
 *         return np.NPY_FLOAT
 *     if epr_type == E_TID_DOUBLE:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_FLOAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":441
 *         return np.NPY_INT
 *     if epr_type == E_TID_FLOAT:
 *         return np.NPY_FLOAT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_DOUBLE:
 *         return np.NPY_DOUBLE
 */
    __pyx_r = NPY_FLOAT;
    goto __pyx_L0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "epr.pyx":442
 *     if epr_type == E_TID_FLOAT:
 *         return np.NPY_FLOAT
 *     if epr_type == E_TID_DOUBLE:             # <<<<<<<<<<<<<<
 *         return np.NPY_DOUBLE
 *     if epr_type == E_TID_STRING:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __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_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":443
 *         return np.NPY_FLOAT
 *     if epr_type == E_TID_DOUBLE:
 *         return np.NPY_DOUBLE             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_STRING:
 *         return np.NPY_STRING
 */
    __pyx_r = NPY_DOUBLE;
    goto __pyx_L0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "epr.pyx":444
 *     if epr_type == E_TID_DOUBLE:
 *         return np.NPY_DOUBLE
 *     if epr_type == E_TID_STRING:             # <<<<<<<<<<<<<<
 *         return np.NPY_STRING
 * 
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_STRING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "epr.pyx":445
 *         return np.NPY_DOUBLE
 *     if epr_type == E_TID_STRING:
 *         return np.NPY_STRING             # <<<<<<<<<<<<<<
 * 
 *     return np.NPY_NOTYPE
 */
    __pyx_r = NPY_STRING;
    goto __pyx_L0;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "epr.pyx":447
 *         return np.NPY_STRING
 * 
 *     return np.NPY_NOTYPE             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = NPY_NOTYPE;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("epr._epr_to_numpy_type_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_8EPRError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_8EPRError___init__[] = "__init__(self, message='', code=None, *args, **kargs)";
static PyMethodDef __pyx_mdef_3epr_8EPRError_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3epr_8EPRError_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_8EPRError___init__)};
static PyObject *__pyx_pw_3epr_8EPRError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kargs = PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 3) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 3, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__message,&__pyx_n_s__code,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_2));

    /* "epr.pyx":453
 *     '''EPR API error'''
 * 
 *     def __init__(self, message='', code=None, *args, **kargs):             # <<<<<<<<<<<<<<
 *         '''__init__(self, message='', code=None, *args, **kargs)'''
 * 
 */
    values[2] = ((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) {
        default:
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__message);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__code);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 3) ? pos_args : 3;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        default:
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        case  0:
        goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_code = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0;
  __Pyx_AddTraceback("epr.EPRError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_8EPRError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_code, __pyx_v_args, __pyx_v_kargs);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3epr_8EPRError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_code, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
  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("__init__", 0);

  /* "epr.pyx":456
 *         '''__init__(self, message='', code=None, *args, **kargs)'''
 * 
 *         super(EPRError, self).__init__(message, code, *args, **kargs)             # <<<<<<<<<<<<<<
 * 
 *         #: EPR API error code
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_message);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message);
  __Pyx_GIVEREF(__pyx_v_message);
  __Pyx_INCREF(__pyx_v_code);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_code);
  __Pyx_GIVEREF(__pyx_v_code);
  __pyx_t_3 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_v_kargs);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":459
 * 
 *         #: EPR API error code
 *         self.code = code             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__code, __pyx_v_code) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __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_AddTraceback("epr.EPRError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":466
 * 
 * 
 * cdef int pyepr_check_errors() except -1:             # <<<<<<<<<<<<<<
 *     cdef int code
 *     cdef char* msg
 */

static int __pyx_f_3epr_pyepr_check_errors(void) {
  int __pyx_v_code;
  char *__pyx_v_msg;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __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;
  PyObject *__pyx_t_9 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pyepr_check_errors", 0);

  /* "epr.pyx":469
 *     cdef int code
 *     cdef char* msg
 *     code = epr_get_last_err_code()             # <<<<<<<<<<<<<<
 *     if code != e_err_none:
 *         msg = <char*>epr_get_last_err_message()
 */
  __pyx_v_code = epr_get_last_err_code();

  /* "epr.pyx":470
 *     cdef char* msg
 *     code = epr_get_last_err_code()
 *     if code != e_err_none:             # <<<<<<<<<<<<<<
 *         msg = <char*>epr_get_last_err_message()
 * 
 */
  __pyx_t_1 = (__pyx_v_code != e_err_none);
  if (__pyx_t_1) {

    /* "epr.pyx":471
 *     code = epr_get_last_err_code()
 *     if code != e_err_none:
 *         msg = <char*>epr_get_last_err_message()             # <<<<<<<<<<<<<<
 * 
 *         # @TODO: if not msg: msg = EPR_ERR_MSG[code]
 */
    __pyx_v_msg = ((char *)epr_get_last_err_message());

    /* "epr.pyx":474
 * 
 *         # @TODO: if not msg: msg = EPR_ERR_MSG[code]
 *         if (e_err_invalid_product_id <= code <= e_err_invalid_keyword_name or             # <<<<<<<<<<<<<<
 *             code in (e_err_null_pointer,
 *                      e_err_illegal_arg,
 */
    __pyx_t_1 = (e_err_invalid_product_id <= ((enum EPR_ErrCode)__pyx_v_code));
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_code <= e_err_invalid_keyword_name);
    }
    if (!__pyx_t_1) {

      /* "epr.pyx":475
 *         # @TODO: if not msg: msg = EPR_ERR_MSG[code]
 *         if (e_err_invalid_product_id <= code <= e_err_invalid_keyword_name or
 *             code in (e_err_null_pointer,             # <<<<<<<<<<<<<<
 *                      e_err_illegal_arg,
 *                      e_err_index_out_of_range)):
 */
      __pyx_t_2 = __pyx_v_code;
      __pyx_t_3 = ((int)(__pyx_t_2 == e_err_null_pointer));
      if (!__pyx_t_3) {

        /* "epr.pyx":476
 *         if (e_err_invalid_product_id <= code <= e_err_invalid_keyword_name or
 *             code in (e_err_null_pointer,
 *                      e_err_illegal_arg,             # <<<<<<<<<<<<<<
 *                      e_err_index_out_of_range)):
 *             raise EPRValueError(_to_str(msg, 'ascii'), code)
 */
        __pyx_t_4 = ((int)(__pyx_t_2 == e_err_illegal_arg));
        __pyx_t_5 = __pyx_t_4;
      } else {
        __pyx_t_5 = __pyx_t_3;
      }
      if (!__pyx_t_5) {

        /* "epr.pyx":477
 *             code in (e_err_null_pointer,
 *                      e_err_illegal_arg,
 *                      e_err_index_out_of_range)):             # <<<<<<<<<<<<<<
 *             raise EPRValueError(_to_str(msg, 'ascii'), code)
 *         else:
 */
        __pyx_t_3 = ((int)(__pyx_t_2 == e_err_index_out_of_range));
        __pyx_t_4 = __pyx_t_3;
      } else {
        __pyx_t_4 = __pyx_t_5;
      }
      __pyx_t_5 = __pyx_t_4;
      __pyx_t_4 = __pyx_t_5;
    } else {
      __pyx_t_4 = __pyx_t_1;
    }
    if (__pyx_t_4) {

      /* "epr.pyx":478
 *                      e_err_illegal_arg,
 *                      e_err_index_out_of_range)):
 *             raise EPRValueError(_to_str(msg, 'ascii'), code)             # <<<<<<<<<<<<<<
 *         else:
 *             raise EPRError(_to_str(msg, 'ascii'), code)
 */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRValueError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __pyx_t_8 = ((PyObject *)__pyx_n_s__ascii);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_10.__pyx_n = 1;
      __pyx_t_10.encoding = __pyx_t_8;
      __pyx_t_9 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_7), &__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyInt_FromLong(__pyx_v_code); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_9 = 0;
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    /*else*/ {

      /* "epr.pyx":480
 *             raise EPRValueError(_to_str(msg, 'ascii'), code)
 *         else:
 *             raise EPRError(_to_str(msg, 'ascii'), code)             # <<<<<<<<<<<<<<
 * 
 *         epr_clear_err()
 */
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRError); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __pyx_t_6 = ((PyObject *)__pyx_n_s__ascii);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_10.__pyx_n = 1;
      __pyx_t_10.encoding = __pyx_t_6;
      __pyx_t_9 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_7), &__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyInt_FromLong(__pyx_v_code); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_9 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":485
 *         return -1
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("epr.pyepr_check_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":488
 * 
 * 
 * cdef int pyepr_null_ptr_error(msg='null pointer') except -1:             # <<<<<<<<<<<<<<
 *     cdef int code
 *     cdef char* eprmsg = <char*>epr_get_last_err_message()
 */

static int __pyx_f_3epr_pyepr_null_ptr_error(struct __pyx_opt_args_3epr_pyepr_null_ptr_error *__pyx_optional_args) {
  PyObject *__pyx_v_msg = ((PyObject *)__pyx_kp_s_3);
  int __pyx_v_code;
  char *__pyx_v_eprmsg;
  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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pyepr_null_ptr_error", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_msg = __pyx_optional_args->msg;
    }
  }

  /* "epr.pyx":490
 * cdef int pyepr_null_ptr_error(msg='null pointer') except -1:
 *     cdef int code
 *     cdef char* eprmsg = <char*>epr_get_last_err_message()             # <<<<<<<<<<<<<<
 * 
 *     code = epr_get_last_err_code()
 */
  __pyx_v_eprmsg = ((char *)epr_get_last_err_message());

  /* "epr.pyx":492
 *     cdef char* eprmsg = <char*>epr_get_last_err_message()
 * 
 *     code = epr_get_last_err_code()             # <<<<<<<<<<<<<<
 *     if not code:
 *         code = None
 */
  __pyx_v_code = epr_get_last_err_code();

  /* "epr.pyx":493
 * 
 *     code = epr_get_last_err_code()
 *     if not code:             # <<<<<<<<<<<<<<
 *         code = None
 * 
 */
  __pyx_t_1 = (!__pyx_v_code);
  if (__pyx_t_1) {

    /* "epr.pyx":494
 *     code = epr_get_last_err_code()
 *     if not code:
 *         code = None             # <<<<<<<<<<<<<<
 * 
 *     raise EPRValueError('%s: %s' % (msg, _to_str(eprmsg, 'ascii')), code=code)
 */
    __pyx_t_2 = __Pyx_PyInt_AsInt(Py_None); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_code = __pyx_t_2;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":496
 *         code = None
 * 
 *     raise EPRValueError('%s: %s' % (msg, _to_str(eprmsg, 'ascii')), code=code)             # <<<<<<<<<<<<<<
 * 
 *     epr_clear_err()
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRValueError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyBytes_FromString(__pyx_v_eprmsg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.encoding = __pyx_t_5;
  __pyx_t_6 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_4), &__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_msg);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg);
  __Pyx_GIVEREF(__pyx_v_msg);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_4 = PyInt_FromLong(__pyx_v_code); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__code), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __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_AddTraceback("epr.pyepr_null_ptr_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":503
 * 
 * 
 * cdef FILE* pyepr_get_file_stream(object ostream) except NULL:             # <<<<<<<<<<<<<<
 *     cdef FILE* fstream
 *     cdef int fileno
 */

static FILE *__pyx_f_3epr_pyepr_get_file_stream(PyObject *__pyx_v_ostream) {
  FILE *__pyx_v_fstream;
  int __pyx_v_fileno;
  PyObject *__pyx_v_e = NULL;
  FILE *__pyx_r;
  __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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pyepr_get_file_stream", 0);
  __Pyx_INCREF(__pyx_v_ostream);

  /* "epr.pyx":507
 *     cdef int fileno
 * 
 *     if ostream is None:             # <<<<<<<<<<<<<<
 *         ostream = sys.stdout
 * 
 */
  __pyx_t_1 = (__pyx_v_ostream == Py_None);
  if (__pyx_t_1) {

    /* "epr.pyx":508
 * 
 *     if ostream is None:
 *         ostream = sys.stdout             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_ostream);
    __pyx_v_ostream = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":510
 *         ostream = sys.stdout
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         ostream.flush()
 *     except AttributeError, e:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "epr.pyx":511
 * 
 *     try:
 *         ostream.flush()             # <<<<<<<<<<<<<<
 *     except AttributeError, e:
 *         raise TypeError(str(e))
 */
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_ostream, __pyx_n_s__flush); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "epr.pyx":512
 *     try:
 *         ostream.flush()
 *     except AttributeError, e:             # <<<<<<<<<<<<<<
 *         raise TypeError(str(e))
 *         return NULL
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("epr.pyepr_get_file_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_e = __pyx_t_3;

      /* "epr.pyx":513
 *         ostream.flush()
 *     except AttributeError, e:
 *         raise TypeError(str(e))             # <<<<<<<<<<<<<<
 *         return NULL
 * 
 */
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_e);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_e);
      __Pyx_GIVEREF(__pyx_v_e);
      __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L5_exception_handled;
    }
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_L11_try_end:;
  }

  /* "epr.pyx":516
 *         return NULL
 * 
 *     fileno = PyObject_AsFileDescriptor(ostream)             # <<<<<<<<<<<<<<
 *     if fileno == -1:
 *         raise TypeError('bad output stream')
 */
  __pyx_t_7 = PyObject_AsFileDescriptor(__pyx_v_ostream); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fileno = __pyx_t_7;

  /* "epr.pyx":517
 * 
 *     fileno = PyObject_AsFileDescriptor(ostream)
 *     if fileno == -1:             # <<<<<<<<<<<<<<
 *         raise TypeError('bad output stream')
 *         return NULL
 */
  __pyx_t_1 = (__pyx_v_fileno == -1);
  if (__pyx_t_1) {

    /* "epr.pyx":518
 *     fileno = PyObject_AsFileDescriptor(ostream)
 *     if fileno == -1:
 *         raise TypeError('bad output stream')             # <<<<<<<<<<<<<<
 *         return NULL
 * 
 */
    __pyx_t_8 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "epr.pyx":521
 *         return NULL
 * 
 *     fstream = fdopen(fileno, 'w')             # <<<<<<<<<<<<<<
 *     if fstream is NULL:
 *         raise TypeError('invalid ostream')
 */
  __pyx_v_fstream = fdopen(__pyx_v_fileno, __pyx_k__w);

  /* "epr.pyx":522
 * 
 *     fstream = fdopen(fileno, 'w')
 *     if fstream is NULL:             # <<<<<<<<<<<<<<
 *         raise TypeError('invalid ostream')
 * 
 */
  __pyx_t_1 = (__pyx_v_fstream == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":523
 *     fstream = fdopen(fileno, 'w')
 *     if fstream is NULL:
 *         raise TypeError('invalid ostream')             # <<<<<<<<<<<<<<
 * 
 *     return fstream
 */
    __pyx_t_8 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L15;
  }
  __pyx_L15:;

  /* "epr.pyx":525
 *         raise TypeError('invalid ostream')
 * 
 *     return fstream             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_fstream;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("epr.pyepr_get_file_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_ostream);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_3epr_5_CLib_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3epr_5_CLib_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_3epr_5_CLib___cinit__(((struct __pyx_obj_3epr__CLib *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":535
 *     '''
 * 
 *     def __cinit__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef bytes msg
 * 
 */

static int __pyx_pf_3epr_5_CLib___cinit__(CYTHON_UNUSED struct __pyx_obj_3epr__CLib *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_msg = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "epr.pyx":544
 * 
 *         #if epr_init_api(e_log_warning, epr_log_message, NULL):
 *         if epr_init_api(e_log_warning, NULL, NULL):             # <<<<<<<<<<<<<<
 *             msg = <char*>epr_get_last_err_message()
 *             epr_clear_err()
 */
  __pyx_t_1 = epr_init_api(e_log_warning, NULL, NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":545
 *         #if epr_init_api(e_log_warning, epr_log_message, NULL):
 *         if epr_init_api(e_log_warning, NULL, NULL):
 *             msg = <char*>epr_get_last_err_message()             # <<<<<<<<<<<<<<
 *             epr_clear_err()
 *             raise ImportError('unable to inizialize EPR API library: '
 */
    __pyx_t_2 = PyBytes_FromString(((char *)epr_get_last_err_message())); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_v_msg = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "epr.pyx":546
 *         if epr_init_api(e_log_warning, NULL, NULL):
 *             msg = <char*>epr_get_last_err_message()
 *             epr_clear_err()             # <<<<<<<<<<<<<<
 *             raise ImportError('unable to inizialize EPR API library: '
 *                               '%s' % _to_str(msg, 'ascii'))
 */
    epr_clear_err();

    /* "epr.pyx":548
 *             epr_clear_err()
 *             raise ImportError('unable to inizialize EPR API library: '
 *                               '%s' % _to_str(msg, 'ascii'))             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.encoding = __pyx_t_2;
    __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_v_msg), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ImportError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__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_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr._CLib.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_3epr_5_CLib_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_3epr_5_CLib_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_3epr_5_CLib_2__dealloc__(((struct __pyx_obj_3epr__CLib *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "epr.pyx":550
 *                               '%s' % _to_str(msg, 'ascii'))
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         epr_close_api()
 * 
 */

static void __pyx_pf_3epr_5_CLib_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_3epr__CLib *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "epr.pyx":551
 * 
 *     def __dealloc__(self):
 *         epr_close_api()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  epr_close_api();

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static int __pyx_pw_3epr_5_CLib_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3epr_5_CLib_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_3epr_5_CLib_4__init__(((struct __pyx_obj_3epr__CLib *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":553
 *         epr_close_api()
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError('"%s" class cannot be instantiated from Python' %
 *                                                     self.__class__.__name__)
 */

static int __pyx_pf_3epr_5_CLib_4__init__(struct __pyx_obj_3epr__CLib *__pyx_v_self) {
  int __pyx_r;
  __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("__init__", 0);

  /* "epr.pyx":555
 *     def __init__(self):
 *         raise TypeError('"%s" class cannot be instantiated from Python' %
 *                                                     self.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr._CLib.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_3epr_9EprObject_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3epr_9EprObject_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_ars = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
  __pyx_v_kargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_ars = __pyx_args;
  __pyx_r = __pyx_pf_3epr_9EprObject___cinit__(((struct __pyx_obj_3epr_EprObject *)__pyx_v_self), __pyx_v_ars, __pyx_v_kargs);
  __Pyx_XDECREF(__pyx_v_ars);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":565
 *     cdef object epr_c_lib
 * 
 *     def __cinit__(self, *ars, **kargs):             # <<<<<<<<<<<<<<
 *         self.epr_c_lib = _EPR_C_LIB
 * 
 */

static int __pyx_pf_3epr_9EprObject___cinit__(struct __pyx_obj_3epr_EprObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_ars, CYTHON_UNUSED PyObject *__pyx_v_kargs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "epr.pyx":566
 * 
 *     def __cinit__(self, *ars, **kargs):
 *         self.epr_c_lib = _EPR_C_LIB             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GOTREF(__pyx_v_self->epr_c_lib);
  __Pyx_DECREF(__pyx_v_self->epr_c_lib);
  __pyx_v_self->epr_c_lib = ((PyObject *)__pyx_v_3epr__EPR_C_LIB);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_3epr_9EprObject_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_3epr_9EprObject_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_3epr_9EprObject_2__dealloc__(((struct __pyx_obj_3epr_EprObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "epr.pyx":568
 *         self.epr_c_lib = _EPR_C_LIB
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.epr_c_lib = None
 * 
 */

static void __pyx_pf_3epr_9EprObject_2__dealloc__(struct __pyx_obj_3epr_EprObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "epr.pyx":569
 * 
 *     def __dealloc__(self):
 *         self.epr_c_lib = None             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->epr_c_lib);
  __Pyx_DECREF(__pyx_v_self->epr_c_lib);
  __pyx_v_self->epr_c_lib = Py_None;

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static int __pyx_pw_3epr_9EprObject_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3epr_9EprObject_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_3epr_9EprObject_4__init__(((struct __pyx_obj_3epr_EprObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":571
 *         self.epr_c_lib = None
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError('"%s" class cannot be instantiated from Python' %
 *                                                     self.__class__.__name__)
 */

static int __pyx_pf_3epr_9EprObject_4__init__(struct __pyx_obj_3epr_EprObject *__pyx_v_self) {
  int __pyx_r;
  __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("__init__", 0);

  /* "epr.pyx":573
 *     def __init__(self):
 *         raise TypeError('"%s" class cannot be instantiated from Python' %
 *                                                     self.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.EprObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_1get_data_type_size(PyObject *__pyx_self, PyObject *__pyx_arg_type_id); /*proto*/
static char __pyx_doc_3epr_get_data_type_size[] = "get_data_type_size(type_id)\n\n    Gets the size in bytes for an element of the given data type\n\n    ";
static PyMethodDef __pyx_mdef_3epr_1get_data_type_size = {__Pyx_NAMESTR("get_data_type_size"), (PyCFunction)__pyx_pw_3epr_1get_data_type_size, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_get_data_type_size)};
static PyObject *__pyx_pw_3epr_1get_data_type_size(PyObject *__pyx_self, PyObject *__pyx_arg_type_id) {
  EPR_EDataTypeId __pyx_v_type_id;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data_type_size (wrapper)", 0);
  assert(__pyx_arg_type_id); {
    __pyx_v_type_id = ((EPR_EDataTypeId)PyInt_AsLong(__pyx_arg_type_id)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.get_data_type_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_get_data_type_size(__pyx_self, ((EPR_EDataTypeId)__pyx_v_type_id));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":576
 * 
 * 
 * def get_data_type_size(EPR_EDataTypeId type_id):             # <<<<<<<<<<<<<<
 *     '''get_data_type_size(type_id)
 * 
 */

static PyObject *__pyx_pf_3epr_get_data_type_size(CYTHON_UNUSED PyObject *__pyx_self, EPR_EDataTypeId __pyx_v_type_id) {
  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_data_type_size", 0);

  /* "epr.pyx":583
 *     '''
 * 
 *     return epr_get_data_type_size(type_id)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_data_type_size(__pyx_v_type_id)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.get_data_type_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3data_type_id_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_type_id); /*proto*/
static char __pyx_doc_3epr_2data_type_id_to_str[] = "data_type_id_to_str(type_id)\n\n    Gets the 'C' data type string for the given data type\n\n    ";
static PyMethodDef __pyx_mdef_3epr_3data_type_id_to_str = {__Pyx_NAMESTR("data_type_id_to_str"), (PyCFunction)__pyx_pw_3epr_3data_type_id_to_str, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_2data_type_id_to_str)};
static PyObject *__pyx_pw_3epr_3data_type_id_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_type_id) {
  EPR_EDataTypeId __pyx_v_type_id;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("data_type_id_to_str (wrapper)", 0);
  assert(__pyx_arg_type_id); {
    __pyx_v_type_id = ((EPR_EDataTypeId)PyInt_AsLong(__pyx_arg_type_id)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.data_type_id_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_2data_type_id_to_str(__pyx_self, ((EPR_EDataTypeId)__pyx_v_type_id));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":586
 * 
 * 
 * def data_type_id_to_str(EPR_EDataTypeId type_id):             # <<<<<<<<<<<<<<
 *     '''data_type_id_to_str(type_id)
 * 
 */

static PyObject *__pyx_pf_3epr_2data_type_id_to_str(CYTHON_UNUSED PyObject *__pyx_self, EPR_EDataTypeId __pyx_v_type_id) {
  char *__pyx_v_type_id_str;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("data_type_id_to_str", 0);

  /* "epr.pyx":593
 *     '''
 * 
 *     cdef char* type_id_str = <char*>epr_data_type_id_to_str(type_id)             # <<<<<<<<<<<<<<
 * 
 *     return _to_str(type_id_str, 'ascii')
 */
  __pyx_v_type_id_str = ((char *)epr_data_type_id_to_str(__pyx_v_type_id));

  /* "epr.pyx":595
 *     cdef char* type_id_str = <char*>epr_data_type_id_to_str(type_id)
 * 
 *     return _to_str(type_id_str, 'ascii')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_type_id_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.encoding = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_1), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__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;

  __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("epr.data_type_id_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5get_scaling_method_name(PyObject *__pyx_self, PyObject *__pyx_v_method); /*proto*/
static char __pyx_doc_3epr_4get_scaling_method_name[] = "get_scaling_method_name(method)\n\n    Return the name of the specified scaling method\n\n    ";
static PyMethodDef __pyx_mdef_3epr_5get_scaling_method_name = {__Pyx_NAMESTR("get_scaling_method_name"), (PyCFunction)__pyx_pw_3epr_5get_scaling_method_name, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_4get_scaling_method_name)};
static PyObject *__pyx_pw_3epr_5get_scaling_method_name(PyObject *__pyx_self, PyObject *__pyx_v_method) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_scaling_method_name (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4get_scaling_method_name(__pyx_self, ((PyObject *)__pyx_v_method));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":598
 * 
 * 
 * def get_scaling_method_name(method):             # <<<<<<<<<<<<<<
 *     '''get_scaling_method_name(method)
 * 
 */

static PyObject *__pyx_pf_3epr_4get_scaling_method_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_method) {
  PyObject *__pyx_v_mmap = 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 = NULL;
  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("get_scaling_method_name", 0);

  /* "epr.pyx":605
 *     '''
 * 
 *     mmap = {             # <<<<<<<<<<<<<<
 *         E_SMID_NON: 'NONE',
 *         E_SMID_LIN: 'LIN',
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "epr.pyx":606
 * 
 *     mmap = {
 *         E_SMID_NON: 'NONE',             # <<<<<<<<<<<<<<
 *         E_SMID_LIN: 'LIN',
 *         E_SMID_LOG: 'LOG',
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMID_NON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__NONE)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":607
 *     mmap = {
 *         E_SMID_NON: 'NONE',
 *         E_SMID_LIN: 'LIN',             # <<<<<<<<<<<<<<
 *         E_SMID_LOG: 'LOG',
 *     }
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMID_LIN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__LIN)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":608
 *         E_SMID_NON: 'NONE',
 *         E_SMID_LIN: 'LIN',
 *         E_SMID_LOG: 'LOG',             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMID_LOG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__LOG)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_mmap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "epr.pyx":611
 *     }
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         return mmap[method]
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "epr.pyx":612
 * 
 *     try:
 *         return mmap[method]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError('invalid scaling method: "%s"' % method)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_mmap), __pyx_v_method); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "epr.pyx":613
 *     try:
 *         return mmap[method]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError('invalid scaling method: "%s"' % method)
 * 
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("epr.get_scaling_method_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);

      /* "epr.pyx":614
 *         return mmap[method]
 *     except KeyError:
 *         raise ValueError('invalid scaling method: "%s"' % method)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_v_method); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L10_try_end:;
  }

  __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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("epr.get_scaling_method_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mmap);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7get_sample_model_name(PyObject *__pyx_self, PyObject *__pyx_v_model); /*proto*/
static char __pyx_doc_3epr_6get_sample_model_name[] = "get_sample_model_name(model)\n\n    Return the name of the specified sample model\n\n    ";
static PyMethodDef __pyx_mdef_3epr_7get_sample_model_name = {__Pyx_NAMESTR("get_sample_model_name"), (PyCFunction)__pyx_pw_3epr_7get_sample_model_name, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_6get_sample_model_name)};
static PyObject *__pyx_pw_3epr_7get_sample_model_name(PyObject *__pyx_self, PyObject *__pyx_v_model) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_sample_model_name (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6get_sample_model_name(__pyx_self, ((PyObject *)__pyx_v_model));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":617
 * 
 * 
 * def get_sample_model_name(model):             # <<<<<<<<<<<<<<
 *     '''get_sample_model_name(model)
 * 
 */

static PyObject *__pyx_pf_3epr_6get_sample_model_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_model) {
  PyObject *__pyx_v_mmap = 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 = NULL;
  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("get_sample_model_name", 0);

  /* "epr.pyx":624
 *     '''
 * 
 *     mmap = {             # <<<<<<<<<<<<<<
 *         E_SMOD_1OF1: '1OF1',
 *         E_SMOD_1OF2: '1OF2',
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "epr.pyx":625
 * 
 *     mmap = {
 *         E_SMOD_1OF1: '1OF1',             # <<<<<<<<<<<<<<
 *         E_SMOD_1OF2: '1OF2',
 *         E_SMOD_2OF2: '2OF2',
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_1OF1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__1OF1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":626
 *     mmap = {
 *         E_SMOD_1OF1: '1OF1',
 *         E_SMOD_1OF2: '1OF2',             # <<<<<<<<<<<<<<
 *         E_SMOD_2OF2: '2OF2',
 *         E_SMOD_3TOI: '3TOI',
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_1OF2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__1OF2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":627
 *         E_SMOD_1OF1: '1OF1',
 *         E_SMOD_1OF2: '1OF2',
 *         E_SMOD_2OF2: '2OF2',             # <<<<<<<<<<<<<<
 *         E_SMOD_3TOI: '3TOI',
 *         E_SMOD_2TOF: '2TOF',
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_2OF2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__2OF2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":628
 *         E_SMOD_1OF2: '1OF2',
 *         E_SMOD_2OF2: '2OF2',
 *         E_SMOD_3TOI: '3TOI',             # <<<<<<<<<<<<<<
 *         E_SMOD_2TOF: '2TOF',
 *     }
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_3TOI); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__3TOI)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":629
 *         E_SMOD_2OF2: '2OF2',
 *         E_SMOD_3TOI: '3TOI',
 *         E_SMOD_2TOF: '2TOF',             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_2TOF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__2TOF)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_mmap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "epr.pyx":632
 *     }
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         return mmap[model]
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "epr.pyx":633
 * 
 *     try:
 *         return mmap[model]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError('invalid sample model: "%s"' % model)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_mmap), __pyx_v_model); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "epr.pyx":634
 *     try:
 *         return mmap[model]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError('invalid sample model: "%s"' % model)
 * 
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("epr.get_sample_model_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);

      /* "epr.pyx":635
 *         return mmap[model]
 *     except KeyError:
 *         raise ValueError('invalid sample model: "%s"' % model)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_v_model); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L10_try_end:;
  }

  __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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("epr.get_sample_model_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mmap);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_5index_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_5index_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_5index___get__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":652
 *         '''The index of this DSD (zero-based)'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.index
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_5index___get__(struct __pyx_obj_3epr_DSD *__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);

  /* "epr.pyx":653
 * 
 *         def __get__(self):
 *             return self._ptr.index             # <<<<<<<<<<<<<<
 * 
 *     property ds_name:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_ptr->index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_7ds_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_7ds_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_7ds_name___get__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":658
 *         '''The dataset name'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _to_str(self._ptr.ds_name, 'ascii')
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_7ds_name___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":659
 * 
 *         def __get__(self):
 *             return _to_str(self._ptr.ds_name, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     property ds_type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_ptr->ds_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.encoding = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_1), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__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;

  __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("epr.DSD.ds_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_7ds_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_7ds_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_7ds_type___get__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":664
 *         '''The dataset type descriptor'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _to_str(self._ptr.ds_type, 'ascii')
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_7ds_type___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":665
 * 
 *         def __get__(self):
 *             return _to_str(self._ptr.ds_type, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     property filename:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_ptr->ds_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.encoding = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_1), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__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;

  __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("epr.DSD.ds_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_8filename_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_8filename_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_8filename___get__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":670
 *         '''The filename in the DDDB with the description of this dataset'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _to_str(self._ptr.filename, 'ascii')
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_8filename___get__(struct __pyx_obj_3epr_DSD *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":671
 * 
 *         def __get__(self):
 *             return _to_str(self._ptr.filename, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     property ds_offset:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_ptr->filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.encoding = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_1), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__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;

  __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("epr.DSD.filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_9ds_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_9ds_offset_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_9ds_offset___get__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":676
 *         '''The offset of dataset-information the product file'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.ds_offset
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_9ds_offset___get__(struct __pyx_obj_3epr_DSD *__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);

  /* "epr.pyx":677
 * 
 *         def __get__(self):
 *             return self._ptr.ds_offset             # <<<<<<<<<<<<<<
 * 
 *     property ds_size:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->ds_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.ds_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_7ds_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_7ds_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_7ds_size___get__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":682
 *         '''The size of dataset-information in dataset product file'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.ds_size
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_7ds_size___get__(struct __pyx_obj_3epr_DSD *__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);

  /* "epr.pyx":683
 * 
 *         def __get__(self):
 *             return self._ptr.ds_size             # <<<<<<<<<<<<<<
 * 
 *     property num_dsr:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->ds_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.ds_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_7num_dsr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_7num_dsr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_7num_dsr___get__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":688
 *         '''The number of dataset records for the given dataset name'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.num_dsr
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_7num_dsr___get__(struct __pyx_obj_3epr_DSD *__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);

  /* "epr.pyx":689
 * 
 *         def __get__(self):
 *             return self._ptr.num_dsr             # <<<<<<<<<<<<<<
 * 
 *     property dsr_size:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->num_dsr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.num_dsr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_8dsr_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_8dsr_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_8dsr_size___get__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":694
 *         '''The size of dataset record for the given dataset name'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.dsr_size
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_8dsr_size___get__(struct __pyx_obj_3epr_DSD *__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);

  /* "epr.pyx":695
 * 
 *         def __get__(self):
 *             return self._ptr.dsr_size             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->dsr_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.dsr_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD___repr__(((struct __pyx_obj_3epr_DSD *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":698
 * 
 *     # --- high level interface ------------------------------------------------
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.DSD("%s")' % self.ds_name
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD___repr__(struct __pyx_obj_3epr_DSD *__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);

  /* "epr.pyx":699
 *     # --- high level interface ------------------------------------------------
 *     def __repr__(self):
 *         return 'epr.DSD("%s")' % self.ds_name             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(self, other, int op):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__ds_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.DSD.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_3DSD_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_3epr_3DSD_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_3DSD_2__richcmp__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":701
 *         return 'epr.DSD("%s")' % self.ds_name
 * 
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 *         cdef EPR_SDSD* p1 = (<DSD>self)._ptr
 *         cdef EPR_SDSD* p2 = (<DSD>other)._ptr
 */

static PyObject *__pyx_pf_3epr_3DSD_2__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  EPR_SDSD *__pyx_v_p1;
  EPR_SDSD *__pyx_v_p2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  EPR_SDSD *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "epr.pyx":702
 * 
 *     def __richcmp__(self, other, int op):
 *         cdef EPR_SDSD* p1 = (<DSD>self)._ptr             # <<<<<<<<<<<<<<
 *         cdef EPR_SDSD* p2 = (<DSD>other)._ptr
 * 
 */
  __pyx_t_1 = ((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr;
  __pyx_v_p1 = __pyx_t_1;

  /* "epr.pyx":703
 *     def __richcmp__(self, other, int op):
 *         cdef EPR_SDSD* p1 = (<DSD>self)._ptr
 *         cdef EPR_SDSD* p2 = (<DSD>other)._ptr             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self, DSD) and isinstance(other, DSD):
 */
  __pyx_t_1 = ((struct __pyx_obj_3epr_DSD *)__pyx_v_other)->_ptr;
  __pyx_v_p2 = __pyx_t_1;

  /* "epr.pyx":705
 *         cdef EPR_SDSD* p2 = (<DSD>other)._ptr
 * 
 *         if isinstance(self, DSD) and isinstance(other, DSD):             # <<<<<<<<<<<<<<
 *             if op == 2:         # eq
 *                 if p1 == p2:
 */
  __pyx_t_2 = ((PyObject *)((PyObject*)__pyx_ptype_3epr_DSD));
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_self, __pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_2 = ((PyObject *)((PyObject*)__pyx_ptype_3epr_DSD));
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_other, __pyx_t_2); 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "epr.pyx":719
 *                         (cstring.strcmp(p1.filename, p2.filename) == 0))
 * 
 *             elif op == 3:       # ne             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return False
 */
    switch (__pyx_v_op) {

      /* "epr.pyx":706
 * 
 *         if isinstance(self, DSD) and isinstance(other, DSD):
 *             if op == 2:         # eq             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return True
 */
      case 2:

      /* "epr.pyx":707
 *         if isinstance(self, DSD) and isinstance(other, DSD):
 *             if op == 2:         # eq
 *                 if p1 == p2:             # <<<<<<<<<<<<<<
 *                     return True
 * 
 */
      __pyx_t_5 = (__pyx_v_p1 == __pyx_v_p2);
      if (__pyx_t_5) {

        /* "epr.pyx":708
 *             if op == 2:         # eq
 *                 if p1 == p2:
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *                 return ((p1.index == p2.index) and
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L4;
      }
      __pyx_L4:;

      /* "epr.pyx":710
 *                     return True
 * 
 *                 return ((p1.index == p2.index) and             # <<<<<<<<<<<<<<
 *                         (p1.ds_offset == p2.ds_offset) and
 *                         (p1.ds_size == p2.ds_size) and
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = (__pyx_v_p1->index == __pyx_v_p2->index);
      if (__pyx_t_5) {

        /* "epr.pyx":711
 * 
 *                 return ((p1.index == p2.index) and
 *                         (p1.ds_offset == p2.ds_offset) and             # <<<<<<<<<<<<<<
 *                         (p1.ds_size == p2.ds_size) and
 *                         (p1.num_dsr == p2.num_dsr) and
 */
        __pyx_t_3 = (__pyx_v_p1->ds_offset == __pyx_v_p2->ds_offset);
        if (__pyx_t_3) {

          /* "epr.pyx":712
 *                 return ((p1.index == p2.index) and
 *                         (p1.ds_offset == p2.ds_offset) and
 *                         (p1.ds_size == p2.ds_size) and             # <<<<<<<<<<<<<<
 *                         (p1.num_dsr == p2.num_dsr) and
 *                         (p1.dsr_size == p2.dsr_size)and
 */
          __pyx_t_4 = (__pyx_v_p1->ds_size == __pyx_v_p2->ds_size);
          if (__pyx_t_4) {

            /* "epr.pyx":713
 *                         (p1.ds_offset == p2.ds_offset) and
 *                         (p1.ds_size == p2.ds_size) and
 *                         (p1.num_dsr == p2.num_dsr) and             # <<<<<<<<<<<<<<
 *                         (p1.dsr_size == p2.dsr_size)and
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) == 0) and
 */
            __pyx_t_6 = (__pyx_v_p1->num_dsr == __pyx_v_p2->num_dsr);
            if (__pyx_t_6) {

              /* "epr.pyx":714
 *                         (p1.ds_size == p2.ds_size) and
 *                         (p1.num_dsr == p2.num_dsr) and
 *                         (p1.dsr_size == p2.dsr_size)and             # <<<<<<<<<<<<<<
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) == 0) and
 *                         (cstring.strcmp(p1.ds_type, p2.ds_type) == 0) and
 */
              __pyx_t_7 = (__pyx_v_p1->dsr_size == __pyx_v_p2->dsr_size);
              if (__pyx_t_7) {

                /* "epr.pyx":715
 *                         (p1.num_dsr == p2.num_dsr) and
 *                         (p1.dsr_size == p2.dsr_size)and
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) == 0) and             # <<<<<<<<<<<<<<
 *                         (cstring.strcmp(p1.ds_type, p2.ds_type) == 0) and
 *                         (cstring.strcmp(p1.filename, p2.filename) == 0))
 */
                __pyx_t_8 = (strcmp(__pyx_v_p1->ds_name, __pyx_v_p2->ds_name) == 0);
                if (__pyx_t_8) {

                  /* "epr.pyx":716
 *                         (p1.dsr_size == p2.dsr_size)and
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) == 0) and
 *                         (cstring.strcmp(p1.ds_type, p2.ds_type) == 0) and             # <<<<<<<<<<<<<<
 *                         (cstring.strcmp(p1.filename, p2.filename) == 0))
 * 
 */
                  __pyx_t_9 = (strcmp(__pyx_v_p1->ds_type, __pyx_v_p2->ds_type) == 0);
                  if (__pyx_t_9) {

                    /* "epr.pyx":717
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) == 0) and
 *                         (cstring.strcmp(p1.ds_type, p2.ds_type) == 0) and
 *                         (cstring.strcmp(p1.filename, p2.filename) == 0))             # <<<<<<<<<<<<<<
 * 
 *             elif op == 3:       # ne
 */
                    __pyx_t_10 = (strcmp(__pyx_v_p1->filename, __pyx_v_p2->filename) == 0);
                    __pyx_t_11 = __pyx_t_10;
                  } else {
                    __pyx_t_11 = __pyx_t_9;
                  }
                  __pyx_t_9 = __pyx_t_11;
                } else {
                  __pyx_t_9 = __pyx_t_8;
                }
                __pyx_t_8 = __pyx_t_9;
              } else {
                __pyx_t_8 = __pyx_t_7;
              }
              __pyx_t_7 = __pyx_t_8;
            } else {
              __pyx_t_7 = __pyx_t_6;
            }
            __pyx_t_6 = __pyx_t_7;
          } else {
            __pyx_t_6 = __pyx_t_4;
          }
          __pyx_t_4 = __pyx_t_6;
        } else {
          __pyx_t_4 = __pyx_t_3;
        }
        __pyx_t_3 = __pyx_t_4;
      } else {
        __pyx_t_3 = __pyx_t_5;
      }
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      break;

      /* "epr.pyx":719
 *                         (cstring.strcmp(p1.filename, p2.filename) == 0))
 * 
 *             elif op == 3:       # ne             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return False
 */
      case 3:

      /* "epr.pyx":720
 * 
 *             elif op == 3:       # ne
 *                 if p1 == p2:             # <<<<<<<<<<<<<<
 *                     return False
 * 
 */
      __pyx_t_3 = (__pyx_v_p1 == __pyx_v_p2);
      if (__pyx_t_3) {

        /* "epr.pyx":721
 *             elif op == 3:       # ne
 *                 if p1 == p2:
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 return ((p1.index != p2.index) or
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L5;
      }
      __pyx_L5:;

      /* "epr.pyx":723
 *                     return False
 * 
 *                 return ((p1.index != p2.index) or             # <<<<<<<<<<<<<<
 *                         (p1.ds_offset != p2.ds_offset) or
 *                         (p1.ds_size != p2.ds_size) or
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = (__pyx_v_p1->index != __pyx_v_p2->index);
      if (!__pyx_t_3) {

        /* "epr.pyx":724
 * 
 *                 return ((p1.index != p2.index) or
 *                         (p1.ds_offset != p2.ds_offset) or             # <<<<<<<<<<<<<<
 *                         (p1.ds_size != p2.ds_size) or
 *                         (p1.num_dsr != p2.num_dsr) or
 */
        __pyx_t_5 = (__pyx_v_p1->ds_offset != __pyx_v_p2->ds_offset);
        if (!__pyx_t_5) {

          /* "epr.pyx":725
 *                 return ((p1.index != p2.index) or
 *                         (p1.ds_offset != p2.ds_offset) or
 *                         (p1.ds_size != p2.ds_size) or             # <<<<<<<<<<<<<<
 *                         (p1.num_dsr != p2.num_dsr) or
 *                         (p1.dsr_size != p2.dsr_size) or
 */
          __pyx_t_4 = (__pyx_v_p1->ds_size != __pyx_v_p2->ds_size);
          if (!__pyx_t_4) {

            /* "epr.pyx":726
 *                         (p1.ds_offset != p2.ds_offset) or
 *                         (p1.ds_size != p2.ds_size) or
 *                         (p1.num_dsr != p2.num_dsr) or             # <<<<<<<<<<<<<<
 *                         (p1.dsr_size != p2.dsr_size) or
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) != 0) or
 */
            __pyx_t_6 = (__pyx_v_p1->num_dsr != __pyx_v_p2->num_dsr);
            if (!__pyx_t_6) {

              /* "epr.pyx":727
 *                         (p1.ds_size != p2.ds_size) or
 *                         (p1.num_dsr != p2.num_dsr) or
 *                         (p1.dsr_size != p2.dsr_size) or             # <<<<<<<<<<<<<<
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) != 0) or
 *                         (cstring.strcmp(p1.ds_type, p2.ds_type) != 0) or
 */
              __pyx_t_7 = (__pyx_v_p1->dsr_size != __pyx_v_p2->dsr_size);
              if (!__pyx_t_7) {

                /* "epr.pyx":728
 *                         (p1.num_dsr != p2.num_dsr) or
 *                         (p1.dsr_size != p2.dsr_size) or
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) != 0) or             # <<<<<<<<<<<<<<
 *                         (cstring.strcmp(p1.ds_type, p2.ds_type) != 0) or
 *                         (cstring.strcmp(p1.filename, p2.filename) != 0))
 */
                __pyx_t_8 = (strcmp(__pyx_v_p1->ds_name, __pyx_v_p2->ds_name) != 0);
                if (!__pyx_t_8) {

                  /* "epr.pyx":729
 *                         (p1.dsr_size != p2.dsr_size) or
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) != 0) or
 *                         (cstring.strcmp(p1.ds_type, p2.ds_type) != 0) or             # <<<<<<<<<<<<<<
 *                         (cstring.strcmp(p1.filename, p2.filename) != 0))
 * 
 */
                  __pyx_t_9 = (strcmp(__pyx_v_p1->ds_type, __pyx_v_p2->ds_type) != 0);
                  if (!__pyx_t_9) {

                    /* "epr.pyx":730
 *                         (cstring.strcmp(p1.ds_name, p2.ds_name) != 0) or
 *                         (cstring.strcmp(p1.ds_type, p2.ds_type) != 0) or
 *                         (cstring.strcmp(p1.filename, p2.filename) != 0))             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
                    __pyx_t_11 = (strcmp(__pyx_v_p1->filename, __pyx_v_p2->filename) != 0);
                    __pyx_t_10 = __pyx_t_11;
                  } else {
                    __pyx_t_10 = __pyx_t_9;
                  }
                  __pyx_t_9 = __pyx_t_10;
                } else {
                  __pyx_t_9 = __pyx_t_8;
                }
                __pyx_t_8 = __pyx_t_9;
              } else {
                __pyx_t_8 = __pyx_t_7;
              }
              __pyx_t_7 = __pyx_t_8;
            } else {
              __pyx_t_7 = __pyx_t_6;
            }
            __pyx_t_6 = __pyx_t_7;
          } else {
            __pyx_t_6 = __pyx_t_4;
          }
          __pyx_t_4 = __pyx_t_6;
        } else {
          __pyx_t_4 = __pyx_t_5;
        }
        __pyx_t_5 = __pyx_t_4;
      } else {
        __pyx_t_5 = __pyx_t_3;
      }
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      break;
      default:

      /* "epr.pyx":733
 * 
 *             else:
 *                 raise TypeError('DSD only implements "==" and "!=" operators')             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":735
 *                 raise TypeError('DSD only implements "==" and "!=" operators')
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.DSD.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":738
 * 
 * 
 * cdef new_dsd(EPR_SDSD* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static PyObject *__pyx_f_3epr_new_dsd(EPR_SDSD *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_dsd *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_DSD *__pyx_v_instance = 0;
  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("new_dsd", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }

  /* "epr.pyx":739
 * 
 * cdef new_dsd(EPR_SDSD* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":740
 * cdef new_dsd(EPR_SDSD* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef DSD instance = DSD.__new__(DSD)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":742
 *         pyepr_null_ptr_error()
 * 
 *     cdef DSD instance = DSD.__new__(DSD)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_DSD)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr_DSD)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_DSD *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "epr.pyx":744
 *     cdef DSD instance = DSD.__new__(DSD)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 * 
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "epr.pyx":745
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "epr.pyx":747
 *     instance._parent = parent
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_dsd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_1print_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_5Field_print_[] = "print_(self, ostream=None)\n\n        Write the field to specified file (default: :data:`sys.stdout`)\n\n        This method writes formatted contents of the field to\n        specified *ostream* text file or (default) the ASCII output\n        is be printed to standard output (:data:`sys.stdout`)\n\n        :param ostream:\n            the (opened) output file object\n\n        .. note:: the *ostream* parameter have to be a *real* file not\n                  a generic stream object like\n                  :class:`StringIO.StringIO` instances\n\n        ";
static PyObject *__pyx_pw_3epr_5Field_1print_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ostream = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ostream,0};
    PyObject* values[1] = {0};

    /* "epr.pyx":763
 *     cdef object _parent
 * 
 *     def print_(self, ostream=None):             # <<<<<<<<<<<<<<
 *         '''print_(self, ostream=None)
 * 
 */
    values[0] = ((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);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ostream);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print_") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ostream = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Field.print_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_5Field_print_(((struct __pyx_obj_3epr_Field *)__pyx_v_self), __pyx_v_ostream);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3epr_5Field_print_(struct __pyx_obj_3epr_Field *__pyx_v_self, PyObject *__pyx_v_ostream) {
  FILE *__pyx_v_fstream;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  FILE *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_", 0);

  /* "epr.pyx":781
 *         '''
 * 
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_3epr_pyepr_get_file_stream(__pyx_v_ostream); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fstream = __pyx_t_1;

  /* "epr.pyx":783
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             epr_print_field(self._ptr, fstream)
 *             stdio.fflush(fstream)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "epr.pyx":784
 * 
 *         with nogil:
 *             epr_print_field(self._ptr, fstream)             # <<<<<<<<<<<<<<
 *             stdio.fflush(fstream)
 * 
 */
        epr_print_field(__pyx_v_self->_ptr, __pyx_v_fstream);

        /* "epr.pyx":785
 *         with nogil:
 *             epr_print_field(self._ptr, fstream)
 *             stdio.fflush(fstream)             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
        fflush(__pyx_v_fstream);
      }

      /* "epr.pyx":783
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             epr_print_field(self._ptr, fstream)
 *             stdio.fflush(fstream)
 */
      /*finally:*/ {
        Py_BLOCK_THREADS
      }
  }

  /* "epr.pyx":787
 *             stdio.fflush(fstream)
 * 
 *         pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     #def dump_field(self):
 */
  __pyx_t_2 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("epr.Field.print_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_3get_unit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_2get_unit[] = "get_unit(self)\n\n        Gets the unit of the field\n\n        ";
static PyObject *__pyx_pw_3epr_5Field_3get_unit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_unit (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_2get_unit(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":793
 *     #    pyepr_check_errors()
 * 
 *     def get_unit(self):             # <<<<<<<<<<<<<<
 *         '''get_unit(self)
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_2get_unit(struct __pyx_obj_3epr_Field *__pyx_v_self) {
  const char *__pyx_v_unit;
  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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_unit", 0);

  /* "epr.pyx":800
 *         '''
 * 
 *         cdef const_char* unit = epr_get_field_unit(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *         if unit is NULL:
 */
  __pyx_v_unit = epr_get_field_unit(__pyx_v_self->_ptr);

  /* "epr.pyx":802
 *         cdef const_char* unit = epr_get_field_unit(self._ptr)
 * 
 *         if unit is NULL:             # <<<<<<<<<<<<<<
 *             return ''
 *         else:
 */
  __pyx_t_1 = (__pyx_v_unit == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":803
 * 
 *         if unit is NULL:
 *             return ''             # <<<<<<<<<<<<<<
 *         else:
 *             return _to_str(<char*>unit, 'ascii')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
    __pyx_r = ((PyObject *)__pyx_kp_s_2);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":805
 *             return ''
 *         else:
 *             return _to_str(<char*>unit, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     def get_description(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(((char *)__pyx_v_unit)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __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("epr.Field.get_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_5get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_4get_description[] = "get_description(self)\n\n        Gets the description of the field\n\n        ";
static PyObject *__pyx_pw_3epr_5Field_5get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_description (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_4get_description(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":807
 *             return _to_str(<char*>unit, 'ascii')
 * 
 *     def get_description(self):             # <<<<<<<<<<<<<<
 *         '''get_description(self)
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_4get_description(struct __pyx_obj_3epr_Field *__pyx_v_self) {
  char *__pyx_v_description;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_description", 0);

  /* "epr.pyx":814
 *         '''
 * 
 *         cdef char* description = <char*>epr_get_field_description(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *         return _to_str(description, 'ascii')
 */
  __pyx_v_description = ((char *)epr_get_field_description(__pyx_v_self->_ptr));

  /* "epr.pyx":816
 *         cdef char* description = <char*>epr_get_field_description(self._ptr)
 * 
 *         return _to_str(description, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     def get_num_elems(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_description); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.encoding = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_1), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__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;

  __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("epr.Field.get_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_7get_num_elems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_6get_num_elems[] = "get_num_elems(self)\n\n        Gets the number of elements of the field\n\n        ";
static PyObject *__pyx_pw_3epr_5Field_7get_num_elems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_elems (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_6get_num_elems(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":818
 *         return _to_str(description, 'ascii')
 * 
 *     def get_num_elems(self):             # <<<<<<<<<<<<<<
 *         '''get_num_elems(self)
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_6get_num_elems(struct __pyx_obj_3epr_Field *__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_num_elems", 0);

  /* "epr.pyx":825
 *         '''
 * 
 *         return epr_get_field_num_elems(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_field_num_elems(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Field.get_num_elems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_9get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_8get_name[] = "get_name(self)\n\n        Gets the name of the field\n\n        ";
static PyObject *__pyx_pw_3epr_5Field_9get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_8get_name(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":827
 *         return epr_get_field_num_elems(self._ptr)
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         '''get_name(self)
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_8get_name(struct __pyx_obj_3epr_Field *__pyx_v_self) {
  char *__pyx_v_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_name", 0);

  /* "epr.pyx":834
 *         '''
 * 
 *         cdef char* name = <char*>epr_get_field_name(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *         return _to_str(name, 'ascii')
 */
  __pyx_v_name = ((char *)epr_get_field_name(__pyx_v_self->_ptr));

  /* "epr.pyx":836
 *         cdef char* name = <char*>epr_get_field_name(self._ptr)
 * 
 *         return _to_str(name, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     def get_type(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.encoding = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_1), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__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;

  __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("epr.Field.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_11get_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_10get_type[] = "get_type(self)\n\n        Gets the type of the field\n\n        ";
static PyObject *__pyx_pw_3epr_5Field_11get_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_type (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_10get_type(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":838
 *         return _to_str(name, 'ascii')
 * 
 *     def get_type(self):             # <<<<<<<<<<<<<<
 *         '''get_type(self)
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_10get_type(struct __pyx_obj_3epr_Field *__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_type", 0);

  /* "epr.pyx":845
 *         '''
 * 
 *         return epr_get_field_type(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_elem(self, uint index=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(epr_get_field_type(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Field.get_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_13get_elem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_5Field_12get_elem[] = "get_elem(self, index=0)\n\n        Field single element access\n\n        This function is for getting the elements of a field.\n\n        :param index:\n            the zero-based index of element to be returned, must not be\n            negative\n        :returns:\n            the typed value from given field\n\n        ";
static PyObject *__pyx_pw_3epr_5Field_13get_elem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_elem (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,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);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
          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_elem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_index = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_index = ((uint)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_elem", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Field.get_elem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_5Field_12get_elem(((struct __pyx_obj_3epr_Field *)__pyx_v_self), __pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":847
 *         return epr_get_field_type(self._ptr)
 * 
 *     def get_elem(self, uint index=0):             # <<<<<<<<<<<<<<
 *         '''get_elem(self, index=0)
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_12get_elem(struct __pyx_obj_3epr_Field *__pyx_v_self, uint __pyx_v_index) {
  EPR_STime *__pyx_v_eprtime;
  PyObject *__pyx_v_etype = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_elem", 0);

  /* "epr.pyx":863
 * 
 *         cdef EPR_STime* eprtime
 *         etype = epr_get_field_type(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *         if etype == e_tid_uchar:
 */
  __pyx_t_1 = PyInt_FromLong(epr_get_field_type(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_etype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "epr.pyx":865
 *         etype = epr_get_field_type(self._ptr)
 * 
 *         if etype == e_tid_uchar:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_uchar(self._ptr, index)
 *         elif etype == e_tid_char:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_uchar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":866
 * 
 *         if etype == e_tid_uchar:
 *             val = epr_get_field_elem_as_uchar(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_char:
 *             val = epr_get_field_elem_as_char(self._ptr, index)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uchar(epr_get_field_elem_as_uchar(__pyx_v_self->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":867
 *         if etype == e_tid_uchar:
 *             val = epr_get_field_elem_as_uchar(self._ptr, index)
 *         elif etype == e_tid_char:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_char(self._ptr, index)
 *         elif etype == e_tid_ushort:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":868
 *             val = epr_get_field_elem_as_uchar(self._ptr, index)
 *         elif etype == e_tid_char:
 *             val = epr_get_field_elem_as_char(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_ushort:
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)
 */
    __pyx_t_1 = PyInt_FromLong(epr_get_field_elem_as_char(__pyx_v_self->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_val = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":869
 *         elif etype == e_tid_char:
 *             val = epr_get_field_elem_as_char(self._ptr, index)
 *         elif etype == e_tid_ushort:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)
 *         elif etype == e_tid_short:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_ushort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":870
 *             val = epr_get_field_elem_as_char(self._ptr, index)
 *         elif etype == e_tid_ushort:
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_short:
 *             val = epr_get_field_elem_as_short(self._ptr, index)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_ushort(epr_get_field_elem_as_ushort(__pyx_v_self->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":871
 *         elif etype == e_tid_ushort:
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)
 *         elif etype == e_tid_short:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_short(self._ptr, index)
 *         elif etype == e_tid_uint:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_short); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":872
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)
 *         elif etype == e_tid_short:
 *             val = epr_get_field_elem_as_short(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_uint:
 *             val = epr_get_field_elem_as_uint(self._ptr, index)
 */
    __pyx_t_1 = PyInt_FromLong(epr_get_field_elem_as_short(__pyx_v_self->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_val = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":873
 *         elif etype == e_tid_short:
 *             val = epr_get_field_elem_as_short(self._ptr, index)
 *         elif etype == e_tid_uint:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_uint(self._ptr, index)
 *         elif etype == e_tid_int:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_uint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":874
 *             val = epr_get_field_elem_as_short(self._ptr, index)
 *         elif etype == e_tid_uint:
 *             val = epr_get_field_elem_as_uint(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_int:
 *             val = epr_get_field_elem_as_int(self._ptr, index)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(epr_get_field_elem_as_uint(__pyx_v_self->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":875
 *         elif etype == e_tid_uint:
 *             val = epr_get_field_elem_as_uint(self._ptr, index)
 *         elif etype == e_tid_int:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_int(self._ptr, index)
 *         elif etype == e_tid_float:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":876
 *             val = epr_get_field_elem_as_uint(self._ptr, index)
 *         elif etype == e_tid_int:
 *             val = epr_get_field_elem_as_int(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_float:
 *             val = epr_get_field_elem_as_float(self._ptr, index)
 */
    __pyx_t_1 = PyInt_FromLong(epr_get_field_elem_as_int(__pyx_v_self->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_val = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":877
 *         elif etype == e_tid_int:
 *             val = epr_get_field_elem_as_int(self._ptr, index)
 *         elif etype == e_tid_float:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_float(self._ptr, index)
 *         elif etype == e_tid_double:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_float); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":878
 *             val = epr_get_field_elem_as_int(self._ptr, index)
 *         elif etype == e_tid_float:
 *             val = epr_get_field_elem_as_float(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_double:
 *             val = epr_get_field_elem_as_double(self._ptr, index)
 */
    __pyx_t_2 = PyFloat_FromDouble(epr_get_field_elem_as_float(__pyx_v_self->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":879
 *         elif etype == e_tid_float:
 *             val = epr_get_field_elem_as_float(self._ptr, index)
 *         elif etype == e_tid_double:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_double(self._ptr, index)
 *         elif etype == e_tid_string:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":880
 *             val = epr_get_field_elem_as_float(self._ptr, index)
 *         elif etype == e_tid_double:
 *             val = epr_get_field_elem_as_double(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_string:
 *             if index != 0:
 */
    __pyx_t_1 = PyFloat_FromDouble(epr_get_field_elem_as_double(__pyx_v_self->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_val = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":881
 *         elif etype == e_tid_double:
 *             val = epr_get_field_elem_as_double(self._ptr, index)
 *         elif etype == e_tid_string:             # <<<<<<<<<<<<<<
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":882
 *             val = epr_get_field_elem_as_double(self._ptr, index)
 *         elif etype == e_tid_string:
 *             if index != 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('invalid index: %d' % index)
 *             val = <char*>epr_get_field_elem_as_str(self._ptr)
 */
    __pyx_t_3 = (__pyx_v_index != 0);
    if (__pyx_t_3) {

      /* "epr.pyx":883
 *         elif etype == e_tid_string:
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)             # <<<<<<<<<<<<<<
 *             val = <char*>epr_get_field_elem_as_str(self._ptr)
 *         #elif etype == e_tid_spare:
 */
      __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "epr.pyx":884
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)
 *             val = <char*>epr_get_field_elem_as_str(self._ptr)             # <<<<<<<<<<<<<<
 *         #elif etype == e_tid_spare:
 *         #    val = epr_get_field_elem_as_str(self._ptr)
 */
    __pyx_t_1 = PyBytes_FromString(((char *)epr_get_field_elem_as_str(__pyx_v_self->_ptr))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_v_val = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "epr.pyx":887
 *         #elif etype == e_tid_spare:
 *         #    val = epr_get_field_elem_as_str(self._ptr)
 *         elif etype == e_tid_time:             # <<<<<<<<<<<<<<
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":888
 *         #    val = epr_get_field_elem_as_str(self._ptr)
 *         elif etype == e_tid_time:
 *             if index != 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('invalid index: %d' % index)
 * 
 */
    __pyx_t_3 = (__pyx_v_index != 0);
    if (__pyx_t_3) {

      /* "epr.pyx":889
 *         elif etype == e_tid_time:
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)             # <<<<<<<<<<<<<<
 * 
 *             # use casting to silence warnings
 */
      __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "epr.pyx":892
 * 
 *             # use casting to silence warnings
 *             eprtime = <EPR_STime*>epr_get_field_elem_as_mjd(self._ptr)             # <<<<<<<<<<<<<<
 *             val = EPRTime(eprtime.days, eprtime.seconds, eprtime.microseconds)
 *         else:
 */
    __pyx_v_eprtime = ((EPR_STime *)epr_get_field_elem_as_mjd(__pyx_v_self->_ptr));

    /* "epr.pyx":893
 *             # use casting to silence warnings
 *             eprtime = <EPR_STime*>epr_get_field_elem_as_mjd(self._ptr)
 *             val = EPRTime(eprtime.days, eprtime.seconds, eprtime.microseconds)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('invalid field type')
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRTime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyInt_FromLong(__pyx_v_eprtime->days); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_eprtime->seconds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_eprtime->microseconds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":895
 *             val = EPRTime(eprtime.days, eprtime.seconds, eprtime.microseconds)
 *         else:
 *             raise ValueError('invalid field type')             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "epr.pyx":897
 *             raise ValueError('invalid field type')
 * 
 *         pyepr_check_errors()             # <<<<<<<<<<<<<<
 *         return val
 * 
 */
  __pyx_t_7 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":898
 * 
 *         pyepr_check_errors()
 *         return val             # <<<<<<<<<<<<<<
 * 
 *     def get_elems(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_val);
  __pyx_r = __pyx_v_val;
  goto __pyx_L0;

  __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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Field.get_elem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_etype);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_15get_elems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_14get_elems[] = "get_elems(self)\n\n        Field array element access\n\n        This function is for getting an array of field elements of the\n        field.\n\n        :returns:\n            the data array (:class:`numpy.ndarray`) having the type of\n            the field\n\n        ";
static PyObject *__pyx_pw_3epr_5Field_15get_elems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_elems (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_14get_elems(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":900
 *         return val
 * 
 *     def get_elems(self):             # <<<<<<<<<<<<<<
 *         '''get_elems(self)
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_14get_elems(struct __pyx_obj_3epr_Field *__pyx_v_self) {
  const void *__pyx_v_buf;
  size_t __pyx_v_num_elems;
  size_t __pyx_v_i;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_etype = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_elems", 0);

  /* "epr.pyx":920
 *         cdef np.ndarray out
 * 
 *         num_elems = epr_get_field_num_elems(self._ptr)             # <<<<<<<<<<<<<<
 *         etype = epr_get_field_type(self._ptr)
 *         msg = 'Filed("%s") elems pointer is null' % self.get_name()
 */
  __pyx_v_num_elems = epr_get_field_num_elems(__pyx_v_self->_ptr);

  /* "epr.pyx":921
 * 
 *         num_elems = epr_get_field_num_elems(self._ptr)
 *         etype = epr_get_field_type(self._ptr)             # <<<<<<<<<<<<<<
 *         msg = 'Filed("%s") elems pointer is null' % self.get_name()
 * 
 */
  __pyx_t_1 = PyInt_FromLong(epr_get_field_type(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_etype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "epr.pyx":922
 *         num_elems = epr_get_field_num_elems(self._ptr)
 *         etype = epr_get_field_type(self._ptr)
 *         msg = 'Filed("%s") elems pointer is null' % self.get_name()             # <<<<<<<<<<<<<<
 * 
 *         if etype == e_tid_uchar:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_msg = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "epr.pyx":924
 *         msg = 'Filed("%s") elems pointer is null' % self.get_name()
 * 
 *         if etype == e_tid_uchar:             # <<<<<<<<<<<<<<
 *             buf = <uchar*>epr_get_field_elems_uchar(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_uchar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":925
 * 
 *         if etype == e_tid_uchar:
 *             buf = <uchar*>epr_get_field_elems_uchar(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 */
    __pyx_v_buf = ((uchar *)epr_get_field_elems_uchar(__pyx_v_self->_ptr));

    /* "epr.pyx":926
 *         if etype == e_tid_uchar:
 *             buf = <uchar*>epr_get_field_elems_uchar(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.byte)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "epr.pyx":927
 *             buf = <uchar*>epr_get_field_elems_uchar(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.byte)
 *             for i in range(num_elems):
 */
      __pyx_t_5.__pyx_n = 1;
      __pyx_t_5.msg = __pyx_v_msg;
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "epr.pyx":928
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.byte)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<uchar*>buf)[i]
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__byte); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_2 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_out = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "epr.pyx":929
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.byte)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<uchar*>buf)[i]
 *         elif etype == e_tid_char:
 */
    __pyx_t_7 = __pyx_v_num_elems;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "epr.pyx":930
 *             out = np.ndarray(num_elems, np.byte)
 *             for i in range(num_elems):
 *                 out[i] = (<uchar*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_char:
 *             buf = <char*>epr_get_field_elems_char(self._ptr)
 */
      __pyx_t_6 = __Pyx_PyInt_to_py_uchar((((uchar *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_6, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    goto __pyx_L3;
  }

  /* "epr.pyx":931
 *             for i in range(num_elems):
 *                 out[i] = (<uchar*>buf)[i]
 *         elif etype == e_tid_char:             # <<<<<<<<<<<<<<
 *             buf = <char*>epr_get_field_elems_char(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_6 = PyInt_FromLong(e_tid_char); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":932
 *                 out[i] = (<uchar*>buf)[i]
 *         elif etype == e_tid_char:
 *             buf = <char*>epr_get_field_elems_char(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 */
    __pyx_v_buf = ((char *)epr_get_field_elems_char(__pyx_v_self->_ptr));

    /* "epr.pyx":933
 *         elif etype == e_tid_char:
 *             buf = <char*>epr_get_field_elems_char(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.byte)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "epr.pyx":934
 *             buf = <char*>epr_get_field_elems_char(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.byte)
 *             for i in range(num_elems):
 */
      __pyx_t_5.__pyx_n = 1;
      __pyx_t_5.msg = __pyx_v_msg;
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "epr.pyx":935
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.byte)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<char*>buf)[i]
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__byte); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "epr.pyx":936
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.byte)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<char*>buf)[i]
 *         elif etype == e_tid_ushort:
 */
    __pyx_t_7 = __pyx_v_num_elems;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "epr.pyx":937
 *             out = np.ndarray(num_elems, np.byte)
 *             for i in range(num_elems):
 *                 out[i] = (<char*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_ushort:
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)
 */
      __pyx_t_2 = PyInt_FromLong((((char *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_2, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    goto __pyx_L3;
  }

  /* "epr.pyx":938
 *             for i in range(num_elems):
 *                 out[i] = (<char*>buf)[i]
 *         elif etype == e_tid_ushort:             # <<<<<<<<<<<<<<
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_ushort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":939
 *                 out[i] = (<char*>buf)[i]
 *         elif etype == e_tid_ushort:
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 */
    __pyx_v_buf = ((ushort *)epr_get_field_elems_ushort(__pyx_v_self->_ptr));

    /* "epr.pyx":940
 *         elif etype == e_tid_ushort:
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.ushort)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "epr.pyx":941
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.ushort)
 *             for i in range(num_elems):
 */
      __pyx_t_5.__pyx_n = 1;
      __pyx_t_5.msg = __pyx_v_msg;
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "epr.pyx":942
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.ushort)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<ushort*>buf)[i]
 */
    __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ushort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_out = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "epr.pyx":943
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.ushort)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<ushort*>buf)[i]
 *         elif etype == e_tid_short:
 */
    __pyx_t_7 = __pyx_v_num_elems;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "epr.pyx":944
 *             out = np.ndarray(num_elems, np.ushort)
 *             for i in range(num_elems):
 *                 out[i] = (<ushort*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_short:
 *             buf = <short*>epr_get_field_elems_short(self._ptr)
 */
      __pyx_t_1 = __Pyx_PyInt_to_py_ushort((((ushort *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_1, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    goto __pyx_L3;
  }

  /* "epr.pyx":945
 *             for i in range(num_elems):
 *                 out[i] = (<ushort*>buf)[i]
 *         elif etype == e_tid_short:             # <<<<<<<<<<<<<<
 *             buf = <short*>epr_get_field_elems_short(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_short); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":946
 *                 out[i] = (<ushort*>buf)[i]
 *         elif etype == e_tid_short:
 *             buf = <short*>epr_get_field_elems_short(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 */
    __pyx_v_buf = ((short *)epr_get_field_elems_short(__pyx_v_self->_ptr));

    /* "epr.pyx":947
 *         elif etype == e_tid_short:
 *             buf = <short*>epr_get_field_elems_short(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.short)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "epr.pyx":948
 *             buf = <short*>epr_get_field_elems_short(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.short)
 *             for i in range(num_elems):
 */
      __pyx_t_5.__pyx_n = 1;
      __pyx_t_5.msg = __pyx_v_msg;
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "epr.pyx":949
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.short)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<short*>buf)[i]
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__short); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_2 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_out = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "epr.pyx":950
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.short)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<short*>buf)[i]
 *         elif etype == e_tid_uint:
 */
    __pyx_t_7 = __pyx_v_num_elems;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "epr.pyx":951
 *             out = np.ndarray(num_elems, np.short)
 *             for i in range(num_elems):
 *                 out[i] = (<short*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_uint:
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)
 */
      __pyx_t_6 = PyInt_FromLong((((short *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_6, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    goto __pyx_L3;
  }

  /* "epr.pyx":952
 *             for i in range(num_elems):
 *                 out[i] = (<short*>buf)[i]
 *         elif etype == e_tid_uint:             # <<<<<<<<<<<<<<
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_6 = PyInt_FromLong(e_tid_uint); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":953
 *                 out[i] = (<short*>buf)[i]
 *         elif etype == e_tid_uint:
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 */
    __pyx_v_buf = ((uint *)epr_get_field_elems_uint(__pyx_v_self->_ptr));

    /* "epr.pyx":954
 *         elif etype == e_tid_uint:
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.uint)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "epr.pyx":955
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.uint)
 *             for i in range(num_elems):
 */
      __pyx_t_5.__pyx_n = 1;
      __pyx_t_5.msg = __pyx_v_msg;
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "epr.pyx":956
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.uint)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<uint*>buf)[i]
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__uint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "epr.pyx":957
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.uint)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<uint*>buf)[i]
 *         elif etype == e_tid_int:
 */
    __pyx_t_7 = __pyx_v_num_elems;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "epr.pyx":958
 *             out = np.ndarray(num_elems, np.uint)
 *             for i in range(num_elems):
 *                 out[i] = (<uint*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_int:
 *             buf = <int*>epr_get_field_elems_int(self._ptr)
 */
      __pyx_t_2 = __Pyx_PyInt_to_py_uint((((uint *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_2, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    goto __pyx_L3;
  }

  /* "epr.pyx":959
 *             for i in range(num_elems):
 *                 out[i] = (<uint*>buf)[i]
 *         elif etype == e_tid_int:             # <<<<<<<<<<<<<<
 *             buf = <int*>epr_get_field_elems_int(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":960
 *                 out[i] = (<uint*>buf)[i]
 *         elif etype == e_tid_int:
 *             buf = <int*>epr_get_field_elems_int(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 */
    __pyx_v_buf = ((int *)epr_get_field_elems_int(__pyx_v_self->_ptr));

    /* "epr.pyx":961
 *         elif etype == e_tid_int:
 *             buf = <int*>epr_get_field_elems_int(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.int)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "epr.pyx":962
 *             buf = <int*>epr_get_field_elems_int(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.int)
 *             for i in range(num_elems):
 */
      __pyx_t_5.__pyx_n = 1;
      __pyx_t_5.msg = __pyx_v_msg;
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L19;
    }
    __pyx_L19:;

    /* "epr.pyx":963
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.int)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<int*>buf)[i]
 */
    __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_out = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "epr.pyx":964
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.int)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<int*>buf)[i]
 *         elif etype == e_tid_float:
 */
    __pyx_t_7 = __pyx_v_num_elems;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "epr.pyx":965
 *             out = np.ndarray(num_elems, np.int)
 *             for i in range(num_elems):
 *                 out[i] = (<int*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_float:
 *             buf = <float*>epr_get_field_elems_float(self._ptr)
 */
      __pyx_t_1 = PyInt_FromLong((((int *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_1, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    goto __pyx_L3;
  }

  /* "epr.pyx":966
 *             for i in range(num_elems):
 *                 out[i] = (<int*>buf)[i]
 *         elif etype == e_tid_float:             # <<<<<<<<<<<<<<
 *             buf = <float*>epr_get_field_elems_float(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_float); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":967
 *                 out[i] = (<int*>buf)[i]
 *         elif etype == e_tid_float:
 *             buf = <float*>epr_get_field_elems_float(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 */
    __pyx_v_buf = ((float *)epr_get_field_elems_float(__pyx_v_self->_ptr));

    /* "epr.pyx":968
 *         elif etype == e_tid_float:
 *             buf = <float*>epr_get_field_elems_float(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.float32)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "epr.pyx":969
 *             buf = <float*>epr_get_field_elems_float(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.float32)
 *             for i in range(num_elems):
 */
      __pyx_t_5.__pyx_n = 1;
      __pyx_t_5.msg = __pyx_v_msg;
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L22;
    }
    __pyx_L22:;

    /* "epr.pyx":970
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.float32)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<float*>buf)[i]
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_2 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_out = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "epr.pyx":971
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.float32)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<float*>buf)[i]
 *         elif etype == e_tid_double:
 */
    __pyx_t_7 = __pyx_v_num_elems;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "epr.pyx":972
 *             out = np.ndarray(num_elems, np.float32)
 *             for i in range(num_elems):
 *                 out[i] = (<float*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_double:
 *             buf = <double*>epr_get_field_elems_double(self._ptr)
 */
      __pyx_t_6 = PyFloat_FromDouble((((float *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_6, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    goto __pyx_L3;
  }

  /* "epr.pyx":973
 *             for i in range(num_elems):
 *                 out[i] = (<float*>buf)[i]
 *         elif etype == e_tid_double:             # <<<<<<<<<<<<<<
 *             buf = <double*>epr_get_field_elems_double(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_6 = PyInt_FromLong(e_tid_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "epr.pyx":974
 *                 out[i] = (<float*>buf)[i]
 *         elif etype == e_tid_double:
 *             buf = <double*>epr_get_field_elems_double(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 */
    __pyx_v_buf = ((double *)epr_get_field_elems_double(__pyx_v_self->_ptr));

    /* "epr.pyx":975
 *         elif etype == e_tid_double:
 *             buf = <double*>epr_get_field_elems_double(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.double)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "epr.pyx":976
 *             buf = <double*>epr_get_field_elems_double(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.double)
 *             for i in range(num_elems):
 */
      __pyx_t_5.__pyx_n = 1;
      __pyx_t_5.msg = __pyx_v_msg;
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L25;
    }
    __pyx_L25:;

    /* "epr.pyx":977
 *             if buf is NULL:
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.double)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<double*>buf)[i]
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "epr.pyx":978
 *                 pyepr_null_ptr_error(msg)
 *             out = np.ndarray(num_elems, np.double)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<double*>buf)[i]
 *         else:
 */
    __pyx_t_7 = __pyx_v_num_elems;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "epr.pyx":979
 *             out = np.ndarray(num_elems, np.double)
 *             for i in range(num_elems):
 *                 out[i] = (<double*>buf)[i]             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('invalid field type')
 */
      __pyx_t_2 = PyFloat_FromDouble((((double *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_2, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":981
 *                 out[i] = (<double*>buf)[i]
 *         else:
 *             raise ValueError('invalid field type')             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "epr.pyx":983
 *             raise ValueError('invalid field type')
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __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_6);
  __Pyx_AddTraceback("epr.Field.get_elems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_etype);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_17__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_5Field_17__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_16__repr__(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":986
 * 
 *     # --- high level interface ------------------------------------------------
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.Field("%s") %d %s elements' % (self.get_name(),
 *                     self.get_num_elems(), data_type_id_to_str(self.get_type()))
 */

static PyObject *__pyx_pf_3epr_5Field_16__repr__(struct __pyx_obj_3epr_Field *__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);

  /* "epr.pyx":987
 *     # --- high level interface ------------------------------------------------
 *     def __repr__(self):
 *         return 'epr.Field("%s") %d %s elements' % (self.get_name(),             # <<<<<<<<<<<<<<
 *                     self.get_num_elems(), data_type_id_to_str(self.get_type()))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":988
 *     def __repr__(self):
 *         return 'epr.Field("%s") %d %s elements' % (self.get_name(),
 *                     self.get_num_elems(), data_type_id_to_str(self.get_type()))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__data_type_id_to_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("epr.Field.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_19__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_5Field_19__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_18__str__(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":990
 *                     self.get_num_elems(), data_type_id_to_str(self.get_type()))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef EPR_DataTypeId type_ = self.get_type()
 *         if type_ == e_tid_string:
 */

static PyObject *__pyx_pf_3epr_5Field_18__str__(struct __pyx_obj_3epr_Field *__pyx_v_self) {
  enum EPR_DataTypeId __pyx_v_type_;
  PyObject *__pyx_v_days = NULL;
  PyObject *__pyx_v_seconds = NULL;
  PyObject *__pyx_v_microseconds = NULL;
  PyObject *__pyx_v_fmt = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  enum EPR_DataTypeId __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "epr.pyx":991
 * 
 *     def __str__(self):
 *         cdef EPR_DataTypeId type_ = self.get_type()             # <<<<<<<<<<<<<<
 *         if type_ == e_tid_string:
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((enum EPR_DataTypeId)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_type_ = __pyx_t_3;

  /* "epr.pyx":992
 *     def __str__(self):
 *         cdef EPR_DataTypeId type_ = self.get_type()
 *         if type_ == e_tid_string:             # <<<<<<<<<<<<<<
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())
 *         elif type_ == e_tid_time:
 */
  __pyx_t_4 = (__pyx_v_type_ == e_tid_string);
  if (__pyx_t_4) {

    /* "epr.pyx":993
 *         cdef EPR_DataTypeId type_ = self.get_type()
 *         if type_ == e_tid_string:
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())             # <<<<<<<<<<<<<<
 *         elif type_ == e_tid_time:
 *             days, seconds, microseconds = self.get_elem()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_elem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_r = ((PyObject *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "epr.pyx":994
 *         if type_ == e_tid_string:
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())
 *         elif type_ == e_tid_time:             # <<<<<<<<<<<<<<
 *             days, seconds, microseconds = self.get_elem()
 *             return '%s = {d=%d, j=%d, m=%d}' % (self.get_name(),
 */
  __pyx_t_4 = (__pyx_v_type_ == e_tid_time);
  if (__pyx_t_4) {

    /* "epr.pyx":995
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())
 *         elif type_ == e_tid_time:
 *             days, seconds, microseconds = self.get_elem()             # <<<<<<<<<<<<<<
 *             return '%s = {d=%d, j=%d, m=%d}' % (self.get_name(),
 *                                                 days, seconds, microseconds)
 */
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_elem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_days = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_seconds = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_microseconds = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "epr.pyx":996
 *         elif type_ == e_tid_time:
 *             days, seconds, microseconds = self.get_elem()
 *             return '%s = {d=%d, j=%d, m=%d}' % (self.get_name(),             # <<<<<<<<<<<<<<
 *                                                 days, seconds, microseconds)
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "epr.pyx":997
 *             days, seconds, microseconds = self.get_elem()
 *             return '%s = {d=%d, j=%d, m=%d}' % (self.get_name(),
 *                                                 days, seconds, microseconds)             # <<<<<<<<<<<<<<
 *         else:
 *             if type_ == e_tid_uchar:
 */
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_days);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_days);
    __Pyx_GIVEREF(__pyx_v_days);
    __Pyx_INCREF(__pyx_v_seconds);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_seconds);
    __Pyx_GIVEREF(__pyx_v_seconds);
    __Pyx_INCREF(__pyx_v_microseconds);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_microseconds);
    __Pyx_GIVEREF(__pyx_v_microseconds);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_r = ((PyObject *)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":999
 *                                                 days, seconds, microseconds)
 *         else:
 *             if type_ == e_tid_uchar:             # <<<<<<<<<<<<<<
 *                 fmt = '%u'
 *             elif type_ == e_tid_char:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_uchar);
    if (__pyx_t_4) {

      /* "epr.pyx":1000
 *         else:
 *             if type_ == e_tid_uchar:
 *                 fmt = '%u'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_char:
 *                 fmt = '%d'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_24));
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_24);
      goto __pyx_L6;
    }

    /* "epr.pyx":1001
 *             if type_ == e_tid_uchar:
 *                 fmt = '%u'
 *             elif type_ == e_tid_char:             # <<<<<<<<<<<<<<
 *                 fmt = '%d'
 *             elif type_ == e_tid_ushort:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_char);
    if (__pyx_t_4) {

      /* "epr.pyx":1002
 *                 fmt = '%u'
 *             elif type_ == e_tid_char:
 *                 fmt = '%d'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_ushort:
 *                 fmt = '%u'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_25);
      goto __pyx_L6;
    }

    /* "epr.pyx":1003
 *             elif type_ == e_tid_char:
 *                 fmt = '%d'
 *             elif type_ == e_tid_ushort:             # <<<<<<<<<<<<<<
 *                 fmt = '%u'
 *             elif type_ == e_tid_short:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_ushort);
    if (__pyx_t_4) {

      /* "epr.pyx":1004
 *                 fmt = '%d'
 *             elif type_ == e_tid_ushort:
 *                 fmt = '%u'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_short:
 *                 fmt = '%d'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_24));
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_24);
      goto __pyx_L6;
    }

    /* "epr.pyx":1005
 *             elif type_ == e_tid_ushort:
 *                 fmt = '%u'
 *             elif type_ == e_tid_short:             # <<<<<<<<<<<<<<
 *                 fmt = '%d'
 *             elif type_ == e_tid_uint:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_short);
    if (__pyx_t_4) {

      /* "epr.pyx":1006
 *                 fmt = '%u'
 *             elif type_ == e_tid_short:
 *                 fmt = '%d'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_uint:
 *                 fmt = '%u'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_25);
      goto __pyx_L6;
    }

    /* "epr.pyx":1007
 *             elif type_ == e_tid_short:
 *                 fmt = '%d'
 *             elif type_ == e_tid_uint:             # <<<<<<<<<<<<<<
 *                 fmt = '%u'
 *             elif type_ == e_tid_int:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_uint);
    if (__pyx_t_4) {

      /* "epr.pyx":1008
 *                 fmt = '%d'
 *             elif type_ == e_tid_uint:
 *                 fmt = '%u'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_int:
 *                 fmt = '%d'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_24));
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_24);
      goto __pyx_L6;
    }

    /* "epr.pyx":1009
 *             elif type_ == e_tid_uint:
 *                 fmt = '%u'
 *             elif type_ == e_tid_int:             # <<<<<<<<<<<<<<
 *                 fmt = '%d'
 *             elif type_ == e_tid_float:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_int);
    if (__pyx_t_4) {

      /* "epr.pyx":1010
 *                 fmt = '%u'
 *             elif type_ == e_tid_int:
 *                 fmt = '%d'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_float:
 *                 fmt = '%f'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_25);
      goto __pyx_L6;
    }

    /* "epr.pyx":1011
 *             elif type_ == e_tid_int:
 *                 fmt = '%d'
 *             elif type_ == e_tid_float:             # <<<<<<<<<<<<<<
 *                 fmt = '%f'
 *             elif type_ == e_tid_double:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_float);
    if (__pyx_t_4) {

      /* "epr.pyx":1012
 *                 fmt = '%d'
 *             elif type_ == e_tid_float:
 *                 fmt = '%f'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_double:
 *                 fmt = '%f'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_26));
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_26);
      goto __pyx_L6;
    }

    /* "epr.pyx":1013
 *             elif type_ == e_tid_float:
 *                 fmt = '%f'
 *             elif type_ == e_tid_double:             # <<<<<<<<<<<<<<
 *                 fmt = '%f'
 *             else:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_double);
    if (__pyx_t_4) {

      /* "epr.pyx":1014
 *                 fmt = '%f'
 *             elif type_ == e_tid_double:
 *                 fmt = '%f'             # <<<<<<<<<<<<<<
 *             else:
 *                 if self.get_num_elems() > 1:
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_26));
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_26);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "epr.pyx":1016
 *                 fmt = '%f'
 *             else:
 *                 if self.get_num_elems() > 1:             # <<<<<<<<<<<<<<
 *                     data = ['<<unknown data type>>'] * self.get_elems()
 *                     data = ', '.join(data)
 */
      __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_elems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_4) {

        /* "epr.pyx":1017
 *             else:
 *                 if self.get_num_elems() > 1:
 *                     data = ['<<unknown data type>>'] * self.get_elems()             # <<<<<<<<<<<<<<
 *                     data = ', '.join(data)
 *                     return '%s = {%s}' % (self.get_name(), data)
 */
        __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_elems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_27));
        PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_27));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27));
        { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_temp);
          __Pyx_DECREF(__pyx_t_6);
          __pyx_t_6 = __pyx_temp;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_data = ((PyObject *)__pyx_t_6);
        __pyx_t_6 = 0;

        /* "epr.pyx":1018
 *                 if self.get_num_elems() > 1:
 *                     data = ['<<unknown data type>>'] * self.get_elems()
 *                     data = ', '.join(data)             # <<<<<<<<<<<<<<
 *                     return '%s = {%s}' % (self.get_name(), data)
 *                 else:
 */
        __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_28), __pyx_n_s__join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_v_data);
        __pyx_v_data = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "epr.pyx":1019
 *                     data = ['<<unknown data type>>'] * self.get_elems()
 *                     data = ', '.join(data)
 *                     return '%s = {%s}' % (self.get_name(), data)             # <<<<<<<<<<<<<<
 *                 else:
 *                     return '%s = <<unknown data type>>' % (self.get_name())
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_29), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_r = ((PyObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "epr.pyx":1021
 *                     return '%s = {%s}' % (self.get_name(), data)
 *                 else:
 *                     return '%s = <<unknown data type>>' % (self.get_name())             # <<<<<<<<<<<<<<
 * 
 *             if self.get_num_elems() > 1:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_r = ((PyObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L0;
      }
      __pyx_L7:;
    }
    __pyx_L6:;

    /* "epr.pyx":1023
 *                     return '%s = <<unknown data type>>' % (self.get_name())
 * 
 *             if self.get_num_elems() > 1:             # <<<<<<<<<<<<<<
 *                 data = ', '.join([fmt % item for item in self.get_elems()])
 *                 return '%s = {%s}' % (self.get_name(), data)
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "epr.pyx":1024
 * 
 *             if self.get_num_elems() > 1:
 *                 data = ', '.join([fmt % item for item in self.get_elems()])             # <<<<<<<<<<<<<<
 *                 return '%s = {%s}' % (self.get_name(), data)
 *             else:
 */
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_28), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_elems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_6)) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_6)) {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_5 = __pyx_t_10(__pyx_t_6);
          if (unlikely(!__pyx_t_5)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF(__pyx_v_item);
        __pyx_v_item = __pyx_t_5;
        __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Remainder(__pyx_v_fmt, __pyx_v_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_v_data = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "epr.pyx":1025
 *             if self.get_num_elems() > 1:
 *                 data = ', '.join([fmt % item for item in self.get_elems()])
 *                 return '%s = {%s}' % (self.get_name(), data)             # <<<<<<<<<<<<<<
 *             else:
 *                 return '%s = %s' % (self.get_name(), fmt % self.get_elem())
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_29), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_r = ((PyObject *)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "epr.pyx":1027
 *                 return '%s = {%s}' % (self.get_name(), data)
 *             else:
 *                 return '%s = %s' % (self.get_name(), fmt % self.get_elem())             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(self, other, int op):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_elem); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Remainder(__pyx_v_fmt, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = ((PyObject *)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;
    }
    __pyx_L8:;
  }
  __pyx_L3:;

  __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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("epr.Field.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_days);
  __Pyx_XDECREF(__pyx_v_seconds);
  __Pyx_XDECREF(__pyx_v_microseconds);
  __Pyx_XDECREF(__pyx_v_fmt);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_5Field_21__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_3epr_5Field_21__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_20__richcmp__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1029
 *                 return '%s = %s' % (self.get_name(), fmt % self.get_elem())
 * 
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 *         cdef int ret
 *         cdef size_t n
 */

static PyObject *__pyx_pf_3epr_5Field_20__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  size_t __pyx_v_n;
  EPR_SField *__pyx_v_p1;
  EPR_SField *__pyx_v_p2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  EPR_SField *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "epr.pyx":1032
 *         cdef int ret
 *         cdef size_t n
 *         cdef EPR_SField* p1 = (<Field>self)._ptr             # <<<<<<<<<<<<<<
 *         cdef EPR_SField* p2 = (<Field>other)._ptr
 * 
 */
  __pyx_t_1 = ((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr;
  __pyx_v_p1 = __pyx_t_1;

  /* "epr.pyx":1033
 *         cdef size_t n
 *         cdef EPR_SField* p1 = (<Field>self)._ptr
 *         cdef EPR_SField* p2 = (<Field>other)._ptr             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self, Field) and isinstance(other, Field):
 */
  __pyx_t_1 = ((struct __pyx_obj_3epr_Field *)__pyx_v_other)->_ptr;
  __pyx_v_p2 = __pyx_t_1;

  /* "epr.pyx":1035
 *         cdef EPR_SField* p2 = (<Field>other)._ptr
 * 
 *         if isinstance(self, Field) and isinstance(other, Field):             # <<<<<<<<<<<<<<
 *             if op == 2:         # eq
 *                 if p1 == p2:
 */
  __pyx_t_2 = ((PyObject *)((PyObject*)__pyx_ptype_3epr_Field));
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_self, __pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_2 = ((PyObject *)((PyObject*)__pyx_ptype_3epr_Field));
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_other, __pyx_t_2); 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "epr.pyx":1066
 *                 return (cstring.memcmp(p1.elems, p2.elems, n) == 0)
 * 
 *             elif op == 3:       # ne             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return False
 */
    switch (__pyx_v_op) {

      /* "epr.pyx":1036
 * 
 *         if isinstance(self, Field) and isinstance(other, Field):
 *             if op == 2:         # eq             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return True
 */
      case 2:

      /* "epr.pyx":1037
 *         if isinstance(self, Field) and isinstance(other, Field):
 *             if op == 2:         # eq
 *                 if p1 == p2:             # <<<<<<<<<<<<<<
 *                     return True
 * 
 */
      __pyx_t_5 = (__pyx_v_p1 == __pyx_v_p2);
      if (__pyx_t_5) {

        /* "epr.pyx":1038
 *             if op == 2:         # eq
 *                 if p1 == p2:
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *                 if ((epr_get_field_num_elems(p1) !=
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L4;
      }
      __pyx_L4:;

      /* "epr.pyx":1041
 * 
 *                 if ((epr_get_field_num_elems(p1) !=
 *                             epr_get_field_num_elems(p2)) or             # <<<<<<<<<<<<<<
 * 
 *                     (epr_get_field_type(p1) != epr_get_field_type(p2)) or
 */
      __pyx_t_5 = (epr_get_field_num_elems(__pyx_v_p1) != epr_get_field_num_elems(__pyx_v_p2));
      if (!__pyx_t_5) {

        /* "epr.pyx":1043
 *                             epr_get_field_num_elems(p2)) or
 * 
 *                     (epr_get_field_type(p1) != epr_get_field_type(p2)) or             # <<<<<<<<<<<<<<
 * 
 *                     (cstring.strcmp(epr_get_field_unit(p1),
 */
        __pyx_t_3 = (epr_get_field_type(__pyx_v_p1) != epr_get_field_type(__pyx_v_p2));
        if (!__pyx_t_3) {

          /* "epr.pyx":1046
 * 
 *                     (cstring.strcmp(epr_get_field_unit(p1),
 *                                     epr_get_field_unit(p2)) != 0) or             # <<<<<<<<<<<<<<
 * 
 *                     (cstring.strcmp(epr_get_field_description(p1),
 */
          __pyx_t_4 = (strcmp(epr_get_field_unit(__pyx_v_p1), epr_get_field_unit(__pyx_v_p2)) != 0);
          if (!__pyx_t_4) {

            /* "epr.pyx":1049
 * 
 *                     (cstring.strcmp(epr_get_field_description(p1),
 *                                     epr_get_field_description(p2)) != 0) or             # <<<<<<<<<<<<<<
 * 
 *                     (cstring.strcmp(epr_get_field_name(p1),
 */
            __pyx_t_6 = (strcmp(epr_get_field_description(__pyx_v_p1), epr_get_field_description(__pyx_v_p2)) != 0);
            if (!__pyx_t_6) {

              /* "epr.pyx":1052
 * 
 *                     (cstring.strcmp(epr_get_field_name(p1),
 *                                     epr_get_field_name(p2)) != 0)):             # <<<<<<<<<<<<<<
 * 
 *                     return False
 */
              __pyx_t_7 = (strcmp(epr_get_field_name(__pyx_v_p1), epr_get_field_name(__pyx_v_p2)) != 0);
              __pyx_t_8 = __pyx_t_7;
            } else {
              __pyx_t_8 = __pyx_t_6;
            }
            __pyx_t_6 = __pyx_t_8;
          } else {
            __pyx_t_6 = __pyx_t_4;
          }
          __pyx_t_4 = __pyx_t_6;
        } else {
          __pyx_t_4 = __pyx_t_3;
        }
        __pyx_t_3 = __pyx_t_4;
      } else {
        __pyx_t_3 = __pyx_t_5;
      }
      if (__pyx_t_3) {

        /* "epr.pyx":1054
 *                                     epr_get_field_name(p2)) != 0)):
 * 
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L5;
      }
      __pyx_L5:;

      /* "epr.pyx":1056
 *                     return False
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))             # <<<<<<<<<<<<<<
 *                 if n != 0:
 *                     n *= epr_get_field_num_elems(p1)
 */
      __pyx_v_n = epr_get_data_type_size(epr_get_field_type(__pyx_v_p1));

      /* "epr.pyx":1057
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 *                 if n != 0:             # <<<<<<<<<<<<<<
 *                     n *= epr_get_field_num_elems(p1)
 *                 #pyepr_check_errors()
 */
      __pyx_t_3 = (__pyx_v_n != 0);
      if (__pyx_t_3) {

        /* "epr.pyx":1058
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 *                 if n != 0:
 *                     n *= epr_get_field_num_elems(p1)             # <<<<<<<<<<<<<<
 *                 #pyepr_check_errors()
 *                 if n <= 0:
 */
        __pyx_v_n = (__pyx_v_n * epr_get_field_num_elems(__pyx_v_p1));
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "epr.pyx":1060
 *                     n *= epr_get_field_num_elems(p1)
 *                 #pyepr_check_errors()
 *                 if n <= 0:             # <<<<<<<<<<<<<<
 *                     # @TODO: check
 *                     return True
 */
      __pyx_t_3 = (__pyx_v_n <= 0);
      if (__pyx_t_3) {

        /* "epr.pyx":1062
 *                 if n <= 0:
 *                     # @TODO: check
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *                 return (cstring.memcmp(p1.elems, p2.elems, n) == 0)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "epr.pyx":1064
 *                     return True
 * 
 *                 return (cstring.memcmp(p1.elems, p2.elems, n) == 0)             # <<<<<<<<<<<<<<
 * 
 *             elif op == 3:       # ne
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_p1->elems, __pyx_v_p2->elems, __pyx_v_n) == 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      break;

      /* "epr.pyx":1066
 *                 return (cstring.memcmp(p1.elems, p2.elems, n) == 0)
 * 
 *             elif op == 3:       # ne             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return False
 */
      case 3:

      /* "epr.pyx":1067
 * 
 *             elif op == 3:       # ne
 *                 if p1 == p2:             # <<<<<<<<<<<<<<
 *                     return False
 * 
 */
      __pyx_t_3 = (__pyx_v_p1 == __pyx_v_p2);
      if (__pyx_t_3) {

        /* "epr.pyx":1068
 *             elif op == 3:       # ne
 *                 if p1 == p2:
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 if ((epr_get_field_num_elems(p1) !=
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "epr.pyx":1071
 * 
 *                 if ((epr_get_field_num_elems(p1) !=
 *                             epr_get_field_num_elems(p2)) or             # <<<<<<<<<<<<<<
 * 
 *                     (epr_get_field_type(p1) != epr_get_field_type(p2)) or
 */
      __pyx_t_3 = (epr_get_field_num_elems(__pyx_v_p1) != epr_get_field_num_elems(__pyx_v_p2));
      if (!__pyx_t_3) {

        /* "epr.pyx":1073
 *                             epr_get_field_num_elems(p2)) or
 * 
 *                     (epr_get_field_type(p1) != epr_get_field_type(p2)) or             # <<<<<<<<<<<<<<
 * 
 *                     (cstring.strcmp(epr_get_field_unit(p1),
 */
        __pyx_t_5 = (epr_get_field_type(__pyx_v_p1) != epr_get_field_type(__pyx_v_p2));
        if (!__pyx_t_5) {

          /* "epr.pyx":1076
 * 
 *                     (cstring.strcmp(epr_get_field_unit(p1),
 *                                     epr_get_field_unit(p2)) != 0) or             # <<<<<<<<<<<<<<
 * 
 *                     (cstring.strcmp(epr_get_field_description(p1),
 */
          __pyx_t_4 = (strcmp(epr_get_field_unit(__pyx_v_p1), epr_get_field_unit(__pyx_v_p2)) != 0);
          if (!__pyx_t_4) {

            /* "epr.pyx":1079
 * 
 *                     (cstring.strcmp(epr_get_field_description(p1),
 *                                     epr_get_field_description(p2)) != 0) or             # <<<<<<<<<<<<<<
 * 
 *                     (cstring.strcmp(epr_get_field_name(p1),
 */
            __pyx_t_6 = (strcmp(epr_get_field_description(__pyx_v_p1), epr_get_field_description(__pyx_v_p2)) != 0);
            if (!__pyx_t_6) {

              /* "epr.pyx":1082
 * 
 *                     (cstring.strcmp(epr_get_field_name(p1),
 *                                     epr_get_field_name(p2)) != 0)):             # <<<<<<<<<<<<<<
 * 
 *                     return True
 */
              __pyx_t_8 = (strcmp(epr_get_field_name(__pyx_v_p1), epr_get_field_name(__pyx_v_p2)) != 0);
              __pyx_t_7 = __pyx_t_8;
            } else {
              __pyx_t_7 = __pyx_t_6;
            }
            __pyx_t_6 = __pyx_t_7;
          } else {
            __pyx_t_6 = __pyx_t_4;
          }
          __pyx_t_4 = __pyx_t_6;
        } else {
          __pyx_t_4 = __pyx_t_5;
        }
        __pyx_t_5 = __pyx_t_4;
      } else {
        __pyx_t_5 = __pyx_t_3;
      }
      if (__pyx_t_5) {

        /* "epr.pyx":1084
 *                                     epr_get_field_name(p2)) != 0)):
 * 
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L9;
      }
      __pyx_L9:;

      /* "epr.pyx":1086
 *                     return True
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))             # <<<<<<<<<<<<<<
 *                 if n != 0:
 *                     n *= epr_get_field_num_elems(p1)
 */
      __pyx_v_n = epr_get_data_type_size(epr_get_field_type(__pyx_v_p1));

      /* "epr.pyx":1087
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 *                 if n != 0:             # <<<<<<<<<<<<<<
 *                     n *= epr_get_field_num_elems(p1)
 *                 #pyepr_check_errors()
 */
      __pyx_t_5 = (__pyx_v_n != 0);
      if (__pyx_t_5) {

        /* "epr.pyx":1088
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 *                 if n != 0:
 *                     n *= epr_get_field_num_elems(p1)             # <<<<<<<<<<<<<<
 *                 #pyepr_check_errors()
 *                 if n <= 0:
 */
        __pyx_v_n = (__pyx_v_n * epr_get_field_num_elems(__pyx_v_p1));
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "epr.pyx":1090
 *                     n *= epr_get_field_num_elems(p1)
 *                 #pyepr_check_errors()
 *                 if n <= 0:             # <<<<<<<<<<<<<<
 *                     # @TODO: check
 *                     return False
 */
      __pyx_t_5 = (__pyx_v_n <= 0);
      if (__pyx_t_5) {

        /* "epr.pyx":1092
 *                 if n <= 0:
 *                     # @TODO: check
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 return (cstring.memcmp(p1.elems, p2.elems, n) != 0)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "epr.pyx":1094
 *                     return False
 * 
 *                 return (cstring.memcmp(p1.elems, p2.elems, n) != 0)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_p1->elems, __pyx_v_p2->elems, __pyx_v_n) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      break;
      default:

      /* "epr.pyx":1097
 * 
 *             else:
 *                 raise TypeError('Field only implements "==" and '             # <<<<<<<<<<<<<<
 *                                 '"!=" operators')
 *         else:
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":1100
 *                                 '"!=" operators')
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Field.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static Py_ssize_t __pyx_pw_3epr_5Field_23__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_3epr_5Field_23__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_5Field_22__len__(((struct __pyx_obj_3epr_Field *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1102
 *             return NotImplemented
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if epr_get_field_type(self._ptr) == e_tid_string:
 *             return cstring.strlen(epr_get_field_elem_as_str(self._ptr))
 */

static Py_ssize_t __pyx_pf_3epr_5Field_22__len__(struct __pyx_obj_3epr_Field *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "epr.pyx":1103
 * 
 *     def __len__(self):
 *         if epr_get_field_type(self._ptr) == e_tid_string:             # <<<<<<<<<<<<<<
 *             return cstring.strlen(epr_get_field_elem_as_str(self._ptr))
 *         else:
 */
  __pyx_t_1 = (epr_get_field_type(__pyx_v_self->_ptr) == e_tid_string);
  if (__pyx_t_1) {

    /* "epr.pyx":1104
 *     def __len__(self):
 *         if epr_get_field_type(self._ptr) == e_tid_string:
 *             return cstring.strlen(epr_get_field_elem_as_str(self._ptr))             # <<<<<<<<<<<<<<
 *         else:
 *             return epr_get_field_num_elems(self._ptr)
 */
    __pyx_r = strlen(epr_get_field_elem_as_str(__pyx_v_self->_ptr));
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":1106
 *             return cstring.strlen(epr_get_field_elem_as_str(self._ptr))
 *         else:
 *             return epr_get_field_num_elems(self._ptr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = epr_get_field_num_elems(__pyx_v_self->_ptr);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1109
 * 
 * 
 * cdef new_field(EPR_SField* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static PyObject *__pyx_f_3epr_new_field(EPR_SField *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_field *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_Field *__pyx_v_instance = 0;
  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("new_field", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }

  /* "epr.pyx":1110
 * 
 * cdef new_field(EPR_SField* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1111
 * cdef new_field(EPR_SField* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Field instance = Field.__new__(Field)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1113
 *         pyepr_null_ptr_error()
 * 
 *     cdef Field instance = Field.__new__(Field)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Field)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr_Field)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Field *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "epr.pyx":1115
 *     cdef Field instance = Field.__new__(Field)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 * 
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "epr.pyx":1116
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "epr.pyx":1118
 *     instance._parent = parent
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_3epr_6Record_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_3epr_6Record_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_3epr_6Record___dealloc__(((struct __pyx_obj_3epr_Record *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "epr.pyx":1134
 *     cdef bint _dealloc
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if not self._dealloc:
 *             return
 */

static void __pyx_pf_3epr_6Record___dealloc__(struct __pyx_obj_3epr_Record *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "epr.pyx":1135
 * 
 *     def __dealloc__(self):
 *         if not self._dealloc:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = (!__pyx_v_self->_dealloc);
  if (__pyx_t_1) {

    /* "epr.pyx":1136
 *     def __dealloc__(self):
 *         if not self._dealloc:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if self._ptr is not NULL:
 */
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1138
 *             return
 * 
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             epr_free_record(self._ptr)
 *             pyepr_check_errors()
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1139
 * 
 *         if self._ptr is not NULL:
 *             epr_free_record(self._ptr)             # <<<<<<<<<<<<<<
 *             pyepr_check_errors()
 * 
 */
    epr_free_record(__pyx_v_self->_ptr);

    /* "epr.pyx":1140
 *         if self._ptr is not NULL:
 *             epr_free_record(self._ptr)
 *             pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     def get_num_fields(self):
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("epr.Record.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_3get_num_fields(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Record_2get_num_fields[] = "get_num_fields(self)\n\n        Gets the number of fields contained in the record\n\n        ";
static PyObject *__pyx_pw_3epr_6Record_3get_num_fields(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_fields (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Record_2get_num_fields(((struct __pyx_obj_3epr_Record *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1142
 *             pyepr_check_errors()
 * 
 *     def get_num_fields(self):             # <<<<<<<<<<<<<<
 *         '''get_num_fields(self)
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_2get_num_fields(struct __pyx_obj_3epr_Record *__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_num_fields", 0);

  /* "epr.pyx":1149
 *         '''
 * 
 *         return epr_get_num_fields(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def print_(self, ostream=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_num_fields(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Record.get_num_fields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_5print_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_6Record_4print_[] = "print_(self, ostream=None)\n\n        Write the record to specified file\n\n        This method writes formatted contents of the record to\n        specified *ostream* text file or (default) the ASCII output\n        is be printed to standard output (:data:`sys.stdout`)\n\n        :param ostream:\n            the (opened) output file object\n\n        .. note:: the *ostream* parameter have to be a *real* file not\n                  a generic stream object like\n                  :class:`StringIO.StringIO` instances\n\n        ";
static PyObject *__pyx_pw_3epr_6Record_5print_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ostream = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ostream,0};
    PyObject* values[1] = {0};

    /* "epr.pyx":1151
 *         return epr_get_num_fields(self._ptr)
 * 
 *     def print_(self, ostream=None):             # <<<<<<<<<<<<<<
 *         '''print_(self, ostream=None)
 * 
 */
    values[0] = ((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);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ostream);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print_") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ostream = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Record.print_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_6Record_4print_(((struct __pyx_obj_3epr_Record *)__pyx_v_self), __pyx_v_ostream);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3epr_6Record_4print_(struct __pyx_obj_3epr_Record *__pyx_v_self, PyObject *__pyx_v_ostream) {
  FILE *__pyx_v_fstream;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  FILE *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_", 0);

  /* "epr.pyx":1169
 *         '''
 * 
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_3epr_pyepr_get_file_stream(__pyx_v_ostream); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fstream = __pyx_t_1;

  /* "epr.pyx":1171
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             epr_print_record(self._ptr, fstream)
 *             stdio.fflush(fstream)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "epr.pyx":1172
 * 
 *         with nogil:
 *             epr_print_record(self._ptr, fstream)             # <<<<<<<<<<<<<<
 *             stdio.fflush(fstream)
 * 
 */
        epr_print_record(__pyx_v_self->_ptr, __pyx_v_fstream);

        /* "epr.pyx":1173
 *         with nogil:
 *             epr_print_record(self._ptr, fstream)
 *             stdio.fflush(fstream)             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
        fflush(__pyx_v_fstream);
      }

      /* "epr.pyx":1171
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             epr_print_record(self._ptr, fstream)
 *             stdio.fflush(fstream)
 */
      /*finally:*/ {
        Py_BLOCK_THREADS
      }
  }

  /* "epr.pyx":1175
 *             stdio.fflush(fstream)
 * 
 *         pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     def print_element(self, uint field_index, uint element_index,
 */
  __pyx_t_2 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("epr.Record.print_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_7print_element(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_6Record_6print_element[] = "print_element(self, field_index, element_index, ostream=None)\n\n        Write the specified field element to file\n\n        This method writes formatted contents of the specified field\n        element to the *ostream* text file or (default) the ASCII output\n        will be printed to standard output (:data:`sys.stdout`)\n\n        :param field_index:\n            the index of field in the record\n        :param element_index:\n            the index of element in the specified field\n        :param ostream:\n            the (opened) output file object\n\n        .. note:: the *ostream* parameter have to be a *real* file not\n                  a generic stream object like\n                  :class:`StringIO.StringIO` instances\n\n        ";
static PyObject *__pyx_pw_3epr_6Record_7print_element(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_field_index;
  uint __pyx_v_element_index;
  PyObject *__pyx_v_ostream = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_element (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__field_index,&__pyx_n_s__element_index,&__pyx_n_s__ostream,0};
    PyObject* values[3] = {0,0,0};

    /* "epr.pyx":1178
 * 
 *     def print_element(self, uint field_index, uint element_index,
 *                       ostream=None):             # <<<<<<<<<<<<<<
 *         '''print_element(self, field_index, element_index, ostream=None)
 * 
 */
    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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__field_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__element_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("print_element", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ostream);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print_element") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_field_index = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_field_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_element_index = __Pyx_PyInt_from_py_uint(values[1]); if (unlikely((__pyx_v_element_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ostream = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_element", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Record.print_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_6Record_6print_element(((struct __pyx_obj_3epr_Record *)__pyx_v_self), __pyx_v_field_index, __pyx_v_element_index, __pyx_v_ostream);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1177
 *         pyepr_check_errors()
 * 
 *     def print_element(self, uint field_index, uint element_index,             # <<<<<<<<<<<<<<
 *                       ostream=None):
 *         '''print_element(self, field_index, element_index, ostream=None)
 */

static PyObject *__pyx_pf_3epr_6Record_6print_element(struct __pyx_obj_3epr_Record *__pyx_v_self, uint __pyx_v_field_index, uint __pyx_v_element_index, PyObject *__pyx_v_ostream) {
  FILE *__pyx_v_fstream;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  FILE *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_element", 0);

  /* "epr.pyx":1200
 *         '''
 * 
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_3epr_pyepr_get_file_stream(__pyx_v_ostream); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fstream = __pyx_t_1;

  /* "epr.pyx":1202
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             epr_print_element(self._ptr, field_index, element_index, fstream)
 *             stdio.fflush(fstream)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "epr.pyx":1203
 * 
 *         with nogil:
 *             epr_print_element(self._ptr, field_index, element_index, fstream)             # <<<<<<<<<<<<<<
 *             stdio.fflush(fstream)
 * 
 */
        epr_print_element(__pyx_v_self->_ptr, __pyx_v_field_index, __pyx_v_element_index, __pyx_v_fstream);

        /* "epr.pyx":1204
 *         with nogil:
 *             epr_print_element(self._ptr, field_index, element_index, fstream)
 *             stdio.fflush(fstream)             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
        fflush(__pyx_v_fstream);
      }

      /* "epr.pyx":1202
 *         cdef FILE* fstream = pyepr_get_file_stream(ostream)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             epr_print_element(self._ptr, field_index, element_index, fstream)
 *             stdio.fflush(fstream)
 */
      /*finally:*/ {
        Py_BLOCK_THREADS
      }
  }

  /* "epr.pyx":1206
 *             stdio.fflush(fstream)
 * 
 *         pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     def get_field(self, name):
 */
  __pyx_t_2 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("epr.Record.print_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_9get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_3epr_6Record_8get_field[] = "get_field(self, name)\n\n        Gets a field specified by name\n\n        The field is here identified through the given name.\n        It contains the field info and all corresponding values.\n\n        :param name:\n            the the name of required field\n        :returns:\n            the specified :class:`Field` or raises an exception\n            (:exc:`EPRValueError`) if an error occurred\n\n        ";
static PyObject *__pyx_pw_3epr_6Record_9get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_field (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Record_8get_field(((struct __pyx_obj_3epr_Record *)__pyx_v_self), ((PyObject *)__pyx_v_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1208
 *         pyepr_check_errors()
 * 
 *     def get_field(self, name):             # <<<<<<<<<<<<<<
 *         '''get_field(self, name)
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_8get_field(struct __pyx_obj_3epr_Record *__pyx_v_self, PyObject *__pyx_v_name) {
  EPR_SField *__pyx_v_field_ptr;
  PyObject *__pyx_v_cname = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_field __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_field", 0);

  /* "epr.pyx":1225
 * 
 *         cdef EPR_SField* field_ptr
 *         cdef bytes cname = _to_bytes(name)             # <<<<<<<<<<<<<<
 *         field_ptr = <EPR_SField*>epr_get_field(self._ptr, cname)
 *         if field_ptr is NULL:
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_3epr__to_bytes(__pyx_v_name, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cname = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "epr.pyx":1226
 *         cdef EPR_SField* field_ptr
 *         cdef bytes cname = _to_bytes(name)
 *         field_ptr = <EPR_SField*>epr_get_field(self._ptr, cname)             # <<<<<<<<<<<<<<
 *         if field_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get field "%s"' % name)
 */
  __pyx_t_2 = PyBytes_AsString(((PyObject *)__pyx_v_cname)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_field_ptr = ((EPR_SField *)epr_get_field(__pyx_v_self->_ptr, __pyx_t_2));

  /* "epr.pyx":1227
 *         cdef bytes cname = _to_bytes(name)
 *         field_ptr = <EPR_SField*>epr_get_field(self._ptr, cname)
 *         if field_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get field "%s"' % name)
 * 
 */
  __pyx_t_3 = (__pyx_v_field_ptr == NULL);
  if (__pyx_t_3) {

    /* "epr.pyx":1228
 *         field_ptr = <EPR_SField*>epr_get_field(self._ptr, cname)
 *         if field_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get field "%s"' % name)             # <<<<<<<<<<<<<<
 * 
 *         return new_field(field_ptr, self)
 */
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = ((PyObject *)__pyx_t_1);
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1230
 *             pyepr_null_ptr_error('unable to get field "%s"' % name)
 * 
 *         return new_field(field_ptr, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_field_at(self, uint index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_1 = __pyx_f_3epr_new_field(__pyx_v_field_ptr, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Record.get_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_11get_field_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_3epr_6Record_10get_field_at[] = "get_field_at(self, index)\n\n        Gets a field at the specified position within the record\n\n        :param index:\n            the zero-based index (position within record) of the field\n        :returns:\n            the field or raises and exception (:exc:`EPRValueError`)\n            if an error occurred\n\n        ";
static PyObject *__pyx_pw_3epr_6Record_11get_field_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  uint __pyx_v_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_field_at (wrapper)", 0);
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_from_py_uint(__pyx_arg_index); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Record.get_field_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_6Record_10get_field_at(((struct __pyx_obj_3epr_Record *)__pyx_v_self), ((uint)__pyx_v_index));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1232
 *         return new_field(field_ptr, self)
 * 
 *     def get_field_at(self, uint index):             # <<<<<<<<<<<<<<
 *         '''get_field_at(self, index)
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_10get_field_at(struct __pyx_obj_3epr_Record *__pyx_v_self, uint __pyx_v_index) {
  EPR_SField *__pyx_v_field_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_field __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_field_at", 0);

  /* "epr.pyx":1246
 * 
 *         cdef EPR_SField* field_ptr
 *         field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, index)             # <<<<<<<<<<<<<<
 *         if field_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get field at index %d' % index)
 */
  __pyx_v_field_ptr = ((EPR_SField *)epr_get_field_at(__pyx_v_self->_ptr, __pyx_v_index));

  /* "epr.pyx":1247
 *         cdef EPR_SField* field_ptr
 *         field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, index)
 *         if field_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get field at index %d' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_field_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1248
 *         field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, index)
 *         if field_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get field at index %d' % index)             # <<<<<<<<<<<<<<
 * 
 *         return new_field(field_ptr, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_35), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = ((PyObject *)__pyx_t_3);
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1250
 *             pyepr_null_ptr_error('unable to get field at index %d' % index)
 * 
 *         return new_field(field_ptr, self)             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_3 = __pyx_f_3epr_new_field(__pyx_v_field_ptr, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Record.get_field_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_13get_field_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Record_12get_field_names[] = "get_field_names(self)\n\n        Return the list of names of the fields in the product\n\n        .. note:: this method has no correspondent in the C API\n\n        ";
static PyObject *__pyx_pw_3epr_6Record_13get_field_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_field_names (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Record_12get_field_names(((struct __pyx_obj_3epr_Record *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1253
 * 
 *     # --- high level interface ------------------------------------------------
 *     def get_field_names(self):             # <<<<<<<<<<<<<<
 *         '''get_field_names(self)
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_12get_field_names(struct __pyx_obj_3epr_Record *__pyx_v_self) {
  EPR_SField *__pyx_v_field_ptr;
  int __pyx_v_idx;
  char *__pyx_v_name;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_field_names", 0);

  /* "epr.pyx":1266
 *         cdef char* name
 * 
 *         names = []             # <<<<<<<<<<<<<<
 *         for idx in range(self.get_num_fields()):
 *             field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, idx)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_names = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "epr.pyx":1267
 * 
 *         names = []
 *         for idx in range(self.get_num_fields()):             # <<<<<<<<<<<<<<
 *             field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, idx)
 *             name = <char*>epr_get_field_name(field_ptr)
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_idx = __pyx_t_4;

    /* "epr.pyx":1268
 *         names = []
 *         for idx in range(self.get_num_fields()):
 *             field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, idx)             # <<<<<<<<<<<<<<
 *             name = <char*>epr_get_field_name(field_ptr)
 *             names.append(_to_str(name, 'ascii'))
 */
    __pyx_v_field_ptr = ((EPR_SField *)epr_get_field_at(__pyx_v_self->_ptr, __pyx_v_idx));

    /* "epr.pyx":1269
 *         for idx in range(self.get_num_fields()):
 *             field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, idx)
 *             name = <char*>epr_get_field_name(field_ptr)             # <<<<<<<<<<<<<<
 *             names.append(_to_str(name, 'ascii'))
 * 
 */
    __pyx_v_name = ((char *)epr_get_field_name(__pyx_v_field_ptr));

    /* "epr.pyx":1270
 *             field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, idx)
 *             name = <char*>epr_get_field_name(field_ptr)
 *             names.append(_to_str(name, 'ascii'))             # <<<<<<<<<<<<<<
 * 
 *         return names
 */
    __pyx_t_2 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.encoding = __pyx_t_1;
    __pyx_t_5 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyList_Append(__pyx_v_names, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "epr.pyx":1272
 *             names.append(_to_str(name, 'ascii'))
 * 
 *         return names             # <<<<<<<<<<<<<<
 * 
 *     # @NOTE: generator and generator expressions are not yet implemented in
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_names));
  __pyx_r = ((PyObject *)__pyx_v_names);
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("epr.Record.get_field_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_15fields(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Record_14fields[] = "fields(self)\n\n        Return the list of fields contained in the record\n\n        ";
static PyObject *__pyx_pw_3epr_6Record_15fields(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fields (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Record_14fields(((struct __pyx_obj_3epr_Record *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1276
 *     # @NOTE: generator and generator expressions are not yet implemented in
 *     #        cython. As a workaround a list is used
 *     def fields(self):             # <<<<<<<<<<<<<<
 *         '''fields(self)
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_14fields(struct __pyx_obj_3epr_Record *__pyx_v_self) {
  int __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint __pyx_t_2;
  int __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("fields", 0);

  /* "epr.pyx":1286
 *         #return list(self)
 *         cdef int idx
 *         return [self.get_field_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_fields(self._ptr))]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "epr.pyx":1287
 *         cdef int idx
 *         return [self.get_field_at(idx)
 *                             for idx in range(epr_get_num_fields(self._ptr))]             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_2 = epr_get_num_fields(__pyx_v_self->_ptr);
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_idx = __pyx_t_3;

    /* "epr.pyx":1286
 *         #return list(self)
 *         cdef int idx
 *         return [self.get_field_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_fields(self._ptr))]
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_field_at); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Record.fields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_17__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Record_17__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Record_16__iter__(((struct __pyx_obj_3epr_Record *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1289
 *                             for idx in range(epr_get_num_fields(self._ptr))]
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         # @TODO: use generator expression when it will be available
 *         #return (self.get_field_at(idx)
 */

static PyObject *__pyx_pf_3epr_6Record_16__iter__(struct __pyx_obj_3epr_Record *__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("__iter__", 0);

  /* "epr.pyx":1293
 *         #return (self.get_field_at(idx)
 *         #                    for idx in range(epr_get_num_elems(self._ptr)))
 *         return iter(self.fields())             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __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;

  __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_AddTraceback("epr.Record.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_19__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Record_19__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Record_18__str__(((struct __pyx_obj_3epr_Record *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1295
 *         return iter(self.fields())
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return '\n'.join(map(str, self))
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_18__str__(struct __pyx_obj_3epr_Record *__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("__str__", 0);

  /* "epr.pyx":1296
 * 
 *     def __str__(self):
 *         return '\n'.join(map(str, self))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_36), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_3 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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("epr.Record.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Record_21__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Record_21__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Record_20__repr__(((struct __pyx_obj_3epr_Record *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1298
 *         return '\n'.join(map(str, self))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%s %d fields' % (super(Record, self).__repr__(),
 *                                  self.get_num_fields())
 */

static PyObject *__pyx_pf_3epr_6Record_20__repr__(struct __pyx_obj_3epr_Record *__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);

  /* "epr.pyx":1299
 * 
 *     def __repr__(self):
 *         return '%s %d fields' % (super(Record, self).__repr__(),             # <<<<<<<<<<<<<<
 *                                  self.get_num_fields())
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_3epr_Record)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_3epr_Record)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_3epr_Record)));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_2 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____repr__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":1300
 *     def __repr__(self):
 *         return '%s %d fields' % (super(Record, self).__repr__(),
 *                                  self.get_num_fields())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_37), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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("epr.Record.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1303
 * 
 * 
 * cdef new_record(EPR_SRecord* ptr, object parent=None, bint dealloc=False):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static PyObject *__pyx_f_3epr_new_record(EPR_SRecord *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_record *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  int __pyx_v_dealloc = ((int)0);
  struct __pyx_obj_3epr_Record *__pyx_v_instance = 0;
  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("new_record", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_dealloc = __pyx_optional_args->dealloc;
      }
    }
  }

  /* "epr.pyx":1304
 * 
 * cdef new_record(EPR_SRecord* ptr, object parent=None, bint dealloc=False):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1305
 * cdef new_record(EPR_SRecord* ptr, object parent=None, bint dealloc=False):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Record instance = Record.__new__(Record)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1307
 *         pyepr_null_ptr_error()
 * 
 *     cdef Record instance = Record.__new__(Record)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Record)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr_Record)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Record *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "epr.pyx":1309
 *     cdef Record instance = Record.__new__(Record)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 *     instance._dealloc = dealloc
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "epr.pyx":1310
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 *     instance._dealloc = dealloc
 * 
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "epr.pyx":1311
 *     instance._ptr = ptr
 *     instance._parent = parent
 *     instance._dealloc = dealloc             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __pyx_v_instance->_dealloc = __pyx_v_dealloc;

  /* "epr.pyx":1313
 *     instance._dealloc = dealloc
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_record", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_3epr_6Raster_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_3epr_6Raster_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_3epr_6Raster___dealloc__(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "epr.pyx":1327
 *     cdef object _data
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._ptr is not NULL:
 *             epr_free_raster(self._ptr)
 */

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

  /* "epr.pyx":1328
 * 
 *     def __dealloc__(self):
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             epr_free_raster(self._ptr)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1329
 *     def __dealloc__(self):
 *         if self._ptr is not NULL:
 *             epr_free_raster(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     property data_type:
 */
    epr_free_raster(__pyx_v_self->_ptr);
    goto __pyx_L3;
  }
  __pyx_L3:;

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_9data_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Raster_9data_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_9data_type___get__(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1338
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.data_type
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_9data_type___get__(struct __pyx_obj_3epr_Raster *__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);

  /* "epr.pyx":1339
 * 
 *         def __get__(self):
 *             return self._ptr.data_type             # <<<<<<<<<<<<<<
 * 
 *     property source_width:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_ptr->data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.data_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_12source_width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Raster_12source_width_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_12source_width___get__(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1344
 *         '''The width of the source'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.source_width
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_12source_width___get__(struct __pyx_obj_3epr_Raster *__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);

  /* "epr.pyx":1345
 * 
 *         def __get__(self):
 *             return self._ptr.source_width             # <<<<<<<<<<<<<<
 * 
 *     property source_height:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->source_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.source_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_13source_height_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Raster_13source_height_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_13source_height___get__(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1350
 *         '''The height of the source'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.source_height
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_13source_height___get__(struct __pyx_obj_3epr_Raster *__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);

  /* "epr.pyx":1351
 * 
 *         def __get__(self):
 *             return self._ptr.source_height             # <<<<<<<<<<<<<<
 * 
 *     property source_step_x:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->source_height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.source_height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_13source_step_x_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Raster_13source_step_x_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_13source_step_x___get__(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1356
 *         '''The sub-sampling for the across-track direction in pixel'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.source_step_x
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_13source_step_x___get__(struct __pyx_obj_3epr_Raster *__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);

  /* "epr.pyx":1357
 * 
 *         def __get__(self):
 *             return self._ptr.source_step_x             # <<<<<<<<<<<<<<
 * 
 *     property source_step_y:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->source_step_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.source_step_x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_13source_step_y_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Raster_13source_step_y_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_13source_step_y___get__(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1362
 *         '''The sub-sampling for the along-track direction in pixel'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.source_step_y
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_13source_step_y___get__(struct __pyx_obj_3epr_Raster *__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);

  /* "epr.pyx":1363
 * 
 *         def __get__(self):
 *             return self._ptr.source_step_y             # <<<<<<<<<<<<<<
 * 
 *     def get_width(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->source_step_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.source_step_y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_3get_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Raster_2get_width[] = "get_width(self)\n\n        Gets the raster's width in pixels\n\n        ";
static PyObject *__pyx_pw_3epr_6Raster_3get_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_width (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_2get_width(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1365
 *             return self._ptr.source_step_y
 * 
 *     def get_width(self):             # <<<<<<<<<<<<<<
 *         '''get_width(self)
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_2get_width(struct __pyx_obj_3epr_Raster *__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_width", 0);

  /* "epr.pyx":1372
 *         '''
 * 
 *         return epr_get_raster_width(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_height(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_raster_width(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.get_width", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_5get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Raster_4get_height[] = "get_height(self)\n\n        Gets the raster's height in pixels\n\n        ";
static PyObject *__pyx_pw_3epr_6Raster_5get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_height (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_4get_height(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1374
 *         return epr_get_raster_width(self._ptr)
 * 
 *     def get_height(self):             # <<<<<<<<<<<<<<
 *         '''get_height(self)
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_4get_height(struct __pyx_obj_3epr_Raster *__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_height", 0);

  /* "epr.pyx":1381
 *         '''
 * 
 *         return epr_get_raster_height(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_elem_size(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_raster_height(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_7get_elem_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Raster_6get_elem_size[] = "get_elem_size(self)\n\n        The size in byte of a single element (sample) of this\n        raster's buffer\n\n        ";
static PyObject *__pyx_pw_3epr_6Raster_7get_elem_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_elem_size (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_6get_elem_size(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1383
 *         return epr_get_raster_height(self._ptr)
 * 
 *     def get_elem_size(self):             # <<<<<<<<<<<<<<
 *         '''get_elem_size(self)
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_6get_elem_size(struct __pyx_obj_3epr_Raster *__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_elem_size", 0);

  /* "epr.pyx":1391
 *         '''
 * 
 *         return epr_get_raster_elem_size(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_pixel(self, int x, int y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_raster_elem_size(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.get_elem_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_9get_pixel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_6Raster_8get_pixel[] = "get_pixel(x, y)\n\n        Single pixel access\n\n        This function is for getting the values of the elements of a\n        raster (i.e. pixel)\n\n        :param x:\n            the (zero-based) X coordinate of the pixel\n        :param y:\n            the (zero-based) Y coordinate of the pixel\n        :returns:\n            the typed value at the given co-ordinate\n\n        ";
static PyObject *__pyx_pw_3epr_6Raster_9get_pixel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_x;
  int __pyx_v_y;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_pixel (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_pixel", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pixel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __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_x = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_pixel", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Raster.get_pixel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_6Raster_8get_pixel(((struct __pyx_obj_3epr_Raster *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1393
 *         return epr_get_raster_elem_size(self._ptr)
 * 
 *     def get_pixel(self, int x, int y):             # <<<<<<<<<<<<<<
 *         '''get_pixel(x, y)
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_8get_pixel(struct __pyx_obj_3epr_Raster *__pyx_v_self, int __pyx_v_x, int __pyx_v_y) {
  EPR_EDataTypeId __pyx_v_dtype;
  double __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __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;
  enum EPR_DataTypeId __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_pixel", 0);

  /* "epr.pyx":1410
 *         '''
 * 
 *         if (x < 0 or x >= self._ptr.raster_width or             # <<<<<<<<<<<<<<
 *             y < 0  or y >= self._ptr.raster_height):
 *             raise ValueError('index out of range: x=%d, y=%d' % (x, y))
 */
  __pyx_t_1 = (__pyx_v_x < 0);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_x >= __pyx_v_self->_ptr->raster_width);
    if (!__pyx_t_2) {

      /* "epr.pyx":1411
 * 
 *         if (x < 0 or x >= self._ptr.raster_width or
 *             y < 0  or y >= self._ptr.raster_height):             # <<<<<<<<<<<<<<
 *             raise ValueError('index out of range: x=%d, y=%d' % (x, y))
 * 
 */
      __pyx_t_3 = (__pyx_v_y < 0);
      if (!__pyx_t_3) {
        __pyx_t_4 = (__pyx_v_y >= __pyx_v_self->_ptr->raster_height);
        __pyx_t_5 = __pyx_t_4;
      } else {
        __pyx_t_5 = __pyx_t_3;
      }
      __pyx_t_3 = __pyx_t_5;
    } else {
      __pyx_t_3 = __pyx_t_2;
    }
    __pyx_t_2 = __pyx_t_3;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  if (__pyx_t_2) {

    /* "epr.pyx":1412
 *         if (x < 0 or x >= self._ptr.raster_width or
 *             y < 0  or y >= self._ptr.raster_height):
 *             raise ValueError('index out of range: x=%d, y=%d' % (x, y))             # <<<<<<<<<<<<<<
 * 
 *         cdef EPR_EDataTypeId dtype = self._ptr.data_type
 */
    __pyx_t_6 = PyInt_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyInt_FromLong(__pyx_v_y); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_38), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1414
 *             raise ValueError('index out of range: x=%d, y=%d' % (x, y))
 * 
 *         cdef EPR_EDataTypeId dtype = self._ptr.data_type             # <<<<<<<<<<<<<<
 * 
 *         if dtype == e_tid_uint:
 */
  __pyx_t_9 = __pyx_v_self->_ptr->data_type;
  __pyx_v_dtype = __pyx_t_9;

  /* "epr.pyx":1416
 *         cdef EPR_EDataTypeId dtype = self._ptr.data_type
 * 
 *         if dtype == e_tid_uint:             # <<<<<<<<<<<<<<
 *             val = epr_get_pixel_as_uint(self._ptr, x, y)
 *         elif dtype == e_tid_int:
 */
  __pyx_t_2 = (__pyx_v_dtype == e_tid_uint);
  if (__pyx_t_2) {

    /* "epr.pyx":1417
 * 
 *         if dtype == e_tid_uint:
 *             val = epr_get_pixel_as_uint(self._ptr, x, y)             # <<<<<<<<<<<<<<
 *         elif dtype == e_tid_int:
 *             val = epr_get_pixel_as_int(self._ptr, x, y)
 */
    __pyx_v_val = epr_get_pixel_as_uint(__pyx_v_self->_ptr, __pyx_v_x, __pyx_v_y);
    goto __pyx_L4;
  }

  /* "epr.pyx":1418
 *         if dtype == e_tid_uint:
 *             val = epr_get_pixel_as_uint(self._ptr, x, y)
 *         elif dtype == e_tid_int:             # <<<<<<<<<<<<<<
 *             val = epr_get_pixel_as_int(self._ptr, x, y)
 *         elif dtype == e_tid_float:
 */
  __pyx_t_2 = (__pyx_v_dtype == e_tid_int);
  if (__pyx_t_2) {

    /* "epr.pyx":1419
 *             val = epr_get_pixel_as_uint(self._ptr, x, y)
 *         elif dtype == e_tid_int:
 *             val = epr_get_pixel_as_int(self._ptr, x, y)             # <<<<<<<<<<<<<<
 *         elif dtype == e_tid_float:
 *             val = epr_get_pixel_as_float(self._ptr, x, y)
 */
    __pyx_v_val = epr_get_pixel_as_int(__pyx_v_self->_ptr, __pyx_v_x, __pyx_v_y);
    goto __pyx_L4;
  }

  /* "epr.pyx":1420
 *         elif dtype == e_tid_int:
 *             val = epr_get_pixel_as_int(self._ptr, x, y)
 *         elif dtype == e_tid_float:             # <<<<<<<<<<<<<<
 *             val = epr_get_pixel_as_float(self._ptr, x, y)
 *         elif dtype == e_tid_double:
 */
  __pyx_t_2 = (__pyx_v_dtype == e_tid_float);
  if (__pyx_t_2) {

    /* "epr.pyx":1421
 *             val = epr_get_pixel_as_int(self._ptr, x, y)
 *         elif dtype == e_tid_float:
 *             val = epr_get_pixel_as_float(self._ptr, x, y)             # <<<<<<<<<<<<<<
 *         elif dtype == e_tid_double:
 *             val = epr_get_pixel_as_double(self._ptr, x, y)
 */
    __pyx_v_val = epr_get_pixel_as_float(__pyx_v_self->_ptr, __pyx_v_x, __pyx_v_y);
    goto __pyx_L4;
  }

  /* "epr.pyx":1422
 *         elif dtype == e_tid_float:
 *             val = epr_get_pixel_as_float(self._ptr, x, y)
 *         elif dtype == e_tid_double:             # <<<<<<<<<<<<<<
 *             val = epr_get_pixel_as_double(self._ptr, x, y)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_dtype == e_tid_double);
  if (__pyx_t_2) {

    /* "epr.pyx":1423
 *             val = epr_get_pixel_as_float(self._ptr, x, y)
 *         elif dtype == e_tid_double:
 *             val = epr_get_pixel_as_double(self._ptr, x, y)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('invalid data type: "%s"' %
 */
    __pyx_v_val = epr_get_pixel_as_double(__pyx_v_self->_ptr, __pyx_v_x, __pyx_v_y);
    goto __pyx_L4;
  }
  /*else*/ {

    /* "epr.pyx":1426
 *         else:
 *             raise ValueError('invalid data type: "%s"' %
 *                                         <char*>epr_data_type_id_to_str(dtype))             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()    # @TODO: check
 */
    __pyx_t_7 = PyBytes_FromString(((char *)epr_data_type_id_to_str(__pyx_v_dtype))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_8));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "epr.pyx":1428
 *                                         <char*>epr_data_type_id_to_str(dtype))
 * 
 *         pyepr_check_errors()    # @TODO: check             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_t_10 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":1430
 *         pyepr_check_errors()    # @TODO: check
 * 
 *         return val             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("epr.Raster.get_pixel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1433
 * 
 *     # --- high level interface ------------------------------------------------
 *     cdef np.ndarray toarray(self):             # <<<<<<<<<<<<<<
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)
 *         if dtype == np.NPY_NOTYPE:
 */

static PyArrayObject *__pyx_f_3epr_6Raster_toarray(struct __pyx_obj_3epr_Raster *__pyx_v_self) {
  enum NPY_TYPES __pyx_v_dtype;
  npy_intp __pyx_v_shape[2];
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  uint __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toarray", 0);

  /* "epr.pyx":1434
 *     # --- high level interface ------------------------------------------------
 *     cdef np.ndarray toarray(self):
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_NOTYPE:
 *             raise TypeError('invalid data type')
 */
  __pyx_v_dtype = __pyx_f_3epr__epr_to_numpy_type_id(__pyx_v_self->_ptr->data_type);

  /* "epr.pyx":1435
 *     cdef np.ndarray toarray(self):
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)
 *         if dtype == np.NPY_NOTYPE:             # <<<<<<<<<<<<<<
 *             raise TypeError('invalid data type')
 *             return
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_NOTYPE);
  if (__pyx_t_1) {

    /* "epr.pyx":1436
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)
 *         if dtype == np.NPY_NOTYPE:
 *             raise TypeError('invalid data type')             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1440
 * 
 *         cdef np.npy_intp shape[2]
 *         shape[0] = self._ptr.raster_height             # <<<<<<<<<<<<<<
 *         shape[1] = self._ptr.raster_width
 * 
 */
  __pyx_t_3 = __pyx_v_self->_ptr->raster_height;
  (__pyx_v_shape[0]) = __pyx_t_3;

  /* "epr.pyx":1441
 *         cdef np.npy_intp shape[2]
 *         shape[0] = self._ptr.raster_height
 *         shape[1] = self._ptr.raster_width             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray result
 */
  __pyx_t_3 = __pyx_v_self->_ptr->raster_width;
  (__pyx_v_shape[1]) = __pyx_t_3;

  /* "epr.pyx":1445
 *         cdef np.ndarray result
 *         result = np.PyArray_SimpleNewFromData(2, shape, dtype,
 *                                               self._ptr.buffer)             # <<<<<<<<<<<<<<
 * 
 *         # Make the ndarray keep a reference to this object
 */
  __pyx_t_2 = PyArray_SimpleNewFromData(2, __pyx_v_shape, __pyx_v_dtype, __pyx_v_self->_ptr->buffer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "epr.pyx":1448
 * 
 *         # Make the ndarray keep a reference to this object
 *         np.set_array_base(result, self)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_f_5numpy_set_array_base(__pyx_v_result, ((PyObject *)__pyx_v_self));

  /* "epr.pyx":1450
 *         np.set_array_base(result, self)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     property data:
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Raster.toarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Raster_4data_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_4data___get__(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1461
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._data is not None:
 *                 return self._data
 */

static PyObject *__pyx_pf_3epr_6Raster_4data___get__(struct __pyx_obj_3epr_Raster *__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);

  /* "epr.pyx":1462
 * 
 *         def __get__(self):
 *             if self._data is not None:             # <<<<<<<<<<<<<<
 *                 return self._data
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_data != Py_None);
  if (__pyx_t_1) {

    /* "epr.pyx":1463
 *         def __get__(self):
 *             if self._data is not None:
 *                 return self._data             # <<<<<<<<<<<<<<
 * 
 *             if self._ptr.buffer is NULL:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->_data);
    __pyx_r = __pyx_v_self->_data;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1465
 *                 return self._data
 * 
 *             if self._ptr.buffer is NULL:             # <<<<<<<<<<<<<<
 *                 return np.ndarray(())
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_ptr->buffer == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1466
 * 
 *             if self._ptr.buffer is NULL:
 *                 return np.ndarray(())             # <<<<<<<<<<<<<<
 * 
 *             self._data = self.toarray()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "epr.pyx":1468
 *                 return np.ndarray(())
 * 
 *             self._data = self.toarray()             # <<<<<<<<<<<<<<
 * 
 *             return self._data
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3epr_Raster *)__pyx_v_self->__pyx_vtab)->toarray(__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_data);
  __Pyx_DECREF(__pyx_v_self->_data);
  __pyx_v_self->_data = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "epr.pyx":1470
 *             self._data = self.toarray()
 * 
 *             return self._data             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_data);
  __pyx_r = __pyx_v_self->_data;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Raster.data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_6Raster_11__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_6Raster_11__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_6Raster_10__repr__(((struct __pyx_obj_3epr_Raster *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1472
 *             return self._data
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%s %s (%dL x %dP)' % (super(Raster, self).__repr__(),
 *                                       data_type_id_to_str(self.data_type),
 */

static PyObject *__pyx_pf_3epr_6Raster_10__repr__(struct __pyx_obj_3epr_Raster *__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);

  /* "epr.pyx":1473
 * 
 *     def __repr__(self):
 *         return '%s %s (%dL x %dP)' % (super(Raster, self).__repr__(),             # <<<<<<<<<<<<<<
 *                                       data_type_id_to_str(self.data_type),
 *                                       self.get_height(), self.get_width())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_3epr_Raster)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_3epr_Raster)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_3epr_Raster)));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_2 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____repr__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":1474
 *     def __repr__(self):
 *         return '%s %s (%dL x %dP)' % (super(Raster, self).__repr__(),
 *                                       data_type_id_to_str(self.data_type),             # <<<<<<<<<<<<<<
 *                                       self.get_height(), self.get_width())
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__data_type_id_to_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  /* "epr.pyx":1475
 *         return '%s %s (%dL x %dP)' % (super(Raster, self).__repr__(),
 *                                       data_type_id_to_str(self.data_type),
 *                                       self.get_height(), self.get_width())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_43), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("epr.Raster.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1478
 * 
 * 
 * cdef new_raster(EPR_SRaster* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static PyObject *__pyx_f_3epr_new_raster(EPR_SRaster *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_raster *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_Raster *__pyx_v_instance = 0;
  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("new_raster", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }

  /* "epr.pyx":1479
 * 
 * cdef new_raster(EPR_SRaster* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1480
 * cdef new_raster(EPR_SRaster* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Raster instance = Raster.__new__(Raster)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1482
 *         pyepr_null_ptr_error()
 * 
 *     cdef Raster instance = Raster.__new__(Raster)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Raster)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr_Raster)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Raster *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "epr.pyx":1484
 *     cdef Raster instance = Raster.__new__(Raster)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 *     instance._data = None
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "epr.pyx":1485
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 *     instance._data = None
 * 
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "epr.pyx":1486
 *     instance._ptr = ptr
 *     instance._parent = parent
 *     instance._data = None             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_instance->_data);
  __Pyx_DECREF(__pyx_v_instance->_data);
  __pyx_v_instance->_data = Py_None;

  /* "epr.pyx":1488
 *     instance._data = None
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_9create_raster(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_8create_raster[] = "create_raster(data_type, src_width, src_height, xstep=1, ystep=1)\n\n    Creates a raster of the specified data type\n\n    This function can be used to create any type of raster, e.g. for\n    later use as a bit-mask.\n\n    :param data_type:\n        the type of the data to stored in the raster, must be one of\n        E_TID_*\n    :param src_width:\n        the width (across track dimension) of the source to be read\n        into the raster.\n        See description of :meth:`Band.create_compatible_raster`\n    :param src_height:\n        the height (along track dimension) of the source to be read\n        into the raster.\n        See description of :meth:`Band.create_compatible_raster`\n    :param xstep:\n        the sub-sampling step across track of the source when reading\n        into the raster\n    :param ystep:\n        the sub-sampling step along track of the source when reading\n        into the raster\n    :returns:\n        the new :class:`Raster` instance\n\n    .. seealso:: description of :meth:`Band.create_compatible_raster`\n\n    ";
static PyMethodDef __pyx_mdef_3epr_9create_raster = {__Pyx_NAMESTR("create_raster"), (PyCFunction)__pyx_pw_3epr_9create_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_8create_raster)};
static PyObject *__pyx_pw_3epr_9create_raster(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  EPR_EDataTypeId __pyx_v_data_type;
  uint __pyx_v_src_width;
  uint __pyx_v_src_height;
  uint __pyx_v_xstep;
  uint __pyx_v_ystep;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_raster (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data_type,&__pyx_n_s__src_width,&__pyx_n_s__src_height,&__pyx_n_s__xstep,&__pyx_n_s__ystep,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);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_raster", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_raster", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xstep);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ystep);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  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_data_type = ((EPR_EDataTypeId)PyInt_AsLong(values[0])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_src_width = __Pyx_PyInt_from_py_uint(values[1]); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_src_height = __Pyx_PyInt_from_py_uint(values[2]); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[3]) {
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(values[3]); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xstep = ((uint)1);
    }
    if (values[4]) {
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(values[4]); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ystep = ((uint)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_raster", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.create_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_8create_raster(__pyx_self, __pyx_v_data_type, __pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1491
 * 
 * 
 * def create_raster(EPR_EDataTypeId data_type, uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                   uint xstep=1, uint ystep=1):
 *     '''create_raster(data_type, src_width, src_height, xstep=1, ystep=1)
 */

static PyObject *__pyx_pf_3epr_8create_raster(CYTHON_UNUSED PyObject *__pyx_self, EPR_EDataTypeId __pyx_v_data_type, uint __pyx_v_src_width, uint __pyx_v_src_height, uint __pyx_v_xstep, uint __pyx_v_ystep) {
  EPR_SRaster *__pyx_v_raster_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_raster", 0);

  /* "epr.pyx":1524
 *     '''
 * 
 *     if xstep == 0 or ystep == 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('invalid step: xspet=%d, ystep=%d' % (xstep, ystep))
 * 
 */
  __pyx_t_1 = (__pyx_v_xstep == 0);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_ystep == 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "epr.pyx":1525
 * 
 *     if xstep == 0 or ystep == 0:
 *         raise ValueError('invalid step: xspet=%d, ystep=%d' % (xstep, ystep))             # <<<<<<<<<<<<<<
 * 
 *     cdef EPR_SRaster* raster_ptr
 */
    __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_xstep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_ystep); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_44), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1529
 *     cdef EPR_SRaster* raster_ptr
 *     raster_ptr = epr_create_raster(data_type, src_width, src_height,
 *                                    xstep, ystep)             # <<<<<<<<<<<<<<
 *     if raster_ptr is NULL:
 *         pyepr_null_ptr_error('unable to create a new raster')
 */
  __pyx_v_raster_ptr = epr_create_raster(__pyx_v_data_type, __pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);

  /* "epr.pyx":1530
 *     raster_ptr = epr_create_raster(data_type, src_width, src_height,
 *                                    xstep, ystep)
 *     if raster_ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error('unable to create a new raster')
 * 
 */
  __pyx_t_3 = (__pyx_v_raster_ptr == NULL);
  if (__pyx_t_3) {

    /* "epr.pyx":1531
 *                                    xstep, ystep)
 *     if raster_ptr is NULL:
 *         pyepr_null_ptr_error('unable to create a new raster')             # <<<<<<<<<<<<<<
 * 
 *     return new_raster(raster_ptr)
 */
    __pyx_t_5 = ((PyObject *)__pyx_kp_s_45);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.msg = __pyx_t_5;
    __pyx_t_7 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "epr.pyx":1533
 *         pyepr_null_ptr_error('unable to create a new raster')
 * 
 *     return new_raster(raster_ptr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_3epr_new_raster(__pyx_v_raster_ptr, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.create_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_11create_bitmask_raster(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_10create_bitmask_raster[] = "create_bitmask_raster(src_width, src_height, xstep=1, ystep=1)\n\n    Creates a raster to be used for reading bitmasks\n\n    The raster returned always is of type ``byte``.\n\n    :param src_width:\n        the width (across track dimension) of the source to be read\n        into the raster\n    :param src_height:\n        the height (along track dimension) of the source to be read\n        into the raster\n    :param xstep:\n        the sub-sampling step across track of the source when reading\n        into the raster\n    :param ystep:\n        the sub-sampling step along track of the source when reading\n        into the raster\n    :returns:\n        the new raster instance or raises an exception\n        (:exc:`EPRValueError`) if an error occurred\n\n    .. seealso:: the description of\n                 :meth:`Band.create_compatible_raster`\n\n    ";
static PyMethodDef __pyx_mdef_3epr_11create_bitmask_raster = {__Pyx_NAMESTR("create_bitmask_raster"), (PyCFunction)__pyx_pw_3epr_11create_bitmask_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_10create_bitmask_raster)};
static PyObject *__pyx_pw_3epr_11create_bitmask_raster(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_src_width;
  uint __pyx_v_src_height;
  uint __pyx_v_xstep;
  uint __pyx_v_ystep;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_bitmask_raster (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__src_width,&__pyx_n_s__src_height,&__pyx_n_s__xstep,&__pyx_n_s__ystep,0};
    PyObject* values[4] = {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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_width)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_bitmask_raster", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xstep);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ystep);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_bitmask_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_src_width = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_src_height = __Pyx_PyInt_from_py_uint(values[1]); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[2]) {
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(values[2]); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xstep = ((uint)1);
    }
    if (values[3]) {
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(values[3]); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ystep = ((uint)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_bitmask_raster", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.create_bitmask_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_10create_bitmask_raster(__pyx_self, __pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1536
 * 
 * 
 * def create_bitmask_raster(uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                           uint xstep=1, uint ystep=1):
 *     '''create_bitmask_raster(src_width, src_height, xstep=1, ystep=1)
 */

static PyObject *__pyx_pf_3epr_10create_bitmask_raster(CYTHON_UNUSED PyObject *__pyx_self, uint __pyx_v_src_width, uint __pyx_v_src_height, uint __pyx_v_xstep, uint __pyx_v_ystep) {
  EPR_SRaster *__pyx_v_raster_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_bitmask_raster", 0);

  /* "epr.pyx":1565
 *     '''
 * 
 *     if xstep == 0 or ystep == 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('invalid step: xspet=%d, ystep=%d' % (xstep, ystep))
 * 
 */
  __pyx_t_1 = (__pyx_v_xstep == 0);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_ystep == 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "epr.pyx":1566
 * 
 *     if xstep == 0 or ystep == 0:
 *         raise ValueError('invalid step: xspet=%d, ystep=%d' % (xstep, ystep))             # <<<<<<<<<<<<<<
 * 
 *     cdef EPR_SRaster* raster_ptr
 */
    __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_xstep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_ystep); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_44), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1569
 * 
 *     cdef EPR_SRaster* raster_ptr
 *     raster_ptr = epr_create_bitmask_raster(src_width, src_height, xstep, ystep)             # <<<<<<<<<<<<<<
 *     if raster_ptr is NULL:
 *         pyepr_null_ptr_error('unable to create a new raster')
 */
  __pyx_v_raster_ptr = epr_create_bitmask_raster(__pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);

  /* "epr.pyx":1570
 *     cdef EPR_SRaster* raster_ptr
 *     raster_ptr = epr_create_bitmask_raster(src_width, src_height, xstep, ystep)
 *     if raster_ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error('unable to create a new raster')
 * 
 */
  __pyx_t_3 = (__pyx_v_raster_ptr == NULL);
  if (__pyx_t_3) {

    /* "epr.pyx":1571
 *     raster_ptr = epr_create_bitmask_raster(src_width, src_height, xstep, ystep)
 *     if raster_ptr is NULL:
 *         pyepr_null_ptr_error('unable to create a new raster')             # <<<<<<<<<<<<<<
 * 
 *     return new_raster(raster_ptr)
 */
    __pyx_t_5 = ((PyObject *)__pyx_kp_s_45);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.msg = __pyx_t_5;
    __pyx_t_7 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "epr.pyx":1573
 *         pyepr_null_ptr_error('unable to create a new raster')
 * 
 *     return new_raster(raster_ptr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_3epr_new_raster(__pyx_v_raster_ptr, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.create_bitmask_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_7product_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_7product_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_7product___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1593
 *         '''The :class:`Product` instance to which this band belongs to'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._parent
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_7product___get__(struct __pyx_obj_3epr_Band *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":1594
 * 
 *         def __get__(self):
 *             return self._parent             # <<<<<<<<<<<<<<
 * 
 *     property spectr_band_index:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_parent);
  __pyx_r = __pyx_v_self->_parent;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_17spectr_band_index_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_17spectr_band_index_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_17spectr_band_index___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1603
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.spectr_band_index
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_17spectr_band_index___get__(struct __pyx_obj_3epr_Band *__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);

  /* "epr.pyx":1604
 * 
 *         def __get__(self):
 *             return self._ptr.spectr_band_index             # <<<<<<<<<<<<<<
 * 
 *     property sample_model:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_ptr->spectr_band_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.spectr_band_index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_12sample_model_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_12sample_model_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_12sample_model___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1622
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.sample_model
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_12sample_model___get__(struct __pyx_obj_3epr_Band *__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);

  /* "epr.pyx":1623
 * 
 *         def __get__(self):
 *             return self._ptr.sample_model             # <<<<<<<<<<<<<<
 * 
 *     property data_type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_ptr->sample_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.sample_model.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_9data_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_9data_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_9data_type___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1637
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.data_type
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_9data_type___get__(struct __pyx_obj_3epr_Band *__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);

  /* "epr.pyx":1638
 * 
 *         def __get__(self):
 *             return self._ptr.data_type             # <<<<<<<<<<<<<<
 * 
 *     property scaling_method:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_ptr->data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.data_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_14scaling_method_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_14scaling_method_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_14scaling_method___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1659
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.scaling_method
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_14scaling_method___get__(struct __pyx_obj_3epr_Band *__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);

  /* "epr.pyx":1660
 * 
 *         def __get__(self):
 *             return self._ptr.scaling_method             # <<<<<<<<<<<<<<
 * 
 *     property scaling_offset:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_ptr->scaling_method); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.scaling_method.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_14scaling_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_14scaling_offset_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_14scaling_offset___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1676
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.scaling_offset
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_14scaling_offset___get__(struct __pyx_obj_3epr_Band *__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);

  /* "epr.pyx":1677
 * 
 *         def __get__(self):
 *             return self._ptr.scaling_offset             # <<<<<<<<<<<<<<
 * 
 *     property scaling_factor:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_ptr->scaling_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.scaling_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_14scaling_factor_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_14scaling_factor_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_14scaling_factor___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1693
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.scaling_factor
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_14scaling_factor___get__(struct __pyx_obj_3epr_Band *__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);

  /* "epr.pyx":1694
 * 
 *         def __get__(self):
 *             return self._ptr.scaling_factor             # <<<<<<<<<<<<<<
 * 
 *     property bm_expr:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_ptr->scaling_factor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.scaling_factor.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_7bm_expr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_7bm_expr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_7bm_expr___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1703
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.bm_expr is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_4Band_7bm_expr___get__(struct __pyx_obj_3epr_Band *__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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":1704
 * 
 *         def __get__(self):
 *             if self._ptr.bm_expr is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->_ptr->bm_expr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1705
 *         def __get__(self):
 *             if self._ptr.bm_expr is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return _to_str(self._ptr.bm_expr, 'ascii')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":1707
 *                 return None
 *             else:
 *                 return _to_str(self._ptr.bm_expr, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     property unit:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_ptr->bm_expr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __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("epr.Band.bm_expr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_4unit___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1712
 *         '''The geophysical unit for the band's pixel values'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.unit is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_4Band_4unit___get__(struct __pyx_obj_3epr_Band *__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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":1713
 * 
 *         def __get__(self):
 *             if self._ptr.unit is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->_ptr->unit == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1714
 *         def __get__(self):
 *             if self._ptr.unit is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return _to_str(self._ptr.unit, 'ascii')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":1716
 *                 return None
 *             else:
 *                 return _to_str(self._ptr.unit, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     property description:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_ptr->unit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __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("epr.Band.unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_11description_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_11description_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_11description___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1721
 *         '''A short description of the band's contents'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.description is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_4Band_11description___get__(struct __pyx_obj_3epr_Band *__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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":1722
 * 
 *         def __get__(self):
 *             if self._ptr.description is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->_ptr->description == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1723
 *         def __get__(self):
 *             if self._ptr.description is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return _to_str(self._ptr.description, 'ascii')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":1725
 *                 return None
 *             else:
 *                 return _to_str(self._ptr.description, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     property lines_mirrored:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_ptr->description); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __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("epr.Band.description.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_14lines_mirrored_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_14lines_mirrored_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_14lines_mirrored___get__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1736
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <bint>self._ptr.lines_mirrored
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_14lines_mirrored___get__(struct __pyx_obj_3epr_Band *__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);

  /* "epr.pyx":1737
 * 
 *         def __get__(self):
 *             return <bint>self._ptr.lines_mirrored             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((int)__pyx_v_self->_ptr->lines_mirrored)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.lines_mirrored.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_1get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_4Band_get_name[] = "get_name(self)\n\n        Gets the name of the band\n\n        ";
static PyObject *__pyx_pw_3epr_4Band_1get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_get_name(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1739
 *             return <bint>self._ptr.lines_mirrored
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         '''get_name(self)
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_get_name(struct __pyx_obj_3epr_Band *__pyx_v_self) {
  char *__pyx_v_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_name", 0);

  /* "epr.pyx":1746
 *         '''
 * 
 *         cdef char* name = <char*>epr_get_band_name(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *         return _to_str(name, 'ascii')
 */
  __pyx_v_name = ((char *)epr_get_band_name(__pyx_v_self->_ptr));

  /* "epr.pyx":1748
 *         cdef char* name = <char*>epr_get_band_name(self._ptr)
 * 
 *         return _to_str(name, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: default values for src_width and src_height
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.encoding = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_1), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__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;

  __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("epr.Band.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_3create_compatible_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_4Band_2create_compatible_raster[] = "create_compatible_raster(self, src_width, src_height, xstep=1, ystep=1)\n\n        Creates a raster which is compatible with the data type of\n        the band\n\n        The created raster is used to read the data in it (see\n        :meth:`Band.read_raster`).\n\n        The raster is defined on the grid of the product, from which\n        the data are read. Spatial subsets and under-sampling are\n        possible) through the parameter of the method.\n\n        A raster is an object that allows direct access to data of a\n        certain portion of the ENVISAT product that are read into the\n        it.\n        Such a portion is called the source. The complete ENVISAT\n        product can be much greater than the source.\n        One can move the raster over the complete ENVISAT product and\n        read in turn different parts (always of the size of the source)\n        of it into the raster.\n        The source is specified by the parameters *height* and *width*.\n\n        A typical example is a processing in blocks. Lets say, a block\n        has 64x32 pixel. Then, my source has a width of 64 pixel and a\n        height of 32 pixel.\n\n        Another example is a processing of complete image lines. Then,\n        my source has a widths of the complete product (for example\n        1121 for a MERIS RR product), and a height of 1).\n        One can loop over all blocks read into the raster and process\n        it.\n\n        In addition, it is possible to defined a sub-sampling step for\n        a raster. This means, that the source is not read 1:1 into the\n        raster, but that only every 2nd or 3rd pixel is read. This step\n        can be set differently for the across track (source_step_x) and\n        along track (source_step_y) directions.\n\n        :param src_width:\n            the width (across track dimension) of the source to be read\n            into the raster\n        :param src_height:\n            the height (along track dimension) of the s""ource to be read\n            into the raster\n        :param xstep:\n            the sub-sampling step across track of the source when\n            reading into the raster\n        :param ystep:\n            the sub-sampling step along track of the source when\n            reading into the raster\n        :returns:\n            the new raster instance or raises an exception\n            (:exc:`EPRValueError`) if an error occurred\n\n        ";
static PyObject *__pyx_pw_3epr_4Band_3create_compatible_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_src_width;
  uint __pyx_v_src_height;
  uint __pyx_v_xstep;
  uint __pyx_v_ystep;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_compatible_raster (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__src_width,&__pyx_n_s__src_height,&__pyx_n_s__xstep,&__pyx_n_s__ystep,0};
    PyObject* values[4] = {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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_width)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_compatible_raster", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xstep);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ystep);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_compatible_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_src_width = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_src_height = __Pyx_PyInt_from_py_uint(values[1]); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[2]) {
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(values[2]); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xstep = ((uint)1);
    }
    if (values[3]) {
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(values[3]); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ystep = ((uint)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_compatible_raster", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Band.create_compatible_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_4Band_2create_compatible_raster(((struct __pyx_obj_3epr_Band *)__pyx_v_self), __pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1751
 * 
 *     # @TODO: default values for src_width and src_height
 *     def create_compatible_raster(self, uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                                  uint xstep=1, uint ystep=1):
 *         '''create_compatible_raster(self, src_width, src_height, xstep=1, ystep=1)
 */

static PyObject *__pyx_pf_3epr_4Band_2create_compatible_raster(struct __pyx_obj_3epr_Band *__pyx_v_self, uint __pyx_v_src_width, uint __pyx_v_src_height, uint __pyx_v_xstep, uint __pyx_v_ystep) {
  EPR_SRaster *__pyx_v_raster_ptr;
  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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_8;
  struct __pyx_opt_args_3epr_new_raster __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_compatible_raster", 0);

  /* "epr.pyx":1819
 *         raster_ptr = epr_create_compatible_raster(self._ptr,
 *                                                   src_width, src_height,
 *                                                   xstep, ystep)             # <<<<<<<<<<<<<<
 *         if raster_ptr is NULL:
 *             pyepr_null_ptr_error('unable to create compatible raster with '
 */
  __pyx_v_raster_ptr = epr_create_compatible_raster(__pyx_v_self->_ptr, __pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);

  /* "epr.pyx":1820
 *                                                   src_width, src_height,
 *                                                   xstep, ystep)
 *         if raster_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to create compatible raster with '
 *                                  'width=%d, height=%d xstep=%d, ystep=%d' %
 */
  __pyx_t_1 = (__pyx_v_raster_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1823
 *             pyepr_null_ptr_error('unable to create compatible raster with '
 *                                  'width=%d, height=%d xstep=%d, ystep=%d' %
 *                                         (src_width, src_height, xstep, ystep))             # <<<<<<<<<<<<<<
 * 
 *         return new_raster(raster_ptr, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_src_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_src_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_xstep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_ystep); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_46), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.msg = ((PyObject *)__pyx_t_5);
    __pyx_t_7 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1825
 *                                         (src_width, src_height, xstep, ystep))
 * 
 *         return new_raster(raster_ptr, self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef read_raster(self, int xoffset=0, int yoffset=0, Raster raster=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_5 = __pyx_f_3epr_new_raster(__pyx_v_raster_ptr, &__pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Band.create_compatible_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1827
 *         return new_raster(raster_ptr, self)
 * 
 *     cpdef read_raster(self, int xoffset=0, int yoffset=0, Raster raster=None):             # <<<<<<<<<<<<<<
 *         '''read_raster(self, xoffset=0, yoffset=0, Raster raster=None)
 * 
 */

static PyObject *__pyx_pw_3epr_4Band_5read_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_3epr_4Band_read_raster(struct __pyx_obj_3epr_Band *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3epr_4Band_read_raster *__pyx_optional_args) {
  int __pyx_v_xoffset = ((int)0);
  int __pyx_v_yoffset = ((int)0);
  struct __pyx_obj_3epr_Raster *__pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)Py_None);
  int __pyx_v_ret;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_raster", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_xoffset = __pyx_optional_args->xoffset;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_yoffset = __pyx_optional_args->yoffset;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_raster = __pyx_optional_args->raster;
        }
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_raster);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_raster); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_3epr_4Band_5read_raster)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_xoffset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_yoffset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_raster));
      PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_raster));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_raster));
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "epr.pyx":1863
 *         cdef int ret
 * 
 *         if raster is None:             # <<<<<<<<<<<<<<
 *             raster = self.create_compatible_raster()
 * 
 */
  __pyx_t_5 = (((PyObject *)__pyx_v_raster) == Py_None);
  if (__pyx_t_5) {

    /* "epr.pyx":1864
 * 
 *         if raster is None:
 *             raster = self.create_compatible_raster()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_47); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr_Raster))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_raster));
    __pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1866
 *             raster = self.create_compatible_raster()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             ret = epr_read_band_raster(self._ptr, xoffset, yoffset,
 *                                        raster._ptr)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "epr.pyx":1868
 *         with nogil:
 *             ret = epr_read_band_raster(self._ptr, xoffset, yoffset,
 *                                        raster._ptr)             # <<<<<<<<<<<<<<
 * 
 *         if ret != 0:
 */
        __pyx_v_ret = epr_read_band_raster(__pyx_v_self->_ptr, __pyx_v_xoffset, __pyx_v_yoffset, __pyx_v_raster->_ptr);
      }

      /* "epr.pyx":1866
 *             raster = self.create_compatible_raster()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             ret = epr_read_band_raster(self._ptr, xoffset, yoffset,
 *                                        raster._ptr)
 */
      /*finally:*/ {
        Py_BLOCK_THREADS
      }
  }

  /* "epr.pyx":1870
 *                                        raster._ptr)
 * 
 *         if ret != 0:             # <<<<<<<<<<<<<<
 *             pyepr_check_errors()
 * 
 */
  __pyx_t_5 = (__pyx_v_ret != 0);
  if (__pyx_t_5) {

    /* "epr.pyx":1871
 * 
 *         if ret != 0:
 *             pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *         raster._data = None
 */
    __pyx_t_6 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "epr.pyx":1873
 *             pyepr_check_errors()
 * 
 *         raster._data = None             # <<<<<<<<<<<<<<
 * 
 *         return raster
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_raster->_data);
  __Pyx_DECREF(__pyx_v_raster->_data);
  __pyx_v_raster->_data = Py_None;

  /* "epr.pyx":1875
 *         raster._data = None
 * 
 *         return raster             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_raster));
  __pyx_r = ((PyObject *)__pyx_v_raster);
  goto __pyx_L0;

  __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_AddTraceback("epr.Band.read_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_raster);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_5read_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_4Band_4read_raster[] = "read_raster(self, xoffset=0, yoffset=0, Raster raster=None)\n\n        Reads (geo-)physical values of the band of the specified\n        source-region\n\n        The source-region is a defined part of the whole ENVISAT\n        product image, which shall be read into a raster.\n        In this routine the co-ordinates are specified, where the\n        source-region to be read starts.\n        The dimension of the region and the sub-sampling are attributes\n        of the raster into which the data are read.\n\n        :param xoffset:\n            across-track source co-ordinate in pixel co-ordinates\n            (zero-based) of the upper right corner of the source-region\n        :param yoffset:\n            along-track source co-ordinate in pixel co-ordinates\n            (zero-based) of the upper right corner of the source-region\n        :param raster:\n            :class:`Raster` instance set with appropriate parameters to\n            read into. If not provided a new :class:`Raster` is\n            instantiated\n        :returns:\n            the :class:`Raster` instance in which data are read\n\n        This method raises an instance of the appropriate\n        :exc:`EPRError` sub-class if case of errors\n\n        .. seealso:: :meth:`Band.create_compatible_raster` and\n                     :func:`create_raster`\n\n        ";
static PyObject *__pyx_pw_3epr_4Band_5read_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_xoffset;
  int __pyx_v_yoffset;
  struct __pyx_obj_3epr_Raster *__pyx_v_raster = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_raster (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__xoffset,&__pyx_n_s__yoffset,&__pyx_n_s__raster,0};
    PyObject* values[3] = {0,0,0};

    /* "epr.pyx":1827
 *         return new_raster(raster_ptr, self)
 * 
 *     cpdef read_raster(self, int xoffset=0, int yoffset=0, Raster raster=None):             # <<<<<<<<<<<<<<
 *         '''read_raster(self, xoffset=0, yoffset=0, Raster raster=None)
 * 
 */
    values[2] = (PyObject *)((struct __pyx_obj_3epr_Raster *)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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xoffset);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yoffset);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__raster);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_xoffset = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_xoffset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xoffset = ((int)0);
    }
    if (values[1]) {
      __pyx_v_yoffset = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_yoffset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_yoffset = ((int)0);
    }
    __pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_raster", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Band.read_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_raster), __pyx_ptype_3epr_Raster, 1, "raster", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_3epr_4Band_4read_raster(((struct __pyx_obj_3epr_Band *)__pyx_v_self), __pyx_v_xoffset, __pyx_v_yoffset, __pyx_v_raster);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3epr_4Band_4read_raster(struct __pyx_obj_3epr_Band *__pyx_v_self, int __pyx_v_xoffset, int __pyx_v_yoffset, struct __pyx_obj_3epr_Raster *__pyx_v_raster) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3epr_4Band_read_raster __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_raster", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.xoffset = __pyx_v_xoffset;
  __pyx_t_2.yoffset = __pyx_v_yoffset;
  __pyx_t_2.raster = __pyx_v_raster;
  __pyx_t_1 = ((struct __pyx_vtabstruct_3epr_Band *)__pyx_v_self->__pyx_vtab)->read_raster(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.read_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_7read_as_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_4Band_6read_as_array[] = "read_as_array(self, width=None, height=None, xoffset=0, yoffset=0, xstep=1, ystep=1):\n\n        Reads the specified source region as an :class:`numpy.ndarray`\n\n        The source-region is a defined part of the whole ENVISAT\n        product image, which shall be read into a raster.\n        In this routine the co-ordinates are specified, where the\n        source-region to be read starts.\n        The dimension of the region and the sub-sampling are attributes\n        of the raster into which the data are read.\n\n        :param src_width:\n            the width (across track dimension) of the source to be read\n            into the raster. If not provided reads as much as possible\n        :param src_height:\n            the height (along track dimension) of the source to be read\n            into the raster. If not provided reads as much as possible\n        :param xoffset:\n            across-track source co-ordinate in pixel co-ordinates\n            (zero-based) of the upper right corner of the source-region\n        :param yoffset:\n            along-track source co-ordinate in pixel co-ordinates\n            (zero-based) of the upper right corner of the source-region\n        :param xstep:\n            the sub-sampling step across track of the source when\n            reading into the raster\n        :param ystep:\n            the sub-sampling step along track of the source when\n            reading into the raster\n        :returns:\n            the :class:`numpy.ndarray` instance in which data are read\n\n        This method raises an instance of the appropriate\n        :exc:`EPRError` sub-class if case of errors\n\n        .. seealso:: :meth:`Band.create_compatible_raster`,\n                     :func:`create_raster` and :meth:`Band.read_raster`\n\n        ";
static PyObject *__pyx_pw_3epr_4Band_7read_as_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  uint __pyx_v_xoffset;
  uint __pyx_v_yoffset;
  uint __pyx_v_xstep;
  uint __pyx_v_ystep;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_as_array (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__width,&__pyx_n_s__height,&__pyx_n_s__xoffset,&__pyx_n_s__yoffset,&__pyx_n_s__xstep,&__pyx_n_s__ystep,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "epr.pyx":1878
 * 
 *     # --- high level interface ------------------------------------------------
 *     def read_as_array(self, width=None, height=None,             # <<<<<<<<<<<<<<
 *                       uint xoffset=0, uint yoffset=0,
 *                       uint xstep=1, uint ystep=1):
 */
    values[0] = ((PyObject *)Py_None);
    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  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s__width);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__height);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xoffset);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yoffset);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xstep);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ystep);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_as_array") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_width = values[0];
    __pyx_v_height = values[1];
    if (values[2]) {
      __pyx_v_xoffset = __Pyx_PyInt_from_py_uint(values[2]); if (unlikely((__pyx_v_xoffset == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xoffset = ((uint)0);
    }
    if (values[3]) {
      __pyx_v_yoffset = __Pyx_PyInt_from_py_uint(values[3]); if (unlikely((__pyx_v_yoffset == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_yoffset = ((uint)0);
    }
    if (values[4]) {
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(values[4]); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xstep = ((uint)1);
    }
    if (values[5]) {
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(values[5]); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ystep = ((uint)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_as_array", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Band.read_as_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_4Band_6read_as_array(((struct __pyx_obj_3epr_Band *)__pyx_v_self), __pyx_v_width, __pyx_v_height, __pyx_v_xoffset, __pyx_v_yoffset, __pyx_v_xstep, __pyx_v_ystep);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3epr_4Band_6read_as_array(struct __pyx_obj_3epr_Band *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, uint __pyx_v_xoffset, uint __pyx_v_yoffset, uint __pyx_v_xstep, uint __pyx_v_ystep) {
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_raster = 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;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_3epr_4Band_read_raster __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_as_array", 0);
  __Pyx_INCREF(__pyx_v_width);
  __Pyx_INCREF(__pyx_v_height);

  /* "epr.pyx":1921
 *         '''
 * 
 *         if width is None:             # <<<<<<<<<<<<<<
 *             w = self.product.get_scene_width()
 *             if w > xoffset:
 */
  __pyx_t_1 = (__pyx_v_width == Py_None);
  if (__pyx_t_1) {

    /* "epr.pyx":1922
 * 
 *         if width is None:
 *             w = self.product.get_scene_width()             # <<<<<<<<<<<<<<
 *             if w > xoffset:
 *                 width = w - xoffset
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__product); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_scene_width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_w = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "epr.pyx":1923
 *         if width is None:
 *             w = self.product.get_scene_width()
 *             if w > xoffset:             # <<<<<<<<<<<<<<
 *                 width = w - xoffset
 *             else:
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_xoffset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_w, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "epr.pyx":1924
 *             w = self.product.get_scene_width()
 *             if w > xoffset:
 *                 width = w - xoffset             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError('xoffset os larger that he scene width')
 */
      __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_xoffset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyNumber_Subtract(__pyx_v_w, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_width);
      __pyx_v_width = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "epr.pyx":1926
 *                 width = w - xoffset
 *             else:
 *                 raise ValueError('xoffset os larger that he scene width')             # <<<<<<<<<<<<<<
 * 
 *         if height is None:
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1928
 *                 raise ValueError('xoffset os larger that he scene width')
 * 
 *         if height is None:             # <<<<<<<<<<<<<<
 *             h = self.product.get_scene_height()
 *             if h > yoffset:
 */
  __pyx_t_1 = (__pyx_v_height == Py_None);
  if (__pyx_t_1) {

    /* "epr.pyx":1929
 * 
 *         if height is None:
 *             h = self.product.get_scene_height()             # <<<<<<<<<<<<<<
 *             if h > yoffset:
 *                 height = h - yoffset
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__product); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_scene_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_h = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "epr.pyx":1930
 *         if height is None:
 *             h = self.product.get_scene_height()
 *             if h > yoffset:             # <<<<<<<<<<<<<<
 *                 height = h - yoffset
 *             else:
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_yoffset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_h, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "epr.pyx":1931
 *             h = self.product.get_scene_height()
 *             if h > yoffset:
 *                 height = h - yoffset             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError('yoffset os larger that he scene height')
 */
      __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_yoffset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyNumber_Subtract(__pyx_v_h, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_height);
      __pyx_v_height = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "epr.pyx":1933
 *                 height = h - yoffset
 *             else:
 *                 raise ValueError('yoffset os larger that he scene height')             # <<<<<<<<<<<<<<
 * 
 *         raster = self.create_compatible_raster(width, height, xstep, ystep)
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "epr.pyx":1935
 *                 raise ValueError('yoffset os larger that he scene height')
 * 
 *         raster = self.create_compatible_raster(width, height, xstep, ystep)             # <<<<<<<<<<<<<<
 *         self.read_raster(xoffset, yoffset, raster)
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_47); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_xstep); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_ystep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __Pyx_INCREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_v_raster = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "epr.pyx":1936
 * 
 *         raster = self.create_compatible_raster(width, height, xstep, ystep)
 *         self.read_raster(xoffset, yoffset, raster)             # <<<<<<<<<<<<<<
 * 
 *         return raster.data
 */
  if (!(likely(((__pyx_v_raster) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_raster, __pyx_ptype_3epr_Raster))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __pyx_v_raster;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6.__pyx_n = 3;
  __pyx_t_6.xoffset = __pyx_v_xoffset;
  __pyx_t_6.yoffset = __pyx_v_yoffset;
  __pyx_t_6.raster = ((struct __pyx_obj_3epr_Raster *)__pyx_t_4);
  __pyx_t_5 = ((struct __pyx_vtabstruct_3epr_Band *)__pyx_v_self->__pyx_vtab)->read_raster(__pyx_v_self, 0, &__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __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;

  /* "epr.pyx":1938
 *         self.read_raster(xoffset, yoffset, raster)
 * 
 *         return raster.data             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_raster, __pyx_n_s__data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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("epr.Band.read_as_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_raster);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_4Band_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_4Band_9__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_4Band_8__repr__(((struct __pyx_obj_3epr_Band *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1940
 *         return raster.data
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.Band(%s) of epr.Product(%s)' % (self.get_name(),
 *                                                     self.product.id_string)
 */

static PyObject *__pyx_pf_3epr_4Band_8__repr__(struct __pyx_obj_3epr_Band *__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);

  /* "epr.pyx":1941
 * 
 *     def __repr__(self):
 *         return 'epr.Band(%s) of epr.Product(%s)' % (self.get_name(),             # <<<<<<<<<<<<<<
 *                                                     self.product.id_string)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":1942
 *     def __repr__(self):
 *         return 'epr.Band(%s) of epr.Product(%s)' % (self.get_name(),
 *                                                     self.product.id_string)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__product); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__id_string); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_52), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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("epr.Band.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1945
 * 
 * 
 * cdef new_band(EPR_SBandId* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static PyObject *__pyx_f_3epr_new_band(EPR_SBandId *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_band *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_Band *__pyx_v_instance = 0;
  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("new_band", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }

  /* "epr.pyx":1946
 * 
 * cdef new_band(EPR_SBandId* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1947
 * cdef new_band(EPR_SBandId* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Band instance = Band.__new__(Band)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":1949
 *         pyepr_null_ptr_error()
 * 
 *     cdef Band instance = Band.__new__(Band)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Band)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr_Band)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Band *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "epr.pyx":1951
 *     cdef Band instance = Band.__new__(Band)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 * 
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "epr.pyx":1952
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "epr.pyx":1954
 *     instance._parent = parent
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_band", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_7product_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Dataset_7product_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_7product___get__(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1976
 *         '''The :class:`Product` instance to which this dataset belongs to'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._parent
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_7product___get__(struct __pyx_obj_3epr_Dataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":1977
 * 
 *         def __get__(self):
 *             return self._parent             # <<<<<<<<<<<<<<
 * 
 *     property description:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_parent);
  __pyx_r = __pyx_v_self->_parent;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_11description_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Dataset_11description_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_11description___get__(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1982
 *         '''A short description of the band's contents'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.description is NULL:
 *                 return ''
 */

static PyObject *__pyx_pf_3epr_7Dataset_11description___get__(struct __pyx_obj_3epr_Dataset *__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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":1983
 * 
 *         def __get__(self):
 *             if self._ptr.description is NULL:             # <<<<<<<<<<<<<<
 *                 return ''
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->_ptr->description == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1984
 *         def __get__(self):
 *             if self._ptr.description is NULL:
 *                 return ''             # <<<<<<<<<<<<<<
 *             else:
 *                 return _to_str(self._ptr.description, 'ascii')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
    __pyx_r = ((PyObject *)__pyx_kp_s_2);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":1986
 *                 return ''
 *             else:
 *                 return _to_str(self._ptr.description, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_ptr->description); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __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("epr.Dataset.description.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_1get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_get_name[] = "get_name(self)\n\n        Gets the name of the dataset\n\n        ";
static PyObject *__pyx_pw_3epr_7Dataset_1get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_get_name(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":1988
 *                 return _to_str(self._ptr.description, 'ascii')
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         '''get_name(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_get_name(struct __pyx_obj_3epr_Dataset *__pyx_v_self) {
  char *__pyx_v_name;
  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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_name", 0);

  /* "epr.pyx":1997
 *         cdef char* name
 * 
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             name = <char*>epr_get_dataset_name(self._ptr)
 *             return _to_str(name, 'ascii')
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":1998
 * 
 *         if self._ptr is not NULL:
 *             name = <char*>epr_get_dataset_name(self._ptr)             # <<<<<<<<<<<<<<
 *             return _to_str(name, 'ascii')
 *         return ''
 */
    __pyx_v_name = ((char *)epr_get_dataset_name(__pyx_v_self->_ptr));

    /* "epr.pyx":1999
 *         if self._ptr is not NULL:
 *             name = <char*>epr_get_dataset_name(self._ptr)
 *             return _to_str(name, 'ascii')             # <<<<<<<<<<<<<<
 *         return ''
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2000
 *             name = <char*>epr_get_dataset_name(self._ptr)
 *             return _to_str(name, 'ascii')
 *         return ''             # <<<<<<<<<<<<<<
 * 
 *     def get_dsd_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  __pyx_r = ((PyObject *)__pyx_kp_s_2);
  goto __pyx_L0;

  __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("epr.Dataset.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_3get_dsd_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_2get_dsd_name[] = "get_dsd_name(self)\n\n        Gets the name of the DSD (dataset descriptor)\n\n        ";
static PyObject *__pyx_pw_3epr_7Dataset_3get_dsd_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_dsd_name (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_2get_dsd_name(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2002
 *         return ''
 * 
 *     def get_dsd_name(self):             # <<<<<<<<<<<<<<
 *         '''get_dsd_name(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_2get_dsd_name(struct __pyx_obj_3epr_Dataset *__pyx_v_self) {
  char *__pyx_v_name;
  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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dsd_name", 0);

  /* "epr.pyx":2011
 *         cdef char* name
 * 
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             name = <char*>epr_get_dsd_name(self._ptr)
 *             return _to_str(name, 'ascii')
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2012
 * 
 *         if self._ptr is not NULL:
 *             name = <char*>epr_get_dsd_name(self._ptr)             # <<<<<<<<<<<<<<
 *             return _to_str(name, 'ascii')
 *         return ''
 */
    __pyx_v_name = ((char *)epr_get_dsd_name(__pyx_v_self->_ptr));

    /* "epr.pyx":2013
 *         if self._ptr is not NULL:
 *             name = <char*>epr_get_dsd_name(self._ptr)
 *             return _to_str(name, 'ascii')             # <<<<<<<<<<<<<<
 *         return ''
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2014
 *             name = <char*>epr_get_dsd_name(self._ptr)
 *             return _to_str(name, 'ascii')
 *         return ''             # <<<<<<<<<<<<<<
 * 
 *     def get_num_records(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  __pyx_r = ((PyObject *)__pyx_kp_s_2);
  goto __pyx_L0;

  __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("epr.Dataset.get_dsd_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_5get_num_records(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_4get_num_records[] = "get_num_records(self)\n\n        Gets the number of records of the dataset\n\n        ";
static PyObject *__pyx_pw_3epr_7Dataset_5get_num_records(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_records (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_4get_num_records(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2016
 *         return ''
 * 
 *     def get_num_records(self):             # <<<<<<<<<<<<<<
 *         '''get_num_records(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_4get_num_records(struct __pyx_obj_3epr_Dataset *__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_records", 0);

  /* "epr.pyx":2023
 *         '''
 * 
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             return epr_get_num_records(self._ptr)
 *         return 0
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2024
 * 
 *         if self._ptr is not NULL:
 *             return epr_get_num_records(self._ptr)             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(epr_get_num_records(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2025
 *         if self._ptr is not NULL:
 *             return epr_get_num_records(self._ptr)
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def get_dsd(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_r = __pyx_int_0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Dataset.get_num_records", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_7get_dsd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_6get_dsd[] = "get_dsd(self)\n\n        Gets the dataset descriptor (DSD)\n\n        ";
static PyObject *__pyx_pw_3epr_7Dataset_7get_dsd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_dsd (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_6get_dsd(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2027
 *         return 0
 * 
 *     def get_dsd(self):             # <<<<<<<<<<<<<<
 *         '''get_dsd(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_6get_dsd(struct __pyx_obj_3epr_Dataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3epr_new_dsd __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dsd", 0);

  /* "epr.pyx":2034
 *         '''
 * 
 *         return new_dsd(<EPR_SDSD*>epr_get_dsd(self._ptr), self)             # <<<<<<<<<<<<<<
 * 
 *     def create_record(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_1 = __pyx_f_3epr_new_dsd(((EPR_SDSD *)epr_get_dsd(__pyx_v_self->_ptr)), &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Dataset.get_dsd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_9create_record(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_8create_record[] = "create_record(self)\n\n        Creates a new record\n\n        Creates a new, empty record with a structure compatible with\n        the dataset. Such a record is typically used in subsequent\n        calls to :meth:`Dataset.read_record`.\n\n        :returns:\n            the new record instance\n\n        ";
static PyObject *__pyx_pw_3epr_7Dataset_9create_record(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_record (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_8create_record(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2036
 *         return new_dsd(<EPR_SDSD*>epr_get_dsd(self._ptr), self)
 * 
 *     def create_record(self):             # <<<<<<<<<<<<<<
 *         '''create_record(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_8create_record(struct __pyx_obj_3epr_Dataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3epr_new_record __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_record", 0);

  /* "epr.pyx":2050
 *         '''
 * 
 *         return new_record(epr_create_record(self._ptr), self, True)             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: default: index=0
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_2.dealloc = 1;
  __pyx_t_1 = __pyx_f_3epr_new_record(epr_create_record(__pyx_v_self->_ptr), &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Dataset.create_record", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_11read_record(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_7Dataset_10read_record[] = "read_record(self, index, record=None)\n\n        Reads specified record of the dataset\n\n        The record is identified through the given zero-based record\n        index. In order to reduce memory reallocation, a record\n        (pre-)created by the method :meth:`Dataset.create_record` can\n        be passed to this method.\n        Data is then read into this given record.\n\n        If no record (``None``) is given, the method initiates a new\n        one.\n\n        In both cases, the record in which the data is read into will\n        be  returned.\n\n        :param index:\n            the zero-based record index\n        :param record:\n            a pre-created record to reduce memory reallocation, can be\n            ``None`` (default) to let the function allocate a new\n            record\n        :returns:\n            the record in which the data has been read into or raises\n            an exception (:exc:`EPRValueError`) if an error occurred\n\n        ";
static PyObject *__pyx_pw_3epr_7Dataset_11read_record(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_index;
  struct __pyx_obj_3epr_Record *__pyx_v_record = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_record (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__record,0};
    PyObject* values[2] = {0,0};

    /* "epr.pyx":2053
 * 
 *     # @TODO: default: index=0
 *     def read_record(self, uint index, Record record=None):             # <<<<<<<<<<<<<<
 *         '''read_record(self, index, record=None)
 * 
 */
    values[1] = (PyObject *)((struct __pyx_obj_3epr_Record *)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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__record);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_record") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_record = ((struct __pyx_obj_3epr_Record *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_record", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Dataset.read_record", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record), __pyx_ptype_3epr_Record, 1, "record", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_3epr_7Dataset_10read_record(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self), __pyx_v_index, __pyx_v_record);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3epr_7Dataset_10read_record(struct __pyx_obj_3epr_Dataset *__pyx_v_self, uint __pyx_v_index, struct __pyx_obj_3epr_Record *__pyx_v_record) {
  EPR_SRecord *__pyx_v_record_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  EPR_SRecord *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_3epr_new_record __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_record", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_record);

  /* "epr.pyx":2082
 *         '''
 * 
 *         cdef EPR_SRecord* record_ptr = NULL             # <<<<<<<<<<<<<<
 *         if record:
 *             record_ptr = (<Record>record)._ptr
 */
  __pyx_v_record_ptr = NULL;

  /* "epr.pyx":2083
 * 
 *         cdef EPR_SRecord* record_ptr = NULL
 *         if record:             # <<<<<<<<<<<<<<
 *             record_ptr = (<Record>record)._ptr
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_record)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "epr.pyx":2084
 *         cdef EPR_SRecord* record_ptr = NULL
 *         if record:
 *             record_ptr = (<Record>record)._ptr             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_2 = __pyx_v_record->_ptr;
    __pyx_v_record_ptr = __pyx_t_2;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2086
 *             record_ptr = (<Record>record)._ptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             record_ptr = epr_read_record(self._ptr, index, record_ptr)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "epr.pyx":2087
 * 
 *         with nogil:
 *             record_ptr = epr_read_record(self._ptr, index, record_ptr)             # <<<<<<<<<<<<<<
 * 
 *         if record_ptr is NULL:
 */
        __pyx_v_record_ptr = epr_read_record(__pyx_v_self->_ptr, __pyx_v_index, __pyx_v_record_ptr);
      }

      /* "epr.pyx":2086
 *             record_ptr = (<Record>record)._ptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             record_ptr = epr_read_record(self._ptr, index, record_ptr)
 * 
 */
      /*finally:*/ {
        Py_BLOCK_THREADS
      }
  }

  /* "epr.pyx":2089
 *             record_ptr = epr_read_record(self._ptr, index, record_ptr)
 * 
 *         if record_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to read record at index %d' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_record_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2090
 * 
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to read record at index %d' % index)             # <<<<<<<<<<<<<<
 * 
 *         if not record:
 */
    __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_53), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.msg = ((PyObject *)__pyx_t_4);
    __pyx_t_5 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_6); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "epr.pyx":2092
 *             pyepr_null_ptr_error('unable to read record at index %d' % index)
 * 
 *         if not record:             # <<<<<<<<<<<<<<
 *             record = new_record(record_ptr, self, True)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_record)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = (!__pyx_t_1);
  if (__pyx_t_7) {

    /* "epr.pyx":2093
 * 
 *         if not record:
 *             record = new_record(record_ptr, self, True)             # <<<<<<<<<<<<<<
 * 
 *         return record
 */
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.parent = ((PyObject *)__pyx_v_self);
    __pyx_t_8.dealloc = 1;
    __pyx_t_4 = __pyx_f_3epr_new_record(__pyx_v_record_ptr, &__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3epr_Record))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_record));
    __pyx_v_record = ((struct __pyx_obj_3epr_Record *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "epr.pyx":2095
 *             record = new_record(record_ptr, self, True)
 * 
 *         return record             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_record));
  __pyx_r = ((PyObject *)__pyx_v_record);
  goto __pyx_L0;

  __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_AddTraceback("epr.Dataset.read_record", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_record);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_13records(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_12records[] = "records(self)\n\n        Return the list of records contained in the dataset\n\n        ";
static PyObject *__pyx_pw_3epr_7Dataset_13records(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("records (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_12records(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2100
 *     # @NOTE: generator and generator expressions are not yet implemented in
 *     #        cython. As a workaround a list is used
 *     def records(self):             # <<<<<<<<<<<<<<
 *         '''records(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_12records(struct __pyx_obj_3epr_Dataset *__pyx_v_self) {
  int __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint __pyx_t_2;
  int __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("records", 0);

  /* "epr.pyx":2110
 *         #return list(self)
 *         cdef int idx
 *         return [self.read_record(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_records(self._ptr))]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "epr.pyx":2111
 *         cdef int idx
 *         return [self.read_record(idx)
 *                             for idx in range(epr_get_num_records(self._ptr))]             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_2 = epr_get_num_records(__pyx_v_self->_ptr);
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_idx = __pyx_t_3;

    /* "epr.pyx":2110
 *         #return list(self)
 *         cdef int idx
 *         return [self.read_record(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_records(self._ptr))]
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_record); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Dataset.records", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_15__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Dataset_15__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_14__iter__(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2113
 *                             for idx in range(epr_get_num_records(self._ptr))]
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         # @TODO: use generator expression when it will be available
 *         #return (self.get_field_at(idx)
 */

static PyObject *__pyx_pf_3epr_7Dataset_14__iter__(struct __pyx_obj_3epr_Dataset *__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("__iter__", 0);

  /* "epr.pyx":2117
 *         #return (self.get_field_at(idx)
 *         #                    for idx in range(epr_get_num_elems(self._ptr)))
 *         return iter(self.records())             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__records); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __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;

  __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_AddTraceback("epr.Dataset.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_17__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Dataset_17__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_16__str__(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2119
 *         return iter(self.records())
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         lines = [repr(self), '']
 *         lines.extend(map(str, self))
 */

static PyObject *__pyx_pf_3epr_7Dataset_16__str__(struct __pyx_obj_3epr_Dataset *__pyx_v_self) {
  PyObject *__pyx_v_lines = 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("__str__", 0);

  /* "epr.pyx":2120
 * 
 *     def __str__(self):
 *         lines = [repr(self), '']             # <<<<<<<<<<<<<<
 *         lines.extend(map(str, self))
 *         return '\n'.join(lines)
 */
  __pyx_t_1 = PyObject_Repr(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
  __pyx_t_1 = 0;
  __pyx_v_lines = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "epr.pyx":2121
 *     def __str__(self):
 *         lines = [repr(self), '']
 *         lines.extend(map(str, self))             # <<<<<<<<<<<<<<
 *         return '\n'.join(lines)
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_lines), __pyx_n_s__extend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_3 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":2122
 *         lines = [repr(self), '']
 *         lines.extend(map(str, self))
 *         return '\n'.join(lines)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_36), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_lines));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_lines));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lines));
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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("epr.Dataset.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lines);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Dataset_19__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Dataset_19__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Dataset_18__repr__(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2124
 *         return '\n'.join(lines)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.Dataset(%s) %d records' % (self.get_name(),
 *                                                self.get_num_records())
 */

static PyObject *__pyx_pf_3epr_7Dataset_18__repr__(struct __pyx_obj_3epr_Dataset *__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);

  /* "epr.pyx":2125
 * 
 *     def __repr__(self):
 *         return 'epr.Dataset(%s) %d records' % (self.get_name(),             # <<<<<<<<<<<<<<
 *                                                self.get_num_records())
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":2126
 *     def __repr__(self):
 *         return 'epr.Dataset(%s) %d records' % (self.get_name(),
 *                                                self.get_num_records())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_records); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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("epr.Dataset.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2129
 * 
 * 
 * cdef new_dataset(EPR_SDatasetId* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static PyObject *__pyx_f_3epr_new_dataset(EPR_SDatasetId *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_dataset *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_Dataset *__pyx_v_instance = 0;
  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("new_dataset", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }

  /* "epr.pyx":2130
 * 
 * cdef new_dataset(EPR_SDatasetId* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2131
 * cdef new_dataset(EPR_SDatasetId* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Dataset instance = Dataset.__new__(Dataset)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2133
 *         pyepr_null_ptr_error()
 * 
 *     cdef Dataset instance = Dataset.__new__(Dataset)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Dataset)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr_Dataset)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Dataset *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "epr.pyx":2135
 *     cdef Dataset instance = Dataset.__new__(Dataset)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 * 
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "epr.pyx":2136
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "epr.pyx":2138
 *     instance._parent = parent
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_dataset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_3epr_7Product_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3epr_7Product_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  __pyx_v_kargs = PyDict_New(); if (unlikely(!__pyx_v_kargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0;
      __Pyx_RefNannyFinishContext();
      return -1;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,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) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kargs, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __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_filename = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0;
  __Pyx_AddTraceback("epr.Product.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_7Product___cinit__(((struct __pyx_obj_3epr_Product *)__pyx_v_self), __pyx_v_filename, __pyx_v_args, __pyx_v_kargs);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2153
 *     cdef EPR_SProductId* _ptr
 * 
 *     def __cinit__(self, filename, *args, **kargs):             # <<<<<<<<<<<<<<
 *         cdef bytes bfilename = _to_bytes(filename, _DEFAULT_FS_ENCODING)
 *         cdef char* cfilename = bfilename
 */

static int __pyx_pf_3epr_7Product___cinit__(struct __pyx_obj_3epr_Product *__pyx_v_self, PyObject *__pyx_v_filename, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kargs) {
  PyObject *__pyx_v_bfilename = 0;
  char *__pyx_v_cfilename;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_3epr__to_bytes __pyx_t_3;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "epr.pyx":2154
 * 
 *     def __cinit__(self, filename, *args, **kargs):
 *         cdef bytes bfilename = _to_bytes(filename, _DEFAULT_FS_ENCODING)             # <<<<<<<<<<<<<<
 *         cdef char* cfilename = bfilename
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_55); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.encoding = __pyx_t_1;
  __pyx_t_2 = ((PyObject *)__pyx_f_3epr__to_bytes(__pyx_v_filename, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_bfilename = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "epr.pyx":2155
 *     def __cinit__(self, filename, *args, **kargs):
 *         cdef bytes bfilename = _to_bytes(filename, _DEFAULT_FS_ENCODING)
 *         cdef char* cfilename = bfilename             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_v_bfilename)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_cfilename = __pyx_t_4;

  /* "epr.pyx":2157
 *         cdef char* cfilename = bfilename
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._ptr = epr_open_product(cfilename)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "epr.pyx":2158
 * 
 *         with nogil:
 *             self._ptr = epr_open_product(cfilename)             # <<<<<<<<<<<<<<
 * 
 *         if self._ptr is NULL:
 */
        __pyx_v_self->_ptr = epr_open_product(__pyx_v_cfilename);
      }

      /* "epr.pyx":2157
 *         cdef char* cfilename = bfilename
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._ptr = epr_open_product(cfilename)
 * 
 */
      /*finally:*/ {
        Py_BLOCK_THREADS
      }
  }

  /* "epr.pyx":2160
 *             self._ptr = epr_open_product(cfilename)
 * 
 *         if self._ptr is NULL:             # <<<<<<<<<<<<<<
 *             # try to get error info from the lib
 *             pyepr_check_errors()
 */
  __pyx_t_5 = (__pyx_v_self->_ptr == NULL);
  if (__pyx_t_5) {

    /* "epr.pyx":2162
 *         if self._ptr is NULL:
 *             # try to get error info from the lib
 *             pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError('unable to open "%s"' % filename)
 */
    __pyx_t_6 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "epr.pyx":2164
 *             pyepr_check_errors()
 * 
 *             raise ValueError('unable to open "%s"' % filename)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_56), __pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Product.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bfilename);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_3epr_7Product_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_3epr_7Product_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_3epr_7Product_2__dealloc__(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "epr.pyx":2166
 *             raise ValueError('unable to open "%s"' % filename)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._ptr is not NULL:
 *             epr_close_product(self._ptr)
 */

static void __pyx_pf_3epr_7Product_2__dealloc__(struct __pyx_obj_3epr_Product *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "epr.pyx":2167
 * 
 *     def __dealloc__(self):
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             epr_close_product(self._ptr)
 *             pyepr_check_errors()
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2168
 *     def __dealloc__(self):
 *         if self._ptr is not NULL:
 *             epr_close_product(self._ptr)             # <<<<<<<<<<<<<<
 *             pyepr_check_errors()
 * 
 */
    epr_close_product(__pyx_v_self->_ptr);

    /* "epr.pyx":2169
 *         if self._ptr is not NULL:
 *             epr_close_product(self._ptr)
 *             pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, filename):
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("epr.Product.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static int __pyx_pw_3epr_7Product_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3epr_7Product_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_filename = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,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);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename)) != 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, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __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_filename = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_7Product_4__init__(((struct __pyx_obj_3epr_Product *)__pyx_v_self), __pyx_v_filename);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2171
 *             pyepr_check_errors()
 * 
 *     def __init__(self, filename):             # <<<<<<<<<<<<<<
 *         # @NOTE: this method suppresses the default behavior of EprObject
 *         #        that is raising an exception when it is instantiated by
 */

static int __pyx_pf_3epr_7Product_4__init__(CYTHON_UNUSED struct __pyx_obj_3epr_Product *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filename) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_9file_path_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Product_9file_path_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_9file_path___get__(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2180
 *         '''The file's path including the file name'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.file_path is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_7Product_9file_path___get__(struct __pyx_obj_3epr_Product *__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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":2181
 * 
 *         def __get__(self):
 *             if self._ptr.file_path is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->_ptr->file_path == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2182
 *         def __get__(self):
 *             if self._ptr.file_path is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return _to_str(self._ptr.file_path, 'ascii')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":2184
 *                 return None
 *             else:
 *                 return _to_str(self._ptr.file_path, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: check
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_ptr->file_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __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("epr.Product.file_path.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_8tot_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Product_8tot_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_8tot_size___get__(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2202
 *         '''The total size in bytes of the product file'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.tot_size
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_8tot_size___get__(struct __pyx_obj_3epr_Product *__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);

  /* "epr.pyx":2203
 * 
 *         def __get__(self):
 *             return self._ptr.tot_size             # <<<<<<<<<<<<<<
 * 
 *     property id_string:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(__pyx_v_self->_ptr->tot_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.tot_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_9id_string_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Product_9id_string_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_9id_string___get__(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2216
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.id_string is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_7Product_9id_string___get__(struct __pyx_obj_3epr_Product *__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;
  struct __pyx_opt_args_3epr__to_str __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "epr.pyx":2217
 * 
 *         def __get__(self):
 *             if self._ptr.id_string is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (__pyx_v_self->_ptr->id_string == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2218
 *         def __get__(self):
 *             if self._ptr.id_string is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return _to_str(self._ptr.id_string, 'ascii')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "epr.pyx":2220
 *                 return None
 *             else:
 *                 return _to_str(self._ptr.id_string, 'ascii')             # <<<<<<<<<<<<<<
 * 
 *     property meris_iodd_version:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_ptr->id_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.encoding = __pyx_t_3;
    __pyx_t_4 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __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("epr.Product.id_string.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_18meris_iodd_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Product_18meris_iodd_version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_18meris_iodd_version___get__(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2225
 *         '''For MERIS L1b and RR and FR to provide backward compatibility'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.meris_iodd_version
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_18meris_iodd_version___get__(struct __pyx_obj_3epr_Product *__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);

  /* "epr.pyx":2226
 * 
 *         def __get__(self):
 *             return self._ptr.meris_iodd_version             # <<<<<<<<<<<<<<
 * 
 *     def get_scene_width(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_ptr->meris_iodd_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.meris_iodd_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_7get_scene_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_6get_scene_width[] = "get_scene_width(self)\n\n        Gets the product's scene width in pixels\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_7get_scene_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_scene_width (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_6get_scene_width(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2228
 *             return self._ptr.meris_iodd_version
 * 
 *     def get_scene_width(self):             # <<<<<<<<<<<<<<
 *         '''get_scene_width(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_6get_scene_width(struct __pyx_obj_3epr_Product *__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_scene_width", 0);

  /* "epr.pyx":2235
 *         '''
 * 
 *         return epr_get_scene_width(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_scene_height(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_scene_width(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_scene_width", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_9get_scene_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_8get_scene_height[] = "get_scene_height(self)\n\n        Gets the product's scene height in pixels\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_9get_scene_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_scene_height (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_8get_scene_height(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2237
 *         return epr_get_scene_width(self._ptr)
 * 
 *     def get_scene_height(self):             # <<<<<<<<<<<<<<
 *         '''get_scene_height(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_8get_scene_height(struct __pyx_obj_3epr_Product *__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_scene_height", 0);

  /* "epr.pyx":2244
 *         '''
 * 
 *         return epr_get_scene_height(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_num_datasets(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_scene_height(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_scene_height", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_11get_num_datasets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_10get_num_datasets[] = "get_num_datasets(self)\n\n        Gets the number of all datasets contained in a product\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_11get_num_datasets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_datasets (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_10get_num_datasets(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2246
 *         return epr_get_scene_height(self._ptr)
 * 
 *     def get_num_datasets(self):             # <<<<<<<<<<<<<<
 *         '''get_num_datasets(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_10get_num_datasets(struct __pyx_obj_3epr_Product *__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_num_datasets", 0);

  /* "epr.pyx":2253
 *         '''
 * 
 *         return epr_get_num_datasets(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_num_dsds(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_num_datasets(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_num_datasets", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_13get_num_dsds(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_12get_num_dsds[] = "get_num_dsds(self)\n\n        Gets the number of all :class:`DSD`\\ s\n\n        Gets the number of all :class:`DSD`\\ s (dataset descriptors)\n        contained in the product\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_13get_num_dsds(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_dsds (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_12get_num_dsds(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2255
 *         return epr_get_num_datasets(self._ptr)
 * 
 *     def get_num_dsds(self):             # <<<<<<<<<<<<<<
 *         '''get_num_dsds(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_12get_num_dsds(struct __pyx_obj_3epr_Product *__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_num_dsds", 0);

  /* "epr.pyx":2265
 *         '''
 * 
 *         return epr_get_num_dsds(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_num_bands(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_num_dsds(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_num_dsds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_15get_num_bands(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_14get_num_bands[] = "get_num_bands(self)\n\n        Gets the number of all bands contained in a product\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_15get_num_bands(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_bands (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_14get_num_bands(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2267
 *         return epr_get_num_dsds(self._ptr)
 * 
 *     def get_num_bands(self):             # <<<<<<<<<<<<<<
 *         '''get_num_bands(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_14get_num_bands(struct __pyx_obj_3epr_Product *__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_num_bands", 0);

  /* "epr.pyx":2274
 *         '''
 * 
 *         return epr_get_num_bands(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_dataset_at(self, uint index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_num_bands(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_num_bands", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_17get_dataset_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_3epr_7Product_16get_dataset_at[] = "get_dataset_at(self, index)\n\n        Gets the dataset at the specified position within the product\n\n        :param index:\n            the index identifying the position of the dataset, starting\n            with 0, must not be negative\n        :returns:\n            the requested :class:`Dataset`\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_17get_dataset_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  uint __pyx_v_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_dataset_at (wrapper)", 0);
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_from_py_uint(__pyx_arg_index); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.get_dataset_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_7Product_16get_dataset_at(((struct __pyx_obj_3epr_Product *)__pyx_v_self), ((uint)__pyx_v_index));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2276
 *         return epr_get_num_bands(self._ptr)
 * 
 *     def get_dataset_at(self, uint index):             # <<<<<<<<<<<<<<
 *         '''get_dataset_at(self, index)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_16get_dataset_at(struct __pyx_obj_3epr_Product *__pyx_v_self, uint __pyx_v_index) {
  EPR_SDatasetId *__pyx_v_dataset_id;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_dataset __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dataset_at", 0);

  /* "epr.pyx":2290
 * 
 *         cdef EPR_SDatasetId* dataset_id
 *         dataset_id = epr_get_dataset_id_at(self._ptr, index)             # <<<<<<<<<<<<<<
 *         if dataset_id is NULL:
 *             pyepr_null_ptr_error('unable to get dataset at index %d' % index)
 */
  __pyx_v_dataset_id = epr_get_dataset_id_at(__pyx_v_self->_ptr, __pyx_v_index);

  /* "epr.pyx":2291
 *         cdef EPR_SDatasetId* dataset_id
 *         dataset_id = epr_get_dataset_id_at(self._ptr, index)
 *         if dataset_id is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get dataset at index %d' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_dataset_id == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2292
 *         dataset_id = epr_get_dataset_id_at(self._ptr, index)
 *         if dataset_id is NULL:
 *             pyepr_null_ptr_error('unable to get dataset at index %d' % index)             # <<<<<<<<<<<<<<
 * 
 *         return new_dataset(dataset_id, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_57), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = ((PyObject *)__pyx_t_3);
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2294
 *             pyepr_null_ptr_error('unable to get dataset at index %d' % index)
 * 
 *         return new_dataset(dataset_id, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_dataset(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_3 = __pyx_f_3epr_new_dataset(__pyx_v_dataset_id, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Product.get_dataset_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_19get_dataset(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_3epr_7Product_18get_dataset[] = "get_dataset(self, name)\n\n        Gets the dataset corresponding to the specified dataset name\n\n        :param name:\n            the dataset name\n        :returns:\n            the requested :class:`Dataset` instance\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_19get_dataset(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_dataset (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_18get_dataset(((struct __pyx_obj_3epr_Product *)__pyx_v_self), ((PyObject *)__pyx_v_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2296
 *         return new_dataset(dataset_id, self)
 * 
 *     def get_dataset(self, name):             # <<<<<<<<<<<<<<
 *         '''get_dataset(self, name)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_18get_dataset(struct __pyx_obj_3epr_Product *__pyx_v_self, PyObject *__pyx_v_name) {
  EPR_SDatasetId *__pyx_v_dataset_id;
  PyObject *__pyx_v_cname = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_dataset __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dataset", 0);

  /* "epr.pyx":2309
 * 
 *         cdef EPR_SDatasetId* dataset_id
 *         cdef bytes cname = _to_bytes(name)             # <<<<<<<<<<<<<<
 *         dataset_id = epr_get_dataset_id(self._ptr, cname)
 *         if dataset_id is NULL:
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_3epr__to_bytes(__pyx_v_name, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cname = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "epr.pyx":2310
 *         cdef EPR_SDatasetId* dataset_id
 *         cdef bytes cname = _to_bytes(name)
 *         dataset_id = epr_get_dataset_id(self._ptr, cname)             # <<<<<<<<<<<<<<
 *         if dataset_id is NULL:
 *             pyepr_null_ptr_error(r'unable to get dataset "%s"' % name)
 */
  __pyx_t_2 = PyBytes_AsString(((PyObject *)__pyx_v_cname)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dataset_id = epr_get_dataset_id(__pyx_v_self->_ptr, __pyx_t_2);

  /* "epr.pyx":2311
 *         cdef bytes cname = _to_bytes(name)
 *         dataset_id = epr_get_dataset_id(self._ptr, cname)
 *         if dataset_id is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error(r'unable to get dataset "%s"' % name)
 * 
 */
  __pyx_t_3 = (__pyx_v_dataset_id == NULL);
  if (__pyx_t_3) {

    /* "epr.pyx":2312
 *         dataset_id = epr_get_dataset_id(self._ptr, cname)
 *         if dataset_id is NULL:
 *             pyepr_null_ptr_error(r'unable to get dataset "%s"' % name)             # <<<<<<<<<<<<<<
 * 
 *         return new_dataset(dataset_id, self)
 */
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_58), __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = ((PyObject *)__pyx_t_1);
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2314
 *             pyepr_null_ptr_error(r'unable to get dataset "%s"' % name)
 * 
 *         return new_dataset(dataset_id, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_dsd_at(self, uint index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_1 = __pyx_f_3epr_new_dataset(__pyx_v_dataset_id, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_dataset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_21get_dsd_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_3epr_7Product_20get_dsd_at[] = "get_dsd_at(self, index)\n\n        Gets the :class:`DSD` at the specified position\n\n        Gets the :class:`DSD` (dataset descriptor) at the specified\n        position within the product.\n\n        :param index:\n            the index identifying the position of the :class:`DSD`,\n            starting with 0, must not be negative\n        :returns:\n            the requested :class:`DSD` instance\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_21get_dsd_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  uint __pyx_v_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_dsd_at (wrapper)", 0);
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_from_py_uint(__pyx_arg_index); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.get_dsd_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_7Product_20get_dsd_at(((struct __pyx_obj_3epr_Product *)__pyx_v_self), ((uint)__pyx_v_index));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2316
 *         return new_dataset(dataset_id, self)
 * 
 *     def get_dsd_at(self, uint index):             # <<<<<<<<<<<<<<
 *         '''get_dsd_at(self, index)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_20get_dsd_at(struct __pyx_obj_3epr_Product *__pyx_v_self, uint __pyx_v_index) {
  EPR_SDSD *__pyx_v_dsd_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_dsd __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dsd_at", 0);

  /* "epr.pyx":2333
 * 
 *         cdef EPR_SDSD* dsd_ptr
 *         dsd_ptr = epr_get_dsd_at(self._ptr, index)             # <<<<<<<<<<<<<<
 *         if dsd_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get DSD at index "%d"' % index)
 */
  __pyx_v_dsd_ptr = epr_get_dsd_at(__pyx_v_self->_ptr, __pyx_v_index);

  /* "epr.pyx":2334
 *         cdef EPR_SDSD* dsd_ptr
 *         dsd_ptr = epr_get_dsd_at(self._ptr, index)
 *         if dsd_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get DSD at index "%d"' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_dsd_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2335
 *         dsd_ptr = epr_get_dsd_at(self._ptr, index)
 *         if dsd_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get DSD at index "%d"' % index)             # <<<<<<<<<<<<<<
 * 
 *         return new_dsd(dsd_ptr, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_59), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = ((PyObject *)__pyx_t_3);
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2337
 *             pyepr_null_ptr_error('unable to get DSD at index "%d"' % index)
 * 
 *         return new_dsd(dsd_ptr, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_mph(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_3 = __pyx_f_3epr_new_dsd(__pyx_v_dsd_ptr, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Product.get_dsd_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_23get_mph(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_22get_mph[] = "get_mph(self)\n\n        The main product header (MPH) :class:`Record`\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_23get_mph(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_mph (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_22get_mph(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2339
 *         return new_dsd(dsd_ptr, self)
 * 
 *     def get_mph(self):             # <<<<<<<<<<<<<<
 *         '''get_mph(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_22get_mph(struct __pyx_obj_3epr_Product *__pyx_v_self) {
  EPR_SRecord *__pyx_v_record_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_4;
  struct __pyx_opt_args_3epr_new_record __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_mph", 0);

  /* "epr.pyx":2347
 * 
 *         cdef EPR_SRecord* record_ptr
 *         record_ptr = epr_get_mph(self._ptr)             # <<<<<<<<<<<<<<
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get MPH record')
 */
  __pyx_v_record_ptr = epr_get_mph(__pyx_v_self->_ptr);

  /* "epr.pyx":2348
 *         cdef EPR_SRecord* record_ptr
 *         record_ptr = epr_get_mph(self._ptr)
 *         if record_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get MPH record')
 * 
 */
  __pyx_t_1 = (__pyx_v_record_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2349
 *         record_ptr = epr_get_mph(self._ptr)
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get MPH record')             # <<<<<<<<<<<<<<
 * 
 *         return new_record(record_ptr, self, False)
 */
    __pyx_t_2 = ((PyObject *)__pyx_kp_s_60);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.msg = __pyx_t_2;
    __pyx_t_3 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2351
 *             pyepr_null_ptr_error('unable to get MPH record')
 * 
 *         return new_record(record_ptr, self, False)             # <<<<<<<<<<<<<<
 * 
 *     def get_sph(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_5.dealloc = 0;
  __pyx_t_2 = __pyx_f_3epr_new_record(__pyx_v_record_ptr, &__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Product.get_mph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_25get_sph(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_24get_sph[] = "get_sph(self)\n\n        The specific product header (SPH) :class:`Record`\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_25get_sph(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_sph (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_24get_sph(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2353
 *         return new_record(record_ptr, self, False)
 * 
 *     def get_sph(self):             # <<<<<<<<<<<<<<
 *         '''get_sph(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_24get_sph(struct __pyx_obj_3epr_Product *__pyx_v_self) {
  EPR_SRecord *__pyx_v_record_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_4;
  struct __pyx_opt_args_3epr_new_record __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_sph", 0);

  /* "epr.pyx":2361
 * 
 *         cdef EPR_SRecord* record_ptr
 *         record_ptr = epr_get_sph(self._ptr)             # <<<<<<<<<<<<<<
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get SPH record')
 */
  __pyx_v_record_ptr = epr_get_sph(__pyx_v_self->_ptr);

  /* "epr.pyx":2362
 *         cdef EPR_SRecord* record_ptr
 *         record_ptr = epr_get_sph(self._ptr)
 *         if record_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get SPH record')
 * 
 */
  __pyx_t_1 = (__pyx_v_record_ptr == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2363
 *         record_ptr = epr_get_sph(self._ptr)
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get SPH record')             # <<<<<<<<<<<<<<
 * 
 *         return new_record(record_ptr, self, False)
 */
    __pyx_t_2 = ((PyObject *)__pyx_kp_s_61);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.msg = __pyx_t_2;
    __pyx_t_3 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2365
 *             pyepr_null_ptr_error('unable to get SPH record')
 * 
 *         return new_record(record_ptr, self, False)             # <<<<<<<<<<<<<<
 * 
 *     def get_band(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_5.dealloc = 0;
  __pyx_t_2 = __pyx_f_3epr_new_record(__pyx_v_record_ptr, &__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Product.get_sph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_27get_band(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_3epr_7Product_26get_band[] = "get_band(self, name)\n\n        Gets the band corresponding to the specified name.\n\n        :param name:\n            the name of the band\n        :returns:\n            the requested :class:`Band` instance, or raises a\n            :exc:`EPRValueError` if not found\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_27get_band(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_band (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_26get_band(((struct __pyx_obj_3epr_Product *)__pyx_v_self), ((PyObject *)__pyx_v_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2367
 *         return new_record(record_ptr, self, False)
 * 
 *     def get_band(self, name):             # <<<<<<<<<<<<<<
 *         '''get_band(self, name)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_26get_band(struct __pyx_obj_3epr_Product *__pyx_v_self, PyObject *__pyx_v_name) {
  EPR_SBandId *__pyx_v_band_id;
  PyObject *__pyx_v_cname = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_band __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_band", 0);

  /* "epr.pyx":2381
 * 
 *         cdef EPR_SBandId* band_id
 *         cdef bytes cname = _to_bytes(name)             # <<<<<<<<<<<<<<
 *         band_id = epr_get_band_id(self._ptr, cname)
 *         if band_id is NULL:
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_3epr__to_bytes(__pyx_v_name, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cname = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "epr.pyx":2382
 *         cdef EPR_SBandId* band_id
 *         cdef bytes cname = _to_bytes(name)
 *         band_id = epr_get_band_id(self._ptr, cname)             # <<<<<<<<<<<<<<
 *         if band_id is NULL:
 *             pyepr_null_ptr_error('unable to get band "%s"' % name)
 */
  __pyx_t_2 = PyBytes_AsString(((PyObject *)__pyx_v_cname)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_band_id = epr_get_band_id(__pyx_v_self->_ptr, __pyx_t_2);

  /* "epr.pyx":2383
 *         cdef bytes cname = _to_bytes(name)
 *         band_id = epr_get_band_id(self._ptr, cname)
 *         if band_id is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get band "%s"' % name)
 * 
 */
  __pyx_t_3 = (__pyx_v_band_id == NULL);
  if (__pyx_t_3) {

    /* "epr.pyx":2384
 *         band_id = epr_get_band_id(self._ptr, cname)
 *         if band_id is NULL:
 *             pyepr_null_ptr_error('unable to get band "%s"' % name)             # <<<<<<<<<<<<<<
 * 
 *         return new_band(band_id, self)
 */
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = ((PyObject *)__pyx_t_1);
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2386
 *             pyepr_null_ptr_error('unable to get band "%s"' % name)
 * 
 *         return new_band(band_id, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_band_at(self, uint index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_1 = __pyx_f_3epr_new_band(__pyx_v_band_id, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_band", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_29get_band_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_3epr_7Product_28get_band_at[] = "get_band_at(self, index)\n\n        Gets the band at the specified position within the product\n\n        :param index:\n            the index identifying the position of the band, starting\n            with 0, must not be negative\n        :returns:\n            the requested :class:`Band` instance, or raises a\n            :exc:`EPRValueError` if not found\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_29get_band_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  uint __pyx_v_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_band_at (wrapper)", 0);
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_from_py_uint(__pyx_arg_index); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.get_band_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3epr_7Product_28get_band_at(((struct __pyx_obj_3epr_Product *)__pyx_v_self), ((uint)__pyx_v_index));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2388
 *         return new_band(band_id, self)
 * 
 *     def get_band_at(self, uint index):             # <<<<<<<<<<<<<<
 *         '''get_band_at(self, index)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_28get_band_at(struct __pyx_obj_3epr_Product *__pyx_v_self, uint __pyx_v_index) {
  EPR_SBandId *__pyx_v_band_id;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_band __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_band_at", 0);

  /* "epr.pyx":2403
 * 
 *         cdef EPR_SBandId* band_id
 *         band_id = epr_get_band_id_at(self._ptr, index)             # <<<<<<<<<<<<<<
 *         if band_id is NULL:
 *             pyepr_null_ptr_error('unable to get band at index "%d"' % index)
 */
  __pyx_v_band_id = epr_get_band_id_at(__pyx_v_self->_ptr, __pyx_v_index);

  /* "epr.pyx":2404
 *         cdef EPR_SBandId* band_id
 *         band_id = epr_get_band_id_at(self._ptr, index)
 *         if band_id is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get band at index "%d"' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_band_id == NULL);
  if (__pyx_t_1) {

    /* "epr.pyx":2405
 *         band_id = epr_get_band_id_at(self._ptr, index)
 *         if band_id is NULL:
 *             pyepr_null_ptr_error('unable to get band at index "%d"' % index)             # <<<<<<<<<<<<<<
 * 
 *         return new_band(band_id, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = ((PyObject *)__pyx_t_3);
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2407
 *             pyepr_null_ptr_error('unable to get band at index "%d"' % index)
 * 
 *         return new_band(band_id, self)             # <<<<<<<<<<<<<<
 * 
 *     def read_bitmask_raster(self, bm_expr, int xoffset, int yoffset,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = ((PyObject *)__pyx_v_self);
  __pyx_t_3 = __pyx_f_3epr_new_band(__pyx_v_band_id, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Product.get_band_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_31read_bitmask_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_7Product_30read_bitmask_raster[] = "read_bitmask_raster(self, bm_expr, xoffset, yoffset, raster)\n\n        Calculates a bit-mask raster\n\n        Calculates a bit-mask, composed of flags of the given product\n        and combined as described in the given bit-mask expression, for\n        the a certain dimension and sub-sampling as defined in the\n        given raster.\n\n        :param bm_expr:\n            a string holding the logical expression for the definition\n            of the bit-mask. In a bit-mask expression, any number of\n            the flag-names (found in the DDDB) can be composed with\n            \"(\", \")\", \"NOT\", \"AND\", \"OR\". Valid bit-mask expression are\n            for example ``flags.LAND OR flags.CLOUD`` or\n            ``NOT flags.WATER AND flags.TURBID_S``\n\n       :param xoffset:\n            across-track co-ordinate in pixel co-ordinates (zero-based)\n            of the upper right corner of the source-region\n       :param yoffset:\n            along-track co-ordinate in pixel co-ordinates (zero-based)\n            of the upper right corner of the source-region\n       :param raster:\n            the raster for the bit-mask. The data type of the raster\n            must be either e_tid_uchar or e_tid_char\n        :returns:\n            zero for success, an error code otherwise\n\n        .. seealso: :func:`create_bitmask_raster`\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_31read_bitmask_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bm_expr = 0;
  int __pyx_v_xoffset;
  int __pyx_v_yoffset;
  struct __pyx_obj_3epr_Raster *__pyx_v_raster = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_bitmask_raster (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__bm_expr,&__pyx_n_s__xoffset,&__pyx_n_s__yoffset,&__pyx_n_s__raster,0};
    PyObject* values[4] = {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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bm_expr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xoffset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_bitmask_raster", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yoffset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_bitmask_raster", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__raster)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_bitmask_raster", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_bitmask_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_bm_expr = values[0];
    __pyx_v_xoffset = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_xoffset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_yoffset = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_yoffset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_bitmask_raster", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.read_bitmask_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_raster), __pyx_ptype_3epr_Raster, 0, "raster", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_3epr_7Product_30read_bitmask_raster(((struct __pyx_obj_3epr_Product *)__pyx_v_self), __pyx_v_bm_expr, __pyx_v_xoffset, __pyx_v_yoffset, __pyx_v_raster);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2409
 *         return new_band(band_id, self)
 * 
 *     def read_bitmask_raster(self, bm_expr, int xoffset, int yoffset,             # <<<<<<<<<<<<<<
 *                             Raster raster not None):
 *         '''read_bitmask_raster(self, bm_expr, xoffset, yoffset, raster)
 */

static PyObject *__pyx_pf_3epr_7Product_30read_bitmask_raster(struct __pyx_obj_3epr_Product *__pyx_v_self, PyObject *__pyx_v_bm_expr, int __pyx_v_xoffset, int __pyx_v_yoffset, struct __pyx_obj_3epr_Raster *__pyx_v_raster) {
  PyObject *__pyx_v_c_bm_expr = 0;
  int __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_bitmask_raster", 0);

  /* "epr.pyx":2444
 *         '''
 * 
 *         cdef bytes c_bm_expr = _to_bytes(bm_expr)             # <<<<<<<<<<<<<<
 *         cdef int ret = epr_read_bitmask_raster(self._ptr, c_bm_expr,
 *                                                xoffset, yoffset,
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_3epr__to_bytes(__pyx_v_bm_expr, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c_bm_expr = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "epr.pyx":2445
 * 
 *         cdef bytes c_bm_expr = _to_bytes(bm_expr)
 *         cdef int ret = epr_read_bitmask_raster(self._ptr, c_bm_expr,             # <<<<<<<<<<<<<<
 *                                                xoffset, yoffset,
 *                                                (<Raster>raster)._ptr)
 */
  __pyx_t_2 = PyBytes_AsString(((PyObject *)__pyx_v_c_bm_expr)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":2447
 *         cdef int ret = epr_read_bitmask_raster(self._ptr, c_bm_expr,
 *                                                xoffset, yoffset,
 *                                                (<Raster>raster)._ptr)             # <<<<<<<<<<<<<<
 *         if ret != 0:
 *             pyepr_check_errors()
 */
  __pyx_v_ret = epr_read_bitmask_raster(__pyx_v_self->_ptr, __pyx_t_2, __pyx_v_xoffset, __pyx_v_yoffset, __pyx_v_raster->_ptr);

  /* "epr.pyx":2448
 *                                                xoffset, yoffset,
 *                                                (<Raster>raster)._ptr)
 *         if ret != 0:             # <<<<<<<<<<<<<<
 *             pyepr_check_errors()
 * 
 */
  __pyx_t_3 = (__pyx_v_ret != 0);
  if (__pyx_t_3) {

    /* "epr.pyx":2449
 *                                                (<Raster>raster)._ptr)
 *         if ret != 0:
 *             pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *         return raster
 */
    __pyx_t_4 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "epr.pyx":2451
 *             pyepr_check_errors()
 * 
 *         return raster             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_raster));
  __pyx_r = ((PyObject *)__pyx_v_raster);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.read_bitmask_raster", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c_bm_expr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_33get_dataset_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_32get_dataset_names[] = "get_dataset_names(self)\n\n        Return the list of names of the datasets in the product\n\n        .. note:: this method has no correspondent in the C API\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_33get_dataset_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_dataset_names (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_32get_dataset_names(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2454
 * 
 *     # --- high level interface ------------------------------------------------
 *     def get_dataset_names(self):             # <<<<<<<<<<<<<<
 *         '''get_dataset_names(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_32get_dataset_names(struct __pyx_obj_3epr_Product *__pyx_v_self) {
  EPR_SDatasetId *__pyx_v_dataset_ptr;
  int __pyx_v_idx;
  char *__pyx_v_name;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dataset_names", 0);

  /* "epr.pyx":2467
 *         cdef char* name
 * 
 *         names = []             # <<<<<<<<<<<<<<
 *         for idx in range(self.get_num_datasets()):
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_names = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "epr.pyx":2468
 * 
 *         names = []
 *         for idx in range(self.get_num_datasets()):             # <<<<<<<<<<<<<<
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)
 *             name = <char*>epr_get_dataset_name(dataset_ptr)
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_datasets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_idx = __pyx_t_4;

    /* "epr.pyx":2469
 *         names = []
 *         for idx in range(self.get_num_datasets()):
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)             # <<<<<<<<<<<<<<
 *             name = <char*>epr_get_dataset_name(dataset_ptr)
 *             names.append(_to_str(name, 'ascii'))
 */
    __pyx_v_dataset_ptr = epr_get_dataset_id_at(__pyx_v_self->_ptr, __pyx_v_idx);

    /* "epr.pyx":2470
 *         for idx in range(self.get_num_datasets()):
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)
 *             name = <char*>epr_get_dataset_name(dataset_ptr)             # <<<<<<<<<<<<<<
 *             names.append(_to_str(name, 'ascii'))
 * 
 */
    __pyx_v_name = ((char *)epr_get_dataset_name(__pyx_v_dataset_ptr));

    /* "epr.pyx":2471
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)
 *             name = <char*>epr_get_dataset_name(dataset_ptr)
 *             names.append(_to_str(name, 'ascii'))             # <<<<<<<<<<<<<<
 * 
 *         return names
 */
    __pyx_t_2 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.encoding = __pyx_t_1;
    __pyx_t_5 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyList_Append(__pyx_v_names, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "epr.pyx":2473
 *             names.append(_to_str(name, 'ascii'))
 * 
 *         return names             # <<<<<<<<<<<<<<
 * 
 *     def get_band_names(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_names));
  __pyx_r = ((PyObject *)__pyx_v_names);
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("epr.Product.get_dataset_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_35get_band_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_34get_band_names[] = "get_band_names(self)\n\n        Return the list of names of the bands in the product\n\n        .. note:: this method has no correspondent in the C API\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_35get_band_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_band_names (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_34get_band_names(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2475
 *         return names
 * 
 *     def get_band_names(self):             # <<<<<<<<<<<<<<
 *         '''get_band_names(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_34get_band_names(struct __pyx_obj_3epr_Product *__pyx_v_self) {
  EPR_SBandId *__pyx_v_band_ptr;
  int __pyx_v_idx;
  char *__pyx_v_name;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_band_names", 0);

  /* "epr.pyx":2488
 *         cdef char* name
 * 
 *         names = []             # <<<<<<<<<<<<<<
 *         for idx in range(self.get_num_bands()):
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_names = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "epr.pyx":2489
 * 
 *         names = []
 *         for idx in range(self.get_num_bands()):             # <<<<<<<<<<<<<<
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)
 *             name = <char*>epr_get_band_name(band_ptr)
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_bands); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_idx = __pyx_t_4;

    /* "epr.pyx":2490
 *         names = []
 *         for idx in range(self.get_num_bands()):
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)             # <<<<<<<<<<<<<<
 *             name = <char*>epr_get_band_name(band_ptr)
 *             names.append(_to_str(name, 'ascii'))
 */
    __pyx_v_band_ptr = epr_get_band_id_at(__pyx_v_self->_ptr, __pyx_v_idx);

    /* "epr.pyx":2491
 *         for idx in range(self.get_num_bands()):
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)
 *             name = <char*>epr_get_band_name(band_ptr)             # <<<<<<<<<<<<<<
 *             names.append(_to_str(name, 'ascii'))
 * 
 */
    __pyx_v_name = ((char *)epr_get_band_name(__pyx_v_band_ptr));

    /* "epr.pyx":2492
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)
 *             name = <char*>epr_get_band_name(band_ptr)
 *             names.append(_to_str(name, 'ascii'))             # <<<<<<<<<<<<<<
 * 
 *         return names
 */
    __pyx_t_2 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_n_s__ascii);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.encoding = __pyx_t_1;
    __pyx_t_5 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_2), &__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyList_Append(__pyx_v_names, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "epr.pyx":2494
 *             names.append(_to_str(name, 'ascii'))
 * 
 *         return names             # <<<<<<<<<<<<<<
 * 
 *     # @NOTE: generator and generator expressions are not yet implemented in
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_names));
  __pyx_r = ((PyObject *)__pyx_v_names);
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("epr.Product.get_band_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_37datasets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_36datasets[] = "datasets(self)\n\n        Return the list of dataset in the product\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_37datasets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datasets (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_36datasets(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2498
 *     # @NOTE: generator and generator expressions are not yet implemented in
 *     #        cython. As a workaround a list is used
 *     def datasets(self):             # <<<<<<<<<<<<<<
 *         '''datasets(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_36datasets(struct __pyx_obj_3epr_Product *__pyx_v_self) {
  int __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint __pyx_t_2;
  int __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("datasets", 0);

  /* "epr.pyx":2506
 * 
 *         cdef int idx
 *         return [self.get_dataset_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_datasets(self._ptr))]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "epr.pyx":2507
 *         cdef int idx
 *         return [self.get_dataset_at(idx)
 *                             for idx in range(epr_get_num_datasets(self._ptr))]             # <<<<<<<<<<<<<<
 * 
 *     def bands(self):
 */
  __pyx_t_2 = epr_get_num_datasets(__pyx_v_self->_ptr);
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_idx = __pyx_t_3;

    /* "epr.pyx":2506
 * 
 *         cdef int idx
 *         return [self.get_dataset_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_datasets(self._ptr))]
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_dataset_at); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Product.datasets", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_39bands(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_38bands[] = "bands(self)\n\n        Return the list of bands in the product\n\n        ";
static PyObject *__pyx_pw_3epr_7Product_39bands(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bands (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_38bands(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2509
 *                             for idx in range(epr_get_num_datasets(self._ptr))]
 * 
 *     def bands(self):             # <<<<<<<<<<<<<<
 *         '''bands(self)
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_38bands(struct __pyx_obj_3epr_Product *__pyx_v_self) {
  uint __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint __pyx_t_2;
  uint __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("bands", 0);

  /* "epr.pyx":2516
 *         '''
 * 
 *         return [self.get_band_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_bands(self._ptr))]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "epr.pyx":2517
 * 
 *         return [self.get_band_at(idx)
 *                             for idx in range(epr_get_num_bands(self._ptr))]             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: iter on both datasets and bands (??)
 */
  __pyx_t_2 = epr_get_num_bands(__pyx_v_self->_ptr);
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_idx = __pyx_t_3;

    /* "epr.pyx":2516
 *         '''
 * 
 *         return [self.get_band_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_bands(self._ptr))]
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_band_at); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Product.bands", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_41__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Product_41__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_40__repr__(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2523
 *     #    return itertools.chain((self.datasets(), self.bands()))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.Product(%s) %d datasets, %d bands' % (self.id_string,
 *                                 self.get_num_datasets(), self.get_num_bands())
 */

static PyObject *__pyx_pf_3epr_7Product_40__repr__(struct __pyx_obj_3epr_Product *__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);

  /* "epr.pyx":2524
 * 
 *     def __repr__(self):
 *         return 'epr.Product(%s) %d datasets, %d bands' % (self.id_string,             # <<<<<<<<<<<<<<
 *                                 self.get_num_datasets(), self.get_num_bands())
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__id_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "epr.pyx":2525
 *     def __repr__(self):
 *         return 'epr.Product(%s) %d datasets, %d bands' % (self.id_string,
 *                                 self.get_num_datasets(), self.get_num_bands())             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_datasets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_num_bands); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_64), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Product.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_7Product_43__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3epr_7Product_43__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_7Product_42__str__(((struct __pyx_obj_3epr_Product *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2527
 *                                 self.get_num_datasets(), self.get_num_bands())
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         lines = [repr(self), '']
 *         lines.extend(map(repr, self.datasets()))
 */

static PyObject *__pyx_pf_3epr_7Product_42__str__(struct __pyx_obj_3epr_Product *__pyx_v_self) {
  PyObject *__pyx_v_lines = 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "epr.pyx":2528
 * 
 *     def __str__(self):
 *         lines = [repr(self), '']             # <<<<<<<<<<<<<<
 *         lines.extend(map(repr, self.datasets()))
 *         lines.append('')
 */
  __pyx_t_1 = PyObject_Repr(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
  __pyx_t_1 = 0;
  __pyx_v_lines = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "epr.pyx":2529
 *     def __str__(self):
 *         lines = [repr(self), '']
 *         lines.extend(map(repr, self.datasets()))             # <<<<<<<<<<<<<<
 *         lines.append('')
 *         lines.extend(map(repr, self.bands()))
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_lines), __pyx_n_s__extend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetName(__pyx_b, __pyx_n_s__repr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__datasets); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "epr.pyx":2530
 *         lines = [repr(self), '']
 *         lines.extend(map(repr, self.datasets()))
 *         lines.append('')             # <<<<<<<<<<<<<<
 *         lines.extend(map(repr, self.bands()))
 *         return '\n'.join(lines)
 */
  __pyx_t_4 = ((PyObject *)__pyx_kp_s_2);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyList_Append(__pyx_v_lines, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "epr.pyx":2531
 *         lines.extend(map(repr, self.datasets()))
 *         lines.append('')
 *         lines.extend(map(repr, self.bands()))             # <<<<<<<<<<<<<<
 *         return '\n'.join(lines)
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_lines), __pyx_n_s__extend); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_GetName(__pyx_b, __pyx_n_s__repr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__bands); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":2532
 *         lines.append('')
 *         lines.extend(map(repr, self.bands()))
 *         return '\n'.join(lines)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_36), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_lines));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_lines));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lines));
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Product.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lines);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_13open(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_3epr_12open[] = "open(filename)\n\n    Opens the ENVISAT product\n\n    Opens the ENVISAT product file with the given file path, reads MPH,\n    SPH and all DSDs, organized the table with parameter of line length\n    and tie points number.\n\n    :param product_file_path:\n        the path to the ENVISAT product file\n    :returns:\n        the :class:`Product` instance representing the specified\n        product. An exception (:exc:`exceptions.ValueError`) is raised\n        if the file could not be opened.\n\n    .. seealso :class:`Product`\n\n    ";
static PyMethodDef __pyx_mdef_3epr_13open = {__Pyx_NAMESTR("open"), (PyCFunction)__pyx_pw_3epr_13open, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_12open)};
static PyObject *__pyx_pw_3epr_13open(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_12open(__pyx_self, ((PyObject *)__pyx_v_filename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2535
 * 
 * 
 * def open(filename):             # <<<<<<<<<<<<<<
 *     '''open(filename)
 * 
 */

static PyObject *__pyx_pf_3epr_12open(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  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("open", 0);

  /* "epr.pyx":2555
 *     '''
 * 
 *     return Product(filename)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3epr_Product)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3epr_15_close_api(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3epr_15_close_api = {__Pyx_NAMESTR("_close_api"), (PyCFunction)__pyx_pw_3epr_15_close_api, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_3epr_15_close_api(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_close_api (wrapper)", 0);
  __pyx_r = __pyx_pf_3epr_14_close_api(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "epr.pyx":2566
 * 
 * @atexit.register
 * def _close_api():             # <<<<<<<<<<<<<<
 *     # ensure that all EprObject(s) are collected before removing the last
 *     # reference to _EPR_C_LIB
 */

static PyObject *__pyx_pf_3epr_14_close_api(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_gc = 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("_close_api", 0);

  /* "epr.pyx":2569
 *     # ensure that all EprObject(s) are collected before removing the last
 *     # reference to _EPR_C_LIB
 *     import gc             # <<<<<<<<<<<<<<
 *     gc.collect()
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__gc), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "epr.pyx":2570
 *     # reference to _EPR_C_LIB
 *     import gc
 *     gc.collect()             # <<<<<<<<<<<<<<
 * 
 *     global _EPR_C_LIB
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_gc, __pyx_n_s__collect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":2573
 * 
 *     global _EPR_C_LIB
 *     _EPR_C_LIB = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_DECREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GIVEREF(Py_None);
  __pyx_v_3epr__EPR_C_LIB = ((struct __pyx_obj_3epr__CLib *)Py_None);

  __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_AddTraceback("epr._close_api", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_gc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":194
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "numpy.pxd":200
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = (__pyx_v_info == NULL);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":203
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":204
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":206
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "numpy.pxd":208
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":209
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "numpy.pxd":211
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "numpy.pxd":213
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
  if (__pyx_t_1) {

    /* "numpy.pxd":214
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "numpy.pxd":215
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_66), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "numpy.pxd":217
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
  if (__pyx_t_3) {

    /* "numpy.pxd":218
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "numpy.pxd":219
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_68), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "numpy.pxd":221
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "numpy.pxd":222
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "numpy.pxd":223
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  if (__pyx_v_copy_shape) {

    /* "numpy.pxd":226
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "numpy.pxd":227
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "numpy.pxd":228
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_5 = __pyx_v_ndim;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "numpy.pxd":229
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "numpy.pxd":230
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }
    goto __pyx_L7;
  }
  /*else*/ {

    /* "numpy.pxd":232
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "numpy.pxd":233
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L7:;

  /* "numpy.pxd":234
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "numpy.pxd":235
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "numpy.pxd":236
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));

  /* "numpy.pxd":239
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "numpy.pxd":240
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "numpy.pxd":244
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "numpy.pxd":246
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = (!__pyx_v_hasfields);
  if (__pyx_t_2) {
    __pyx_t_3 = (!__pyx_v_copy_shape);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "numpy.pxd":248
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "numpy.pxd":251
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L10:;

  /* "numpy.pxd":253
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {

    /* "numpy.pxd":254
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_5 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_5;

    /* "numpy.pxd":255
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
    if (__pyx_t_1) {
      __pyx_t_2 = __pyx_v_little_endian;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (!__pyx_t_2) {

      /* "numpy.pxd":256
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
      if (__pyx_t_1) {
        __pyx_t_3 = (!__pyx_v_little_endian);
        __pyx_t_7 = __pyx_t_3;
      } else {
        __pyx_t_7 = __pyx_t_1;
      }
      __pyx_t_1 = __pyx_t_7;
    } else {
      __pyx_t_1 = __pyx_t_2;
    }
    if (__pyx_t_1) {

      /* "numpy.pxd":257
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_70), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "numpy.pxd":258
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__b;
      goto __pyx_L13;
    }

    /* "numpy.pxd":259
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__B;
      goto __pyx_L13;
    }

    /* "numpy.pxd":260
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__h;
      goto __pyx_L13;
    }

    /* "numpy.pxd":261
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__H;
      goto __pyx_L13;
    }

    /* "numpy.pxd":262
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_INT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__i;
      goto __pyx_L13;
    }

    /* "numpy.pxd":263
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__I;
      goto __pyx_L13;
    }

    /* "numpy.pxd":264
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__l;
      goto __pyx_L13;
    }

    /* "numpy.pxd":265
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__L;
      goto __pyx_L13;
    }

    /* "numpy.pxd":266
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__q;
      goto __pyx_L13;
    }

    /* "numpy.pxd":267
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Q;
      goto __pyx_L13;
    }

    /* "numpy.pxd":268
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__f;
      goto __pyx_L13;
    }

    /* "numpy.pxd":269
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__d;
      goto __pyx_L13;
    }

    /* "numpy.pxd":270
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__g;
      goto __pyx_L13;
    }

    /* "numpy.pxd":271
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zf;
      goto __pyx_L13;
    }

    /* "numpy.pxd":272
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zd;
      goto __pyx_L13;
    }

    /* "numpy.pxd":273
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zg;
      goto __pyx_L13;
    }

    /* "numpy.pxd":274
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__O;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "numpy.pxd":276
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_71), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;

    /* "numpy.pxd":277
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "numpy.pxd":278
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "numpy.pxd":280
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "numpy.pxd":281
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "numpy.pxd":282
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "numpy.pxd":285
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)             # <<<<<<<<<<<<<<
 *                 f[0] = c'\0' # Terminate format string
 * 
 */
    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_9;

    /* "numpy.pxd":286
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }
  __pyx_L11:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":288
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "numpy.pxd":289
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
  if (__pyx_t_1) {

    /* "numpy.pxd":290
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":291
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":292
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":768
 * 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);

  /* "numpy.pxd":769
 * 
 * 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_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* "numpy.pxd":771
 *     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);

  /* "numpy.pxd":772
 * 
 * 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_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* "numpy.pxd":774
 *     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);

  /* "numpy.pxd":775
 * 
 * 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_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* "numpy.pxd":777
 *     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);

  /* "numpy.pxd":778
 * 
 * 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_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* "numpy.pxd":780
 *     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);

  /* "numpy.pxd":781
 * 
 * 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 char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __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_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* "numpy.pxd":783
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  char *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "numpy.pxd":790
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":791
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF(__pyx_v_childname);
    __pyx_v_childname = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "numpy.pxd":795
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
    __pyx_v_fields = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "numpy.pxd":796
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
      PyObject* sequence = ((PyObject *)__pyx_v_fields);
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (1) {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_new_offset);
    __pyx_v_new_offset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "numpy.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_7) {

      /* "numpy.pxd":799
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "numpy.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
    if (__pyx_t_7) {
      __pyx_t_8 = __pyx_v_little_endian;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    if (!__pyx_t_8) {

      /* "numpy.pxd":802
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
      if (__pyx_t_7) {
        __pyx_t_9 = (!__pyx_v_little_endian);
        __pyx_t_10 = __pyx_t_9;
      } else {
        __pyx_t_10 = __pyx_t_7;
      }
      __pyx_t_7 = __pyx_t_10;
    } else {
      __pyx_t_7 = __pyx_t_8;
    }
    if (__pyx_t_7) {

      /* "numpy.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_74), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "numpy.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_7) break;

      /* "numpy.pxd":814
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "numpy.pxd":815
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "numpy.pxd":816
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_11 = 0;
      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
    }

    /* "numpy.pxd":818
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_11 = 0;
    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);

    /* "numpy.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
    if (__pyx_t_7) {

      /* "numpy.pxd":821
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_v_t);
      __pyx_v_t = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "numpy.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
      if (__pyx_t_7) {

        /* "numpy.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "numpy.pxd":826
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L13;
      }

      /* "numpy.pxd":827
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L13;
      }

      /* "numpy.pxd":828
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L13;
      }

      /* "numpy.pxd":829
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L13;
      }

      /* "numpy.pxd":830
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L13;
      }

      /* "numpy.pxd":831
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L13;
      }

      /* "numpy.pxd":832
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L13;
      }

      /* "numpy.pxd":833
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L13;
      }

      /* "numpy.pxd":834
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L13;
      }

      /* "numpy.pxd":835
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L13;
      }

      /* "numpy.pxd":836
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L13;
      }

      /* "numpy.pxd":837
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L13;
      }

      /* "numpy.pxd":838
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L13;
      }

      /* "numpy.pxd":839
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "numpy.pxd":840
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "numpy.pxd":841
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "numpy.pxd":842
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "numpy.pxd":844
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_71), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__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_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L13:;

      /* "numpy.pxd":845
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "numpy.pxd":849
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_12;
    }
    __pyx_L11:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "numpy.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":965
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "numpy.pxd":967
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  if (__pyx_t_1) {

    /* "numpy.pxd":968
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":970
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
    Py_INCREF(__pyx_v_base);

    /* "numpy.pxd":971
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "numpy.pxd":972
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "numpy.pxd":973
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":975
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "numpy.pxd":976
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr->base == NULL);
  if (__pyx_t_1) {

    /* "numpy.pxd":977
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":979
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_3epr__CLib(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pw_3epr_5_CLib_1__cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3epr__CLib(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_3epr_5_CLib_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_3epr__CLib[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__CLib = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__CLib = {
  0, /*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__CLib = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__CLib = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr__CLib = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr._CLib"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr__CLib), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr__CLib, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__CLib, /*tp_as_number*/
  &__pyx_tp_as_sequence__CLib, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__CLib, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__CLib, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("Library object to handle C API initialization/finalization\n\n    .. warning:: this is meant for internal use only. **Do not use it**.\n\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr__CLib, /*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*/
  __pyx_pw_3epr_5_CLib_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr__CLib, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_EprObject(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_EprObject *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_EprObject *)o);
  p->epr_c_lib = Py_None; Py_INCREF(Py_None);
  if (__pyx_pw_3epr_9EprObject_1__cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3epr_EprObject(PyObject *o) {
  struct __pyx_obj_3epr_EprObject *p = (struct __pyx_obj_3epr_EprObject *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_3epr_9EprObject_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->epr_c_lib);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_3epr_EprObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_EprObject *p = (struct __pyx_obj_3epr_EprObject *)o;
  if (p->epr_c_lib) {
    e = (*v)(p->epr_c_lib, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_EprObject(PyObject *o) {
  struct __pyx_obj_3epr_EprObject *p = (struct __pyx_obj_3epr_EprObject *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->epr_c_lib);
  p->epr_c_lib = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3epr_EprObject[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_EprObject = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_EprObject = {
  0, /*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_EprObject = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_EprObject = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr_EprObject = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.EprObject"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_EprObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_EprObject, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_EprObject, /*tp_as_number*/
  &__pyx_tp_as_sequence_EprObject, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_EprObject, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_EprObject, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3epr_EprObject, /*tp_traverse*/
  __pyx_tp_clear_3epr_EprObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_EprObject, /*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*/
  __pyx_pw_3epr_9EprObject_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_EprObject, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_DSD(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_DSD *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_DSD *)o);
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_DSD(PyObject *o) {
  struct __pyx_obj_3epr_DSD *p = (struct __pyx_obj_3epr_DSD *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_parent);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_DSD(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_DSD *p = (struct __pyx_obj_3epr_DSD *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_DSD(PyObject *o) {
  struct __pyx_obj_3epr_DSD *p = (struct __pyx_obj_3epr_DSD *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3epr_3DSD_index(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_3DSD_5index_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_ds_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_3DSD_7ds_name_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_ds_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_3DSD_7ds_type_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_filename(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_3DSD_8filename_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_ds_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_3DSD_9ds_offset_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_ds_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_3DSD_7ds_size_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_num_dsr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_3DSD_7num_dsr_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_dsr_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_3DSD_8dsr_size_1__get__(o);
}

static PyMethodDef __pyx_methods_3epr_DSD[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_DSD[] = {
  {(char *)"index", __pyx_getprop_3epr_3DSD_index, 0, __Pyx_DOCSTR(__pyx_k_77), 0},
  {(char *)"ds_name", __pyx_getprop_3epr_3DSD_ds_name, 0, __Pyx_DOCSTR(__pyx_k_78), 0},
  {(char *)"ds_type", __pyx_getprop_3epr_3DSD_ds_type, 0, __Pyx_DOCSTR(__pyx_k_79), 0},
  {(char *)"filename", __pyx_getprop_3epr_3DSD_filename, 0, __Pyx_DOCSTR(__pyx_k_80), 0},
  {(char *)"ds_offset", __pyx_getprop_3epr_3DSD_ds_offset, 0, __Pyx_DOCSTR(__pyx_k_81), 0},
  {(char *)"ds_size", __pyx_getprop_3epr_3DSD_ds_size, 0, __Pyx_DOCSTR(__pyx_k_82), 0},
  {(char *)"num_dsr", __pyx_getprop_3epr_3DSD_num_dsr, 0, __Pyx_DOCSTR(__pyx_k_83), 0},
  {(char *)"dsr_size", __pyx_getprop_3epr_3DSD_dsr_size, 0, __Pyx_DOCSTR(__pyx_k_84), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_DSD = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_DSD = {
  0, /*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_DSD = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_DSD = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr_DSD = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.DSD"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_DSD), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_DSD, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_3epr_3DSD_1__repr__, /*tp_repr*/
  &__pyx_tp_as_number_DSD, /*tp_as_number*/
  &__pyx_tp_as_sequence_DSD, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_DSD, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_DSD, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Dataset descriptor\n\n    The DSD class contains information about the properties of a\n    dataset and its location within an ENVISAT product file\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_DSD, /*tp_traverse*/
  __pyx_tp_clear_3epr_DSD, /*tp_clear*/
  __pyx_pw_3epr_3DSD_3__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_DSD, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_DSD, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_3epr_9EprObject_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_DSD, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_Field(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Field *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Field *)o);
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Field(PyObject *o) {
  struct __pyx_obj_3epr_Field *p = (struct __pyx_obj_3epr_Field *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_parent);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Field(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Field *p = (struct __pyx_obj_3epr_Field *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Field(PyObject *o) {
  struct __pyx_obj_3epr_Field *p = (struct __pyx_obj_3epr_Field *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3epr_Field[] = {
  {__Pyx_NAMESTR("print_"), (PyCFunction)__pyx_pw_3epr_5Field_1print_, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_print_)},
  {__Pyx_NAMESTR("get_unit"), (PyCFunction)__pyx_pw_3epr_5Field_3get_unit, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_2get_unit)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pw_3epr_5Field_5get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_4get_description)},
  {__Pyx_NAMESTR("get_num_elems"), (PyCFunction)__pyx_pw_3epr_5Field_7get_num_elems, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_6get_num_elems)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_3epr_5Field_9get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_8get_name)},
  {__Pyx_NAMESTR("get_type"), (PyCFunction)__pyx_pw_3epr_5Field_11get_type, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_10get_type)},
  {__Pyx_NAMESTR("get_elem"), (PyCFunction)__pyx_pw_3epr_5Field_13get_elem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_12get_elem)},
  {__Pyx_NAMESTR("get_elems"), (PyCFunction)__pyx_pw_3epr_5Field_15get_elems, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_14get_elems)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Field = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Field = {
  __pyx_pw_3epr_5Field_23__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_Field = {
  __pyx_pw_3epr_5Field_23__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Field = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr_Field = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Field"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Field), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Field, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_3epr_5Field_17__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Field, /*tp_as_number*/
  &__pyx_tp_as_sequence_Field, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Field, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_3epr_5Field_19__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Field, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Represents a field within a record\n\n    A field is composed of one or more data elements of one of the\n    types defined in the internal ``field_info`` structure.\n\n    .. seealso:: :class:`Record`\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Field, /*tp_traverse*/
  __pyx_tp_clear_3epr_Field, /*tp_clear*/
  __pyx_pw_3epr_5Field_21__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Field, /*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*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_3epr_9EprObject_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Field, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_Record(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Record *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Record *)o);
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Record(PyObject *o) {
  struct __pyx_obj_3epr_Record *p = (struct __pyx_obj_3epr_Record *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_3epr_6Record_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_parent);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Record(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Record *p = (struct __pyx_obj_3epr_Record *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Record(PyObject *o) {
  struct __pyx_obj_3epr_Record *p = (struct __pyx_obj_3epr_Record *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3epr_Record[] = {
  {__Pyx_NAMESTR("get_num_fields"), (PyCFunction)__pyx_pw_3epr_6Record_3get_num_fields, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_2get_num_fields)},
  {__Pyx_NAMESTR("print_"), (PyCFunction)__pyx_pw_3epr_6Record_5print_, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_4print_)},
  {__Pyx_NAMESTR("print_element"), (PyCFunction)__pyx_pw_3epr_6Record_7print_element, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_6print_element)},
  {__Pyx_NAMESTR("get_field"), (PyCFunction)__pyx_pw_3epr_6Record_9get_field, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_8get_field)},
  {__Pyx_NAMESTR("get_field_at"), (PyCFunction)__pyx_pw_3epr_6Record_11get_field_at, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_10get_field_at)},
  {__Pyx_NAMESTR("get_field_names"), (PyCFunction)__pyx_pw_3epr_6Record_13get_field_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_12get_field_names)},
  {__Pyx_NAMESTR("fields"), (PyCFunction)__pyx_pw_3epr_6Record_15fields, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_14fields)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Record = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Record = {
  0, /*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_Record = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Record = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr_Record = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Record"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Record), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Record, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_3epr_6Record_21__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Record, /*tp_as_number*/
  &__pyx_tp_as_sequence_Record, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Record, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_3epr_6Record_19__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Record, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Represents a record read from an ENVISAT dataset\n\n    A record is composed of multiple fields.\n\n    .. seealso:: :class:`Field`\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Record, /*tp_traverse*/
  __pyx_tp_clear_3epr_Record, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_3epr_6Record_17__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Record, /*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*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_3epr_9EprObject_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Record, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_3epr_Raster __pyx_vtable_3epr_Raster;

static PyObject *__pyx_tp_new_3epr_Raster(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Raster *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Raster *)o);
  p->__pyx_vtab = __pyx_vtabptr_3epr_Raster;
  p->_parent = Py_None; Py_INCREF(Py_None);
  p->_data = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Raster(PyObject *o) {
  struct __pyx_obj_3epr_Raster *p = (struct __pyx_obj_3epr_Raster *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_3epr_6Raster_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_parent);
  Py_CLEAR(p->_data);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Raster(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Raster *p = (struct __pyx_obj_3epr_Raster *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  if (p->_data) {
    e = (*v)(p->_data, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Raster(PyObject *o) {
  struct __pyx_obj_3epr_Raster *p = (struct __pyx_obj_3epr_Raster *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_data);
  p->_data = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3epr_6Raster_data_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_6Raster_9data_type_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_source_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_6Raster_12source_width_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_source_height(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_6Raster_13source_height_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_source_step_x(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_6Raster_13source_step_x_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_source_step_y(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_6Raster_13source_step_y_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_data(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_6Raster_4data_1__get__(o);
}

static PyMethodDef __pyx_methods_3epr_Raster[] = {
  {__Pyx_NAMESTR("get_width"), (PyCFunction)__pyx_pw_3epr_6Raster_3get_width, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Raster_2get_width)},
  {__Pyx_NAMESTR("get_height"), (PyCFunction)__pyx_pw_3epr_6Raster_5get_height, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Raster_4get_height)},
  {__Pyx_NAMESTR("get_elem_size"), (PyCFunction)__pyx_pw_3epr_6Raster_7get_elem_size, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Raster_6get_elem_size)},
  {__Pyx_NAMESTR("get_pixel"), (PyCFunction)__pyx_pw_3epr_6Raster_9get_pixel, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_6Raster_8get_pixel)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_Raster[] = {
  {(char *)"data_type", __pyx_getprop_3epr_6Raster_data_type, 0, __Pyx_DOCSTR(__pyx_k_85), 0},
  {(char *)"source_width", __pyx_getprop_3epr_6Raster_source_width, 0, __Pyx_DOCSTR(__pyx_k_86), 0},
  {(char *)"source_height", __pyx_getprop_3epr_6Raster_source_height, 0, __Pyx_DOCSTR(__pyx_k_87), 0},
  {(char *)"source_step_x", __pyx_getprop_3epr_6Raster_source_step_x, 0, __Pyx_DOCSTR(__pyx_k_88), 0},
  {(char *)"source_step_y", __pyx_getprop_3epr_6Raster_source_step_y, 0, __Pyx_DOCSTR(__pyx_k_89), 0},
  {(char *)"data", __pyx_getprop_3epr_6Raster_data, 0, __Pyx_DOCSTR(__pyx_k_90), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Raster = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Raster = {
  0, /*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_Raster = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Raster = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr_Raster = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Raster"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Raster), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Raster, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_3epr_6Raster_11__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Raster, /*tp_as_number*/
  &__pyx_tp_as_sequence_Raster, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Raster, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Raster, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Represents a raster in which data will be stored\n\n    All 'size' parameter are in PIXEL.\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Raster, /*tp_traverse*/
  __pyx_tp_clear_3epr_Raster, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Raster, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_Raster, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_3epr_9EprObject_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Raster, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_3epr_Band __pyx_vtable_3epr_Band;

static PyObject *__pyx_tp_new_3epr_Band(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Band *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Band *)o);
  p->__pyx_vtab = __pyx_vtabptr_3epr_Band;
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Band(PyObject *o) {
  struct __pyx_obj_3epr_Band *p = (struct __pyx_obj_3epr_Band *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_parent);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Band(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Band *p = (struct __pyx_obj_3epr_Band *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Band(PyObject *o) {
  struct __pyx_obj_3epr_Band *p = (struct __pyx_obj_3epr_Band *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3epr_4Band_product(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_7product_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_spectr_band_index(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_17spectr_band_index_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_sample_model(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_12sample_model_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_data_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_9data_type_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_scaling_method(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_14scaling_method_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_scaling_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_14scaling_offset_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_scaling_factor(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_14scaling_factor_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_bm_expr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_7bm_expr_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_4unit_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_description(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_11description_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_lines_mirrored(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_4Band_14lines_mirrored_1__get__(o);
}

static PyMethodDef __pyx_methods_3epr_Band[] = {
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_3epr_4Band_1get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_4Band_get_name)},
  {__Pyx_NAMESTR("create_compatible_raster"), (PyCFunction)__pyx_pw_3epr_4Band_3create_compatible_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_4Band_2create_compatible_raster)},
  {__Pyx_NAMESTR("read_raster"), (PyCFunction)__pyx_pw_3epr_4Band_5read_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_4Band_4read_raster)},
  {__Pyx_NAMESTR("read_as_array"), (PyCFunction)__pyx_pw_3epr_4Band_7read_as_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_4Band_6read_as_array)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_Band[] = {
  {(char *)"product", __pyx_getprop_3epr_4Band_product, 0, __Pyx_DOCSTR(__pyx_k_91), 0},
  {(char *)"spectr_band_index", __pyx_getprop_3epr_4Band_spectr_band_index, 0, __Pyx_DOCSTR(__pyx_k_92), 0},
  {(char *)"sample_model", __pyx_getprop_3epr_4Band_sample_model, 0, __Pyx_DOCSTR(__pyx_k_93), 0},
  {(char *)"data_type", __pyx_getprop_3epr_4Band_data_type, 0, __Pyx_DOCSTR(__pyx_k_94), 0},
  {(char *)"scaling_method", __pyx_getprop_3epr_4Band_scaling_method, 0, __Pyx_DOCSTR(__pyx_k_95), 0},
  {(char *)"scaling_offset", __pyx_getprop_3epr_4Band_scaling_offset, 0, __Pyx_DOCSTR(__pyx_k_96), 0},
  {(char *)"scaling_factor", __pyx_getprop_3epr_4Band_scaling_factor, 0, __Pyx_DOCSTR(__pyx_k_97), 0},
  {(char *)"bm_expr", __pyx_getprop_3epr_4Band_bm_expr, 0, __Pyx_DOCSTR(__pyx_k_98), 0},
  {(char *)"unit", __pyx_getprop_3epr_4Band_unit, 0, __Pyx_DOCSTR(__pyx_k_99), 0},
  {(char *)"description", __pyx_getprop_3epr_4Band_description, 0, __Pyx_DOCSTR(__pyx_k_100), 0},
  {(char *)"lines_mirrored", __pyx_getprop_3epr_4Band_lines_mirrored, 0, __Pyx_DOCSTR(__pyx_k_101), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Band = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Band = {
  0, /*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_Band = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Band = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr_Band = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Band"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Band), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Band, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_3epr_4Band_9__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Band, /*tp_as_number*/
  &__pyx_tp_as_sequence_Band, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Band, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Band, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("The band of an ENVISAT product\n\n    The Band class contains information about a band within an ENVISAT\n    product file which has been opened with the :func:`open` function.\n\n    A new Band instance can be obtained with the\n    :meth:`Product.get_band` method.\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Band, /*tp_traverse*/
  __pyx_tp_clear_3epr_Band, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Band, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_Band, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_3epr_9EprObject_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Band, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_Dataset(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Dataset *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Dataset *)o);
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Dataset(PyObject *o) {
  struct __pyx_obj_3epr_Dataset *p = (struct __pyx_obj_3epr_Dataset *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_parent);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Dataset(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Dataset *p = (struct __pyx_obj_3epr_Dataset *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Dataset(PyObject *o) {
  struct __pyx_obj_3epr_Dataset *p = (struct __pyx_obj_3epr_Dataset *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3epr_7Dataset_product(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_7Dataset_7product_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_7Dataset_description(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_7Dataset_11description_1__get__(o);
}

static PyMethodDef __pyx_methods_3epr_Dataset[] = {
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_3epr_7Dataset_1get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_get_name)},
  {__Pyx_NAMESTR("get_dsd_name"), (PyCFunction)__pyx_pw_3epr_7Dataset_3get_dsd_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_2get_dsd_name)},
  {__Pyx_NAMESTR("get_num_records"), (PyCFunction)__pyx_pw_3epr_7Dataset_5get_num_records, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_4get_num_records)},
  {__Pyx_NAMESTR("get_dsd"), (PyCFunction)__pyx_pw_3epr_7Dataset_7get_dsd, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_6get_dsd)},
  {__Pyx_NAMESTR("create_record"), (PyCFunction)__pyx_pw_3epr_7Dataset_9create_record, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_8create_record)},
  {__Pyx_NAMESTR("read_record"), (PyCFunction)__pyx_pw_3epr_7Dataset_11read_record, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_10read_record)},
  {__Pyx_NAMESTR("records"), (PyCFunction)__pyx_pw_3epr_7Dataset_13records, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_12records)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_Dataset[] = {
  {(char *)"product", __pyx_getprop_3epr_7Dataset_product, 0, __Pyx_DOCSTR(__pyx_k_102), 0},
  {(char *)"description", __pyx_getprop_3epr_7Dataset_description, 0, __Pyx_DOCSTR(__pyx_k_100), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Dataset = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Dataset = {
  0, /*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_Dataset = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Dataset = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr_Dataset = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Dataset"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Dataset), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Dataset, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_3epr_7Dataset_19__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Dataset, /*tp_as_number*/
  &__pyx_tp_as_sequence_Dataset, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Dataset, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_3epr_7Dataset_17__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Dataset, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("ENVISAT dataset\n\n    The Dataset class contains information about a dataset within an\n    ENVISAT product file which has been opened with the :func:`open`\n    function.\n\n    A new Dataset instance can be obtained with the\n    :meth:`Product.get_dataset` or :meth:`Product.get_dataset_at`\n    methods.\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Dataset, /*tp_traverse*/
  __pyx_tp_clear_3epr_Dataset, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_3epr_7Dataset_15__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Dataset, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_Dataset, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_3epr_9EprObject_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Dataset, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_Product(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  if (__pyx_pw_3epr_7Product_1__cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3epr_Product(PyObject *o) {
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_3epr_7Product_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static PyObject *__pyx_getprop_3epr_7Product_file_path(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_7Product_9file_path_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_7Product_tot_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_7Product_8tot_size_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_7Product_id_string(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_7Product_9id_string_1__get__(o);
}

static PyObject *__pyx_getprop_3epr_7Product_meris_iodd_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3epr_7Product_18meris_iodd_version_1__get__(o);
}

static PyMethodDef __pyx_methods_3epr_Product[] = {
  {__Pyx_NAMESTR("get_scene_width"), (PyCFunction)__pyx_pw_3epr_7Product_7get_scene_width, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_6get_scene_width)},
  {__Pyx_NAMESTR("get_scene_height"), (PyCFunction)__pyx_pw_3epr_7Product_9get_scene_height, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_8get_scene_height)},
  {__Pyx_NAMESTR("get_num_datasets"), (PyCFunction)__pyx_pw_3epr_7Product_11get_num_datasets, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_10get_num_datasets)},
  {__Pyx_NAMESTR("get_num_dsds"), (PyCFunction)__pyx_pw_3epr_7Product_13get_num_dsds, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_12get_num_dsds)},
  {__Pyx_NAMESTR("get_num_bands"), (PyCFunction)__pyx_pw_3epr_7Product_15get_num_bands, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_14get_num_bands)},
  {__Pyx_NAMESTR("get_dataset_at"), (PyCFunction)__pyx_pw_3epr_7Product_17get_dataset_at, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_16get_dataset_at)},
  {__Pyx_NAMESTR("get_dataset"), (PyCFunction)__pyx_pw_3epr_7Product_19get_dataset, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_18get_dataset)},
  {__Pyx_NAMESTR("get_dsd_at"), (PyCFunction)__pyx_pw_3epr_7Product_21get_dsd_at, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_20get_dsd_at)},
  {__Pyx_NAMESTR("get_mph"), (PyCFunction)__pyx_pw_3epr_7Product_23get_mph, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_22get_mph)},
  {__Pyx_NAMESTR("get_sph"), (PyCFunction)__pyx_pw_3epr_7Product_25get_sph, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_24get_sph)},
  {__Pyx_NAMESTR("get_band"), (PyCFunction)__pyx_pw_3epr_7Product_27get_band, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_26get_band)},
  {__Pyx_NAMESTR("get_band_at"), (PyCFunction)__pyx_pw_3epr_7Product_29get_band_at, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_28get_band_at)},
  {__Pyx_NAMESTR("read_bitmask_raster"), (PyCFunction)__pyx_pw_3epr_7Product_31read_bitmask_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_30read_bitmask_raster)},
  {__Pyx_NAMESTR("get_dataset_names"), (PyCFunction)__pyx_pw_3epr_7Product_33get_dataset_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_32get_dataset_names)},
  {__Pyx_NAMESTR("get_band_names"), (PyCFunction)__pyx_pw_3epr_7Product_35get_band_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_34get_band_names)},
  {__Pyx_NAMESTR("datasets"), (PyCFunction)__pyx_pw_3epr_7Product_37datasets, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_36datasets)},
  {__Pyx_NAMESTR("bands"), (PyCFunction)__pyx_pw_3epr_7Product_39bands, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_38bands)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_Product[] = {
  {(char *)"file_path", __pyx_getprop_3epr_7Product_file_path, 0, __Pyx_DOCSTR(__pyx_k_103), 0},
  {(char *)"tot_size", __pyx_getprop_3epr_7Product_tot_size, 0, __Pyx_DOCSTR(__pyx_k_104), 0},
  {(char *)"id_string", __pyx_getprop_3epr_7Product_id_string, 0, __Pyx_DOCSTR(__pyx_k_105), 0},
  {(char *)"meris_iodd_version", __pyx_getprop_3epr_7Product_meris_iodd_version, 0, __Pyx_DOCSTR(__pyx_k_106), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Product = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Product = {
  0, /*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_Product = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Product = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_3epr_Product = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Product"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Product), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Product, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_3epr_7Product_41__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Product, /*tp_as_number*/
  &__pyx_tp_as_sequence_Product, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Product, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_3epr_7Product_43__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Product, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("ENVISAT product\n\n    The Product class provides methods and properties to get\n    information about an ENVISAT product file.\n\n    .. seealso:: :func:`open`\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_EprObject, /*tp_traverse*/
  __pyx_tp_clear_3epr_EprObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Product, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_Product, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_3epr_7Product_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Product, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("epr"),
    __Pyx_DOCSTR(__pyx_k_107), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_s_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 1, 0},
  {&__pyx_kp_s_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_n_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 1},
  {&__pyx_kp_s_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 0, 1, 0},
  {&__pyx_kp_s_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 1, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_n_s_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 1, 1},
  {&__pyx_n_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 1},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_n_s_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 1, 1},
  {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
  {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
  {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
  {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
  {&__pyx_n_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 1},
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
  {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
  {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0},
  {&__pyx_n_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 1},
  {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
  {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
  {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
  {&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 0},
  {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0},
  {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
  {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
  {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
  {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
  {&__pyx_kp_u_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 1, 0, 0},
  {&__pyx_kp_u_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 1, 0, 0},
  {&__pyx_kp_u_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 1, 0, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_u_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 1, 0, 0},
  {&__pyx_kp_u_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 1, 0, 0},
  {&__pyx_kp_u_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 1, 0, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_kp_s__1OF1, __pyx_k__1OF1, sizeof(__pyx_k__1OF1), 0, 0, 1, 0},
  {&__pyx_kp_s__1OF2, __pyx_k__1OF2, sizeof(__pyx_k__1OF2), 0, 0, 1, 0},
  {&__pyx_kp_s__2OF2, __pyx_k__2OF2, sizeof(__pyx_k__2OF2), 0, 0, 1, 0},
  {&__pyx_kp_s__2TOF, __pyx_k__2TOF, sizeof(__pyx_k__2TOF), 0, 0, 1, 0},
  {&__pyx_kp_s__3TOI, __pyx_k__3TOI, sizeof(__pyx_k__3TOI), 0, 0, 1, 0},
  {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s__EPRError, __pyx_k__EPRError, sizeof(__pyx_k__EPRError), 0, 0, 1, 1},
  {&__pyx_n_s__EPRTime, __pyx_k__EPRTime, sizeof(__pyx_k__EPRTime), 0, 0, 1, 1},
  {&__pyx_n_s__EPRValueError, __pyx_k__EPRValueError, sizeof(__pyx_k__EPRValueError), 0, 0, 1, 1},
  {&__pyx_n_s__EPR_C_API_VERSION, __pyx_k__EPR_C_API_VERSION, sizeof(__pyx_k__EPR_C_API_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMID_LIN, __pyx_k__E_SMID_LIN, sizeof(__pyx_k__E_SMID_LIN), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMID_LOG, __pyx_k__E_SMID_LOG, sizeof(__pyx_k__E_SMID_LOG), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMID_NON, __pyx_k__E_SMID_NON, sizeof(__pyx_k__E_SMID_NON), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_1OF1, __pyx_k__E_SMOD_1OF1, sizeof(__pyx_k__E_SMOD_1OF1), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_1OF2, __pyx_k__E_SMOD_1OF2, sizeof(__pyx_k__E_SMOD_1OF2), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_2OF2, __pyx_k__E_SMOD_2OF2, sizeof(__pyx_k__E_SMOD_2OF2), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_2TOF, __pyx_k__E_SMOD_2TOF, sizeof(__pyx_k__E_SMOD_2TOF), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_3TOI, __pyx_k__E_SMOD_3TOI, sizeof(__pyx_k__E_SMOD_3TOI), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_CHAR, __pyx_k__E_TID_CHAR, sizeof(__pyx_k__E_TID_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_DOUBLE, __pyx_k__E_TID_DOUBLE, sizeof(__pyx_k__E_TID_DOUBLE), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_FLOAT, __pyx_k__E_TID_FLOAT, sizeof(__pyx_k__E_TID_FLOAT), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_INT, __pyx_k__E_TID_INT, sizeof(__pyx_k__E_TID_INT), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_SHORT, __pyx_k__E_TID_SHORT, sizeof(__pyx_k__E_TID_SHORT), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_SPARE, __pyx_k__E_TID_SPARE, sizeof(__pyx_k__E_TID_SPARE), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_STRING, __pyx_k__E_TID_STRING, sizeof(__pyx_k__E_TID_STRING), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_TIME, __pyx_k__E_TID_TIME, sizeof(__pyx_k__E_TID_TIME), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_UCHAR, __pyx_k__E_TID_UCHAR, sizeof(__pyx_k__E_TID_UCHAR), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_UINT, __pyx_k__E_TID_UINT, sizeof(__pyx_k__E_TID_UINT), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_UNKNOWN, __pyx_k__E_TID_UNKNOWN, sizeof(__pyx_k__E_TID_UNKNOWN), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_USHORT, __pyx_k__E_TID_USHORT, sizeof(__pyx_k__E_TID_USHORT), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__ImportError, __pyx_k__ImportError, sizeof(__pyx_k__ImportError), 0, 0, 1, 1},
  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
  {&__pyx_n_s__LIN, __pyx_k__LIN, sizeof(__pyx_k__LIN), 0, 0, 1, 1},
  {&__pyx_n_s__LOG, __pyx_k__LOG, sizeof(__pyx_k__LOG), 0, 0, 1, 1},
  {&__pyx_n_s__NONE, __pyx_k__NONE, sizeof(__pyx_k__NONE), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplemented, __pyx_k__NotImplemented, sizeof(__pyx_k__NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
  {&__pyx_n_s____repr__, __pyx_k____repr__, sizeof(__pyx_k____repr__), 0, 0, 1, 1},
  {&__pyx_n_s____revision__, __pyx_k____revision__, sizeof(__pyx_k____revision__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
  {&__pyx_n_s___close_api, __pyx_k___close_api, sizeof(__pyx_k___close_api), 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__atexit, __pyx_k__atexit, sizeof(__pyx_k__atexit), 0, 0, 1, 1},
  {&__pyx_n_s__bands, __pyx_k__bands, sizeof(__pyx_k__bands), 0, 0, 1, 1},
  {&__pyx_n_s__bm_expr, __pyx_k__bm_expr, sizeof(__pyx_k__bm_expr), 0, 0, 1, 1},
  {&__pyx_n_s__byte, __pyx_k__byte, sizeof(__pyx_k__byte), 0, 0, 1, 1},
  {&__pyx_n_s__code, __pyx_k__code, sizeof(__pyx_k__code), 0, 0, 1, 1},
  {&__pyx_n_s__collect, __pyx_k__collect, sizeof(__pyx_k__collect), 0, 0, 1, 1},
  {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1},
  {&__pyx_n_s__create_raster, __pyx_k__create_raster, sizeof(__pyx_k__create_raster), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__data_type, __pyx_k__data_type, sizeof(__pyx_k__data_type), 0, 0, 1, 1},
  {&__pyx_n_s__data_type_id_to_str, __pyx_k__data_type_id_to_str, sizeof(__pyx_k__data_type_id_to_str), 0, 0, 1, 1},
  {&__pyx_n_s__datasets, __pyx_k__datasets, sizeof(__pyx_k__datasets), 0, 0, 1, 1},
  {&__pyx_n_s__days, __pyx_k__days, sizeof(__pyx_k__days), 0, 0, 1, 1},
  {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
  {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
  {&__pyx_n_s__ds_name, __pyx_k__ds_name, sizeof(__pyx_k__ds_name), 0, 0, 1, 1},
  {&__pyx_n_s__element_index, __pyx_k__element_index, sizeof(__pyx_k__element_index), 0, 0, 1, 1},
  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
  {&__pyx_n_s__epr, __pyx_k__epr, sizeof(__pyx_k__epr), 0, 0, 1, 1},
  {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
  {&__pyx_n_s__field_index, __pyx_k__field_index, sizeof(__pyx_k__field_index), 0, 0, 1, 1},
  {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
  {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1},
  {&__pyx_n_s__float32, __pyx_k__float32, sizeof(__pyx_k__float32), 0, 0, 1, 1},
  {&__pyx_n_s__flush, __pyx_k__flush, sizeof(__pyx_k__flush), 0, 0, 1, 1},
  {&__pyx_n_s__gc, __pyx_k__gc, sizeof(__pyx_k__gc), 0, 0, 1, 1},
  {&__pyx_n_s__get_band_at, __pyx_k__get_band_at, sizeof(__pyx_k__get_band_at), 0, 0, 1, 1},
  {&__pyx_n_s__get_data_type_size, __pyx_k__get_data_type_size, sizeof(__pyx_k__get_data_type_size), 0, 0, 1, 1},
  {&__pyx_n_s__get_dataset_at, __pyx_k__get_dataset_at, sizeof(__pyx_k__get_dataset_at), 0, 0, 1, 1},
  {&__pyx_n_s__get_elem, __pyx_k__get_elem, sizeof(__pyx_k__get_elem), 0, 0, 1, 1},
  {&__pyx_n_s__get_elems, __pyx_k__get_elems, sizeof(__pyx_k__get_elems), 0, 0, 1, 1},
  {&__pyx_n_s__get_field_at, __pyx_k__get_field_at, sizeof(__pyx_k__get_field_at), 0, 0, 1, 1},
  {&__pyx_n_s__get_height, __pyx_k__get_height, sizeof(__pyx_k__get_height), 0, 0, 1, 1},
  {&__pyx_n_s__get_name, __pyx_k__get_name, sizeof(__pyx_k__get_name), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_bands, __pyx_k__get_num_bands, sizeof(__pyx_k__get_num_bands), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_datasets, __pyx_k__get_num_datasets, sizeof(__pyx_k__get_num_datasets), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_elems, __pyx_k__get_num_elems, sizeof(__pyx_k__get_num_elems), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_fields, __pyx_k__get_num_fields, sizeof(__pyx_k__get_num_fields), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_records, __pyx_k__get_num_records, sizeof(__pyx_k__get_num_records), 0, 0, 1, 1},
  {&__pyx_n_s__get_scene_height, __pyx_k__get_scene_height, sizeof(__pyx_k__get_scene_height), 0, 0, 1, 1},
  {&__pyx_n_s__get_scene_width, __pyx_k__get_scene_width, sizeof(__pyx_k__get_scene_width), 0, 0, 1, 1},
  {&__pyx_n_s__get_type, __pyx_k__get_type, sizeof(__pyx_k__get_type), 0, 0, 1, 1},
  {&__pyx_n_s__get_width, __pyx_k__get_width, sizeof(__pyx_k__get_width), 0, 0, 1, 1},
  {&__pyx_n_s__height, __pyx_k__height, sizeof(__pyx_k__height), 0, 0, 1, 1},
  {&__pyx_n_s__id_string, __pyx_k__id_string, sizeof(__pyx_k__id_string), 0, 0, 1, 1},
  {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
  {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__kargs, __pyx_k__kargs, sizeof(__pyx_k__kargs), 0, 0, 1, 1},
  {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1},
  {&__pyx_n_s__message, __pyx_k__message, sizeof(__pyx_k__message), 0, 0, 1, 1},
  {&__pyx_n_s__method, __pyx_k__method, sizeof(__pyx_k__method), 0, 0, 1, 1},
  {&__pyx_n_s__microseconds, __pyx_k__microseconds, sizeof(__pyx_k__microseconds), 0, 0, 1, 1},
  {&__pyx_n_s__mmap, __pyx_k__mmap, sizeof(__pyx_k__mmap), 0, 0, 1, 1},
  {&__pyx_n_s__model, __pyx_k__model, sizeof(__pyx_k__model), 0, 0, 1, 1},
  {&__pyx_n_s__namedtuple, __pyx_k__namedtuple, sizeof(__pyx_k__namedtuple), 0, 0, 1, 1},
  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
  {&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1},
  {&__pyx_n_s__ostream, __pyx_k__ostream, sizeof(__pyx_k__ostream), 0, 0, 1, 1},
  {&__pyx_n_s__product, __pyx_k__product, sizeof(__pyx_k__product), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__raster, __pyx_k__raster, sizeof(__pyx_k__raster), 0, 0, 1, 1},
  {&__pyx_n_s__raster_ptr, __pyx_k__raster_ptr, sizeof(__pyx_k__raster_ptr), 0, 0, 1, 1},
  {&__pyx_n_s__read_raster, __pyx_k__read_raster, sizeof(__pyx_k__read_raster), 0, 0, 1, 1},
  {&__pyx_n_s__read_record, __pyx_k__read_record, sizeof(__pyx_k__read_record), 0, 0, 1, 1},
  {&__pyx_n_s__record, __pyx_k__record, sizeof(__pyx_k__record), 0, 0, 1, 1},
  {&__pyx_n_s__records, __pyx_k__records, sizeof(__pyx_k__records), 0, 0, 1, 1},
  {&__pyx_n_s__register, __pyx_k__register, sizeof(__pyx_k__register), 0, 0, 1, 1},
  {&__pyx_n_s__repr, __pyx_k__repr, sizeof(__pyx_k__repr), 0, 0, 1, 1},
  {&__pyx_n_s__seconds, __pyx_k__seconds, sizeof(__pyx_k__seconds), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__short, __pyx_k__short, sizeof(__pyx_k__short), 0, 0, 1, 1},
  {&__pyx_n_s__src_height, __pyx_k__src_height, sizeof(__pyx_k__src_height), 0, 0, 1, 1},
  {&__pyx_n_s__src_width, __pyx_k__src_width, sizeof(__pyx_k__src_width), 0, 0, 1, 1},
  {&__pyx_n_s__stdout, __pyx_k__stdout, sizeof(__pyx_k__stdout), 0, 0, 1, 1},
  {&__pyx_n_s__super, __pyx_k__super, sizeof(__pyx_k__super), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__type_id, __pyx_k__type_id, sizeof(__pyx_k__type_id), 0, 0, 1, 1},
  {&__pyx_n_s__type_id_str, __pyx_k__type_id_str, sizeof(__pyx_k__type_id_str), 0, 0, 1, 1},
  {&__pyx_n_s__uint, __pyx_k__uint, sizeof(__pyx_k__uint), 0, 0, 1, 1},
  {&__pyx_n_s__ushort, __pyx_k__ushort, sizeof(__pyx_k__ushort), 0, 0, 1, 1},
  {&__pyx_n_s__width, __pyx_k__width, sizeof(__pyx_k__width), 0, 0, 1, 1},
  {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
  {&__pyx_n_s__xoffset, __pyx_k__xoffset, sizeof(__pyx_k__xoffset), 0, 0, 1, 1},
  {&__pyx_n_s__xstep, __pyx_k__xstep, sizeof(__pyx_k__xstep), 0, 0, 1, 1},
  {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1},
  {&__pyx_n_s__yoffset, __pyx_k__yoffset, sizeof(__pyx_k__yoffset), 0, 0, 1, 1},
  {&__pyx_n_s__ystep, __pyx_k__ystep, sizeof(__pyx_k__ystep), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_super = __Pyx_GetName(__pyx_b, __pyx_n_s__super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetName(__pyx_b, __pyx_n_s__ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplemented = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplemented); if (!__pyx_builtin_NotImplemented) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "epr.pyx":518
 *     fileno = PyObject_AsFileDescriptor(ostream)
 *     if fileno == -1:
 *         raise TypeError('bad output stream')             # <<<<<<<<<<<<<<
 *         return NULL
 * 
 */
  __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_6);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));

  /* "epr.pyx":523
 *     fstream = fdopen(fileno, 'w')
 *     if fstream is NULL:
 *         raise TypeError('invalid ostream')             # <<<<<<<<<<<<<<
 * 
 *     return fstream
 */
  __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_8);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
  PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

  /* "epr.pyx":733
 * 
 *             else:
 *                 raise TypeError('DSD only implements "==" and "!=" operators')             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
  __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_15);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
  PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));

  /* "epr.pyx":895
 *             val = EPRTime(eprtime.days, eprtime.seconds, eprtime.microseconds)
 *         else:
 *             raise ValueError('invalid field type')             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
  __pyx_k_tuple_18 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_18);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_17));
  PyTuple_SET_ITEM(__pyx_k_tuple_18, 0, ((PyObject *)__pyx_kp_s_17));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));

  /* "epr.pyx":981
 *                 out[i] = (<double*>buf)[i]
 *         else:
 *             raise ValueError('invalid field type')             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
  __pyx_k_tuple_20 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_20);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_17));
  PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, ((PyObject *)__pyx_kp_s_17));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));

  /* "epr.pyx":1097
 * 
 *             else:
 *                 raise TypeError('Field only implements "==" and '             # <<<<<<<<<<<<<<
 *                                 '"!=" operators')
 *         else:
 */
  __pyx_k_tuple_33 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_33);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_32));
  PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_kp_s_32));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));

  /* "epr.pyx":1436
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)
 *         if dtype == np.NPY_NOTYPE:
 *             raise TypeError('invalid data type')             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_k_tuple_41 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_41);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_40));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_kp_s_40));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));

  /* "epr.pyx":1466
 * 
 *             if self._ptr.buffer is NULL:
 *                 return np.ndarray(())             # <<<<<<<<<<<<<<
 * 
 *             self._data = self.toarray()
 */
  __pyx_k_tuple_42 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_42);
  __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 0, ((PyObject *)__pyx_empty_tuple));
  __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));

  /* "epr.pyx":1926
 *                 width = w - xoffset
 *             else:
 *                 raise ValueError('xoffset os larger that he scene width')             # <<<<<<<<<<<<<<
 * 
 *         if height is None:
 */
  __pyx_k_tuple_49 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_49);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_48));
  PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, ((PyObject *)__pyx_kp_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));

  /* "epr.pyx":1933
 *                 height = h - yoffset
 *             else:
 *                 raise ValueError('yoffset os larger that he scene height')             # <<<<<<<<<<<<<<
 * 
 *         raster = self.create_compatible_raster(width, height, xstep, ystep)
 */
  __pyx_k_tuple_51 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_51);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, ((PyObject *)__pyx_kp_s_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));

  /* "numpy.pxd":215
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_k_tuple_66 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_66);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_65));
  PyTuple_SET_ITEM(__pyx_k_tuple_66, 0, ((PyObject *)__pyx_kp_u_65));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_65));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_66));

  /* "numpy.pxd":219
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_k_tuple_68 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_68);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_67));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 0, ((PyObject *)__pyx_kp_u_67));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_67));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));

  /* "numpy.pxd":257
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_k_tuple_70 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_70);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_69));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 0, ((PyObject *)__pyx_kp_u_69));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_69));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));

  /* "numpy.pxd":799
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_k_tuple_73 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_73);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_72));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 0, ((PyObject *)__pyx_kp_u_72));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_72));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));

  /* "numpy.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_k_tuple_74 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_74);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_69));
  PyTuple_SET_ITEM(__pyx_k_tuple_74, 0, ((PyObject *)__pyx_kp_u_69));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_69));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));

  /* "numpy.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_k_tuple_76 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_76);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_75));
  PyTuple_SET_ITEM(__pyx_k_tuple_76, 0, ((PyObject *)__pyx_kp_u_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));

  /* "epr.pyx":396
 * 
 * # utils
 * EPRTime = namedtuple('EPRTime', ('days', 'seconds', 'microseconds'))             # <<<<<<<<<<<<<<
 * 
 * EPR_C_API_VERSION = _to_str(EPR_PRODUCT_API_VERSION_STR, 'ascii')
 */
  __pyx_k_tuple_111 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_111);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__days));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 0, ((PyObject *)__pyx_n_s__days));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__days));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__seconds));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 1, ((PyObject *)__pyx_n_s__seconds));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__seconds));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__microseconds));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 2, ((PyObject *)__pyx_n_s__microseconds));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__microseconds));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111));
  __pyx_k_tuple_112 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_112);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EPRTime));
  PyTuple_SET_ITEM(__pyx_k_tuple_112, 0, ((PyObject *)__pyx_n_s__EPRTime));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EPRTime));
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_111));
  PyTuple_SET_ITEM(__pyx_k_tuple_112, 1, ((PyObject *)__pyx_k_tuple_111));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_112));

  /* "epr.pyx":453
 *     '''EPR API error'''
 * 
 *     def __init__(self, message='', code=None, *args, **kargs):             # <<<<<<<<<<<<<<
 *         '''__init__(self, message='', code=None, *args, **kargs)'''
 * 
 */
  __pyx_k_tuple_113 = PyTuple_New(7); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_113);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__message));
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 1, ((PyObject *)__pyx_n_s__message));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__message));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__code));
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 2, ((PyObject *)__pyx_n_s__code));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__code));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__args));
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 3, ((PyObject *)__pyx_n_s__args));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__args));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__kargs));
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 4, ((PyObject *)__pyx_n_s__kargs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__kargs));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__args));
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 5, ((PyObject *)__pyx_n_s__args));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__args));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__kargs));
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 6, ((PyObject *)__pyx_n_s__kargs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__kargs));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_113));
  __pyx_k_codeobj_114 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s____init__, 453, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_tuple_116 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_116);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_kp_s_2)));
  PyTuple_SET_ITEM(__pyx_k_tuple_116, 0, ((PyObject *)((PyObject*)__pyx_kp_s_2)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_kp_s_2)));
  __Pyx_INCREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_k_tuple_116, 1, ((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_116));

  /* "epr.pyx":576
 * 
 * 
 * def get_data_type_size(EPR_EDataTypeId type_id):             # <<<<<<<<<<<<<<
 *     '''get_data_type_size(type_id)
 * 
 */
  __pyx_k_tuple_118 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_118);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__type_id));
  PyTuple_SET_ITEM(__pyx_k_tuple_118, 0, ((PyObject *)__pyx_n_s__type_id));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__type_id));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__type_id));
  PyTuple_SET_ITEM(__pyx_k_tuple_118, 1, ((PyObject *)__pyx_n_s__type_id));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__type_id));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_118));
  __pyx_k_codeobj_119 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s__get_data_type_size, 576, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":586
 * 
 * 
 * def data_type_id_to_str(EPR_EDataTypeId type_id):             # <<<<<<<<<<<<<<
 *     '''data_type_id_to_str(type_id)
 * 
 */
  __pyx_k_tuple_120 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_120);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__type_id));
  PyTuple_SET_ITEM(__pyx_k_tuple_120, 0, ((PyObject *)__pyx_n_s__type_id));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__type_id));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__type_id));
  PyTuple_SET_ITEM(__pyx_k_tuple_120, 1, ((PyObject *)__pyx_n_s__type_id));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__type_id));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__type_id_str));
  PyTuple_SET_ITEM(__pyx_k_tuple_120, 2, ((PyObject *)__pyx_n_s__type_id_str));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__type_id_str));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_120));
  __pyx_k_codeobj_121 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s__data_type_id_to_str, 586, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":598
 * 
 * 
 * def get_scaling_method_name(method):             # <<<<<<<<<<<<<<
 *     '''get_scaling_method_name(method)
 * 
 */
  __pyx_k_tuple_122 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_122);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__method));
  PyTuple_SET_ITEM(__pyx_k_tuple_122, 0, ((PyObject *)__pyx_n_s__method));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__method));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__mmap));
  PyTuple_SET_ITEM(__pyx_k_tuple_122, 1, ((PyObject *)__pyx_n_s__mmap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mmap));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122));
  __pyx_k_codeobj_123 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s_124, 598, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":617
 * 
 * 
 * def get_sample_model_name(model):             # <<<<<<<<<<<<<<
 *     '''get_sample_model_name(model)
 * 
 */
  __pyx_k_tuple_125 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_125);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__model));
  PyTuple_SET_ITEM(__pyx_k_tuple_125, 0, ((PyObject *)__pyx_n_s__model));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__model));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__mmap));
  PyTuple_SET_ITEM(__pyx_k_tuple_125, 1, ((PyObject *)__pyx_n_s__mmap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mmap));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));
  __pyx_k_codeobj_126 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s_127, 617, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":1491
 * 
 * 
 * def create_raster(EPR_EDataTypeId data_type, uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                   uint xstep=1, uint ystep=1):
 *     '''create_raster(data_type, src_width, src_height, xstep=1, ystep=1)
 */
  __pyx_k_tuple_128 = PyTuple_New(6); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_128);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__data_type));
  PyTuple_SET_ITEM(__pyx_k_tuple_128, 0, ((PyObject *)__pyx_n_s__data_type));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data_type));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__src_width));
  PyTuple_SET_ITEM(__pyx_k_tuple_128, 1, ((PyObject *)__pyx_n_s__src_width));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__src_width));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__src_height));
  PyTuple_SET_ITEM(__pyx_k_tuple_128, 2, ((PyObject *)__pyx_n_s__src_height));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__src_height));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__xstep));
  PyTuple_SET_ITEM(__pyx_k_tuple_128, 3, ((PyObject *)__pyx_n_s__xstep));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xstep));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ystep));
  PyTuple_SET_ITEM(__pyx_k_tuple_128, 4, ((PyObject *)__pyx_n_s__ystep));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ystep));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__raster_ptr));
  PyTuple_SET_ITEM(__pyx_k_tuple_128, 5, ((PyObject *)__pyx_n_s__raster_ptr));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__raster_ptr));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_128));
  __pyx_k_codeobj_129 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s__create_raster, 1491, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":1536
 * 
 * 
 * def create_bitmask_raster(uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                           uint xstep=1, uint ystep=1):
 *     '''create_bitmask_raster(src_width, src_height, xstep=1, ystep=1)
 */
  __pyx_k_tuple_130 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_130);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__src_width));
  PyTuple_SET_ITEM(__pyx_k_tuple_130, 0, ((PyObject *)__pyx_n_s__src_width));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__src_width));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__src_height));
  PyTuple_SET_ITEM(__pyx_k_tuple_130, 1, ((PyObject *)__pyx_n_s__src_height));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__src_height));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__xstep));
  PyTuple_SET_ITEM(__pyx_k_tuple_130, 2, ((PyObject *)__pyx_n_s__xstep));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xstep));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ystep));
  PyTuple_SET_ITEM(__pyx_k_tuple_130, 3, ((PyObject *)__pyx_n_s__ystep));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ystep));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__raster_ptr));
  PyTuple_SET_ITEM(__pyx_k_tuple_130, 4, ((PyObject *)__pyx_n_s__raster_ptr));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__raster_ptr));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_130));
  __pyx_k_codeobj_131 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s_132, 1536, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":2535
 * 
 * 
 * def open(filename):             # <<<<<<<<<<<<<<
 *     '''open(filename)
 * 
 */
  __pyx_k_tuple_133 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_133);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__filename));
  PyTuple_SET_ITEM(__pyx_k_tuple_133, 0, ((PyObject *)__pyx_n_s__filename));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_133));
  __pyx_k_codeobj_134 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s__open, 2535, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":2566
 * 
 * @atexit.register
 * def _close_api():             # <<<<<<<<<<<<<<
 *     # ensure that all EprObject(s) are collected before removing the last
 *     # reference to _EPR_C_LIB
 */
  __pyx_k_tuple_135 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_135);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__gc));
  PyTuple_SET_ITEM(__pyx_k_tuple_135, 0, ((PyObject *)__pyx_n_s__gc));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gc));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_135));
  __pyx_k_codeobj_136 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_115, __pyx_n_s___close_api, 2566, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initepr(void); /*proto*/
PyMODINIT_FUNC initepr(void)
#else
PyMODINIT_FUNC PyInit_epr(void); /*proto*/
PyMODINIT_FUNC PyInit_epr(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_3epr__to_str __pyx_t_4;
  __Pyx_RefNannyDeclarations
  #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("PyMODINIT_FUNC PyInit_epr(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("epr"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_107), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "epr")) {
      if (unlikely(PyDict_SetItemString(modules, "epr", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_epr) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_3epr__EPR_C_LIB = ((struct __pyx_obj_3epr__CLib *)Py_None); Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_3epr__CLib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_CLib", (PyObject *)&__pyx_type_3epr__CLib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr__CLib = &__pyx_type_3epr__CLib;
  if (PyType_Ready(&__pyx_type_3epr_EprObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "EprObject", (PyObject *)&__pyx_type_3epr_EprObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_EprObject = &__pyx_type_3epr_EprObject;
  __pyx_type_3epr_DSD.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_DSD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "DSD", (PyObject *)&__pyx_type_3epr_DSD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_DSD = &__pyx_type_3epr_DSD;
  __pyx_type_3epr_Field.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Field) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Field", (PyObject *)&__pyx_type_3epr_Field) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Field = &__pyx_type_3epr_Field;
  __pyx_type_3epr_Record.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Record", (PyObject *)&__pyx_type_3epr_Record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Record = &__pyx_type_3epr_Record;
  __pyx_vtabptr_3epr_Raster = &__pyx_vtable_3epr_Raster;
  __pyx_vtable_3epr_Raster.toarray = (PyArrayObject *(*)(struct __pyx_obj_3epr_Raster *))__pyx_f_3epr_6Raster_toarray;
  __pyx_type_3epr_Raster.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Raster) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_3epr_Raster.tp_dict, __pyx_vtabptr_3epr_Raster) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Raster", (PyObject *)&__pyx_type_3epr_Raster) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Raster = &__pyx_type_3epr_Raster;
  __pyx_vtabptr_3epr_Band = &__pyx_vtable_3epr_Band;
  __pyx_vtable_3epr_Band.read_raster = (PyObject *(*)(struct __pyx_obj_3epr_Band *, int __pyx_skip_dispatch, struct __pyx_opt_args_3epr_4Band_read_raster *__pyx_optional_args))__pyx_f_3epr_4Band_read_raster;
  __pyx_type_3epr_Band.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_3epr_Band.tp_dict, __pyx_vtabptr_3epr_Band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Band", (PyObject *)&__pyx_type_3epr_Band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Band = &__pyx_type_3epr_Band;
  __pyx_type_3epr_Dataset.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Dataset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Dataset", (PyObject *)&__pyx_type_3epr_Dataset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Dataset = &__pyx_type_3epr_Dataset;
  __pyx_type_3epr_Product.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Product) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Product", (PyObject *)&__pyx_type_3epr_Product) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Product = &__pyx_type_3epr_Product;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "epr.pyx":44
 * '''
 * 
 * __revision__ = '$Id: aff31bec5e779ad5a16424ee13c0f478debff716 $'             # <<<<<<<<<<<<<<
 * __version__ = '0.7.1'
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____revision__, ((PyObject *)__pyx_kp_s_108)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":45
 * 
 * __revision__ = '$Id: aff31bec5e779ad5a16424ee13c0f478debff716 $'
 * __version__ = '0.7.1'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_109)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":368
 * from cpython.object cimport PyObject_AsFileDescriptor
 * cimport numpy as np
 * np.import_array()             # <<<<<<<<<<<<<<
 * 
 * import sys
 */
  import_array();

  /* "epr.pyx":370
 * np.import_array()
 * 
 * import sys             # <<<<<<<<<<<<<<
 * from collections import namedtuple
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":371
 * 
 * import sys
 * from collections import namedtuple             # <<<<<<<<<<<<<<
 * 
 * import numpy as np
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__namedtuple));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__namedtuple));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__namedtuple));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__namedtuple);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__namedtuple);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__namedtuple, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":373
 * from collections import namedtuple
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * cdef int PY3 = (PY_MAJOR_VERSION >= 3)
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":375
 * import numpy as np
 * 
 * cdef int PY3 = (PY_MAJOR_VERSION >= 3)             # <<<<<<<<<<<<<<
 * 
 * # internal utils
 */
  __pyx_v_3epr_PY3 = (PY_MAJOR_VERSION >= 3);

  /* "epr.pyx":378
 * 
 * # internal utils
 * _DEFAULT_FS_ENCODING = sys.getfilesystemencoding()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s_110); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_55, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":396
 * 
 * # utils
 * EPRTime = namedtuple('EPRTime', ('days', 'seconds', 'microseconds'))             # <<<<<<<<<<<<<<
 * 
 * EPR_C_API_VERSION = _to_str(EPR_PRODUCT_API_VERSION_STR, 'ascii')
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPRTime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "epr.pyx":398
 * EPRTime = namedtuple('EPRTime', ('days', 'seconds', 'microseconds'))
 * 
 * EPR_C_API_VERSION = _to_str(EPR_PRODUCT_API_VERSION_STR, 'ascii')             # <<<<<<<<<<<<<<
 * 
 * # EPR_DataTypeId
 */
  __pyx_t_1 = PyBytes_FromString(EPR_PRODUCT_API_VERSION_STR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_n_s__ascii);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.encoding = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_3epr__to_str(((PyObject *)__pyx_t_1), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPR_C_API_VERSION, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":401
 * 
 * # EPR_DataTypeId
 * E_TID_UNKNOWN = e_tid_unknown             # <<<<<<<<<<<<<<
 * E_TID_UCHAR = e_tid_uchar
 * E_TID_CHAR = e_tid_char
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_unknown); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_UNKNOWN, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":402
 * # EPR_DataTypeId
 * E_TID_UNKNOWN = e_tid_unknown
 * E_TID_UCHAR = e_tid_uchar             # <<<<<<<<<<<<<<
 * E_TID_CHAR = e_tid_char
 * E_TID_USHORT = e_tid_ushort
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_uchar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_UCHAR, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":403
 * E_TID_UNKNOWN = e_tid_unknown
 * E_TID_UCHAR = e_tid_uchar
 * E_TID_CHAR = e_tid_char             # <<<<<<<<<<<<<<
 * E_TID_USHORT = e_tid_ushort
 * E_TID_SHORT = e_tid_short
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_char); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_CHAR, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":404
 * E_TID_UCHAR = e_tid_uchar
 * E_TID_CHAR = e_tid_char
 * E_TID_USHORT = e_tid_ushort             # <<<<<<<<<<<<<<
 * E_TID_SHORT = e_tid_short
 * E_TID_UINT = e_tid_uint
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_ushort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_USHORT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":405
 * E_TID_CHAR = e_tid_char
 * E_TID_USHORT = e_tid_ushort
 * E_TID_SHORT = e_tid_short             # <<<<<<<<<<<<<<
 * E_TID_UINT = e_tid_uint
 * E_TID_INT = e_tid_int
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_short); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_SHORT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":406
 * E_TID_USHORT = e_tid_ushort
 * E_TID_SHORT = e_tid_short
 * E_TID_UINT = e_tid_uint             # <<<<<<<<<<<<<<
 * E_TID_INT = e_tid_int
 * E_TID_FLOAT = e_tid_float
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_uint); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_UINT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":407
 * E_TID_SHORT = e_tid_short
 * E_TID_UINT = e_tid_uint
 * E_TID_INT = e_tid_int             # <<<<<<<<<<<<<<
 * E_TID_FLOAT = e_tid_float
 * E_TID_DOUBLE = e_tid_double
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_INT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":408
 * E_TID_UINT = e_tid_uint
 * E_TID_INT = e_tid_int
 * E_TID_FLOAT = e_tid_float             # <<<<<<<<<<<<<<
 * E_TID_DOUBLE = e_tid_double
 * E_TID_STRING = e_tid_string
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_float); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_FLOAT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":409
 * E_TID_INT = e_tid_int
 * E_TID_FLOAT = e_tid_float
 * E_TID_DOUBLE = e_tid_double             # <<<<<<<<<<<<<<
 * E_TID_STRING = e_tid_string
 * E_TID_SPARE = e_tid_spare
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_double); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_DOUBLE, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":410
 * E_TID_FLOAT = e_tid_float
 * E_TID_DOUBLE = e_tid_double
 * E_TID_STRING = e_tid_string             # <<<<<<<<<<<<<<
 * E_TID_SPARE = e_tid_spare
 * E_TID_TIME = e_tid_time
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_string); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_STRING, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":411
 * E_TID_DOUBLE = e_tid_double
 * E_TID_STRING = e_tid_string
 * E_TID_SPARE = e_tid_spare             # <<<<<<<<<<<<<<
 * E_TID_TIME = e_tid_time
 * 
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_spare); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_SPARE, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":412
 * E_TID_STRING = e_tid_string
 * E_TID_SPARE = e_tid_spare
 * E_TID_TIME = e_tid_time             # <<<<<<<<<<<<<<
 * 
 * # EPR_SampleModel
 */
  __pyx_t_3 = PyInt_FromLong(e_tid_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_TIME, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":415
 * 
 * # EPR_SampleModel
 * E_SMOD_1OF1 = e_smod_1OF1             # <<<<<<<<<<<<<<
 * E_SMOD_1OF2 = e_smod_1OF2
 * E_SMOD_2OF2 = e_smod_2OF2
 */
  __pyx_t_3 = PyInt_FromLong(e_smod_1OF1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_1OF1, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":416
 * # EPR_SampleModel
 * E_SMOD_1OF1 = e_smod_1OF1
 * E_SMOD_1OF2 = e_smod_1OF2             # <<<<<<<<<<<<<<
 * E_SMOD_2OF2 = e_smod_2OF2
 * E_SMOD_3TOI = e_smod_3TOI
 */
  __pyx_t_3 = PyInt_FromLong(e_smod_1OF2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_1OF2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":417
 * E_SMOD_1OF1 = e_smod_1OF1
 * E_SMOD_1OF2 = e_smod_1OF2
 * E_SMOD_2OF2 = e_smod_2OF2             # <<<<<<<<<<<<<<
 * E_SMOD_3TOI = e_smod_3TOI
 * E_SMOD_2TOF = e_smod_2TOF
 */
  __pyx_t_3 = PyInt_FromLong(e_smod_2OF2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_2OF2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":418
 * E_SMOD_1OF2 = e_smod_1OF2
 * E_SMOD_2OF2 = e_smod_2OF2
 * E_SMOD_3TOI = e_smod_3TOI             # <<<<<<<<<<<<<<
 * E_SMOD_2TOF = e_smod_2TOF
 * 
 */
  __pyx_t_3 = PyInt_FromLong(e_smod_3TOI); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_3TOI, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":419
 * E_SMOD_2OF2 = e_smod_2OF2
 * E_SMOD_3TOI = e_smod_3TOI
 * E_SMOD_2TOF = e_smod_2TOF             # <<<<<<<<<<<<<<
 * 
 * # EPR_ScalingMethod
 */
  __pyx_t_3 = PyInt_FromLong(e_smod_2TOF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_2TOF, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":422
 * 
 * # EPR_ScalingMethod
 * E_SMID_NON = e_smid_non             # <<<<<<<<<<<<<<
 * E_SMID_LIN = e_smid_lin
 * E_SMID_LOG = e_smid_log
 */
  __pyx_t_3 = PyInt_FromLong(e_smid_non); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMID_NON, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":423
 * # EPR_ScalingMethod
 * E_SMID_NON = e_smid_non
 * E_SMID_LIN = e_smid_lin             # <<<<<<<<<<<<<<
 * E_SMID_LOG = e_smid_log
 * 
 */
  __pyx_t_3 = PyInt_FromLong(e_smid_lin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMID_LIN, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":424
 * E_SMID_NON = e_smid_non
 * E_SMID_LIN = e_smid_lin
 * E_SMID_LOG = e_smid_log             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyInt_FromLong(e_smid_log); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMID_LOG, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":450
 * 
 * 
 * class EPRError(Exception):             # <<<<<<<<<<<<<<
 *     '''EPR API error'''
 * 
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "epr.pyx":453
 *     '''EPR API error'''
 * 
 *     def __init__(self, message='', code=None, *args, **kargs):             # <<<<<<<<<<<<<<
 *         '''__init__(self, message='', code=None, *args, **kargs)'''
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3epr_8EPRError_1__init__, 0, NULL, __pyx_n_s__epr, ((PyObject *)__pyx_k_codeobj_114)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_k_tuple_116));
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "epr.pyx":450
 * 
 * 
 * class EPRError(Exception):             # <<<<<<<<<<<<<<
 *     '''EPR API error'''
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  if (PyDict_SetItemString(((PyObject *)__pyx_t_3), "__doc__", ((PyObject *)__pyx_kp_s_117)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3), __pyx_n_s__EPRError, __pyx_n_s__epr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPRError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "epr.pyx":462
 * 
 * 
 * class EPRValueError(EPRError, ValueError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_ValueError);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_builtin_ValueError);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3), __pyx_n_s__EPRValueError, __pyx_n_s__epr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPRValueError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "epr.pyx":559
 * 
 * # global _CLib instance
 * cdef _CLib _EPR_C_LIB = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_DECREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GIVEREF(Py_None);
  __pyx_v_3epr__EPR_C_LIB = ((struct __pyx_obj_3epr__CLib *)Py_None);

  /* "epr.pyx":576
 * 
 * 
 * def get_data_type_size(EPR_EDataTypeId type_id):             # <<<<<<<<<<<<<<
 *     '''get_data_type_size(type_id)
 * 
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3epr_1get_data_type_size, NULL, __pyx_n_s__epr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_data_type_size, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":586
 * 
 * 
 * def data_type_id_to_str(EPR_EDataTypeId type_id):             # <<<<<<<<<<<<<<
 *     '''data_type_id_to_str(type_id)
 * 
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3epr_3data_type_id_to_str, NULL, __pyx_n_s__epr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__data_type_id_to_str, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":598
 * 
 * 
 * def get_scaling_method_name(method):             # <<<<<<<<<<<<<<
 *     '''get_scaling_method_name(method)
 * 
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3epr_5get_scaling_method_name, NULL, __pyx_n_s__epr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_124, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":617
 * 
 * 
 * def get_sample_model_name(model):             # <<<<<<<<<<<<<<
 *     '''get_sample_model_name(model)
 * 
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3epr_7get_sample_model_name, NULL, __pyx_n_s__epr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_127, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":1491
 * 
 * 
 * def create_raster(EPR_EDataTypeId data_type, uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                   uint xstep=1, uint ystep=1):
 *     '''create_raster(data_type, src_width, src_height, xstep=1, ystep=1)
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3epr_9create_raster, NULL, __pyx_n_s__epr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__create_raster, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":1536
 * 
 * 
 * def create_bitmask_raster(uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                           uint xstep=1, uint ystep=1):
 *     '''create_bitmask_raster(src_width, src_height, xstep=1, ystep=1)
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3epr_11create_bitmask_raster, NULL, __pyx_n_s__epr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_132, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":2535
 * 
 * 
 * def open(filename):             # <<<<<<<<<<<<<<
 *     '''open(filename)
 * 
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3epr_13open, NULL, __pyx_n_s__epr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__open, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":2559
 * 
 * # library initialization/finalization
 * _EPR_C_LIB = _CLib.__new__(_CLib)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr__CLib)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr__CLib)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XGOTREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_DECREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_v_3epr__EPR_C_LIB = ((struct __pyx_obj_3epr__CLib *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "epr.pyx":2562
 * 
 * 
 * import atexit             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__atexit), 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__atexit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":2565
 * 
 * 
 * @atexit.register             # <<<<<<<<<<<<<<
 * def _close_api():
 *     # ensure that all EprObject(s) are collected before removing the last
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__atexit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__register); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":2566
 * 
 * @atexit.register
 * def _close_api():             # <<<<<<<<<<<<<<
 *     # ensure that all EprObject(s) are collected before removing the last
 *     # reference to _EPR_C_LIB
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3epr_15_close_api, NULL, __pyx_n_s__epr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___close_api, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "epr.pyx":2577
 * 
 * # clean namespace
 * del atexit, namedtuple             # <<<<<<<<<<<<<<
 */
  if (__Pyx_DelAttrString(__pyx_m, "atexit") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_DelAttrString(__pyx_m, "namedtuple") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "epr.pyx":1
 * # -*- coding: utf-8 -*-             # <<<<<<<<<<<<<<
 * 
 * # PyEPR - Python bindings for ENVISAT Product Reader API
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "numpy.pxd":975
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    __Pyx_AddTraceback("init epr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init epr");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

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
}

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_CheckExact(key)) || 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
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(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
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(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,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

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,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    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 PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#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;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            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;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
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 *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 = PyEval_CallObject(type, args);
        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 && cause != Py_None) {
        PyObject *fixed_cause;
        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) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    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;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (DECREF may run arbitrary code). */
    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;
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CPYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

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);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || 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
}

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;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    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_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                /* try package relative import first */
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, (char *)"__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}

static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (op->func_doc == NULL && 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 (op->func_doc == 0) {
        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)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL)
        op->func_doc = Py_None; /* Mark as deleted */
    else
        op->func_doc = value;
    Py_INCREF(op->func_doc);
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (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
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (value == NULL || !PyUnicode_Check(value)) {
#else
    if (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_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)
{
    if (op->func_dict == NULL) {
        op->func_dict = PyDict_New();
        if (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)
{
    PyObject *tmp;
    if (value == NULL) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (!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(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    PyObject* dict = PyModule_GetDict(__pyx_m);
    Py_XINCREF(dict);
    return dict;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op)
{
    if (op->defaults_tuple) {
        Py_INCREF(op->defaults_tuple);
        return op->defaults_tuple;
    }
    if (op->defaults_getter) {
        PyObject *res = op->defaults_getter((PyObject *) op);
        if (res) {
            Py_INCREF(res);
            op->defaults_tuple = res;
        }
        return res;
    }
    Py_INCREF(Py_None);
    return Py_None;
}
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 *) "__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, 0, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, 0, 0, 0},
    {0, 0, 0, 0, 0}
};
#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.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
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags,
                                      PyObject *closure, PyObject *module, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    op->func_weakreflist = 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;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_getter = NULL;
    PyObject_GC_Track(op);
    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_doc);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (m->func_weakreflist != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(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_doc);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    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)
{
    __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 PyMethod_New(func,
                            type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *func_name = __Pyx_CyFunction_get_name(op);
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                func_name, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(func_name), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    Py_ssize_t size;
    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
    case METH_VARARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 0)
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%zd 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 (size == 1)
                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%zd 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;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
    sizeof(__pyx_CyFunctionObject),   /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    (reprfunc) __Pyx_CyFunction_repr,   /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    __Pyx_CyFunction_Call,              /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_CyFunction_traverse,   /*tp_traverse*/
    (inquiry) __Pyx_CyFunction_clear,   /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    0,                                  /*tp_iternext*/
    __pyx_CyFunction_methods,           /*tp_methods*/
    __pyx_CyFunction_members,           /*tp_members*/
    __pyx_CyFunction_getsets,           /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    __Pyx_CyFunction_descr_get,         /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*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*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
};
static int __Pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    if (PyType_Ready(&__pyx_CyFunctionType_type) < 0)
        return -1;
    __pyx_CyFunctionType = &__pyx_CyFunctionType_type;
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, sizeof(size));
    m->defaults_pyobjects = pyobjects;
    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 uint __Pyx_PyInt_from_py_uint(PyObject* x) {
    const uint neg_one = (uint)-1, const_zero = (uint)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(uint) == sizeof(char)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (uint)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(uint) == sizeof(short)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (uint)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(uint) == sizeof(int)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (uint)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(uint) == sizeof(long)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (uint)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(uint) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (uint)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
        #else
        uint val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        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 (uint)-1;
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint(uint val) {
    const uint neg_one = (uint)-1, const_zero = (uint)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(uint) == sizeof(char))  ||
        (sizeof(uint) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(uint) == sizeof(int)) ||
               (sizeof(uint) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(uint) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(uint),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uchar(uchar val) {
    const uchar neg_one = (uchar)-1, const_zero = (uchar)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(uchar) == sizeof(char))  ||
        (sizeof(uchar) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(uchar) == sizeof(int)) ||
               (sizeof(uchar) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(uchar) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(uchar),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_ushort(ushort val) {
    const ushort neg_one = (ushort)-1, const_zero = (ushort)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(ushort) == sizeof(char))  ||
        (sizeof(ushort) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(ushort) == sizeof(int)) ||
               (sizeof(ushort) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(ushort) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(ushort),
                                     little, !is_unsigned);
    }
}

#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

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__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_sumf(__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_difff(__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_prodf(__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;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__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_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__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_absf(__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_powf(__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:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(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

#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

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__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(__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(__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(__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;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__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(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__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(__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(__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:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(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

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #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);
    }
}

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);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && (size_t)((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

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) / 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, 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);
}

#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,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __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,      /*int firstlineno,*/
        __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;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    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_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

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  /* Python 3+ has unicode identifiers */
        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;
        ++t;
    }
    return 0;
}


/* Type Conversion Functions */

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 PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  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 = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
